Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated docs #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,40 @@
# LambCI ECS cluster and Docker image

More documentation should be coming soon, but to get up and running quickly,
launch the `cluster.template` file in CloudFormation and give your stack a name like `lambci-ecs`
launch the `cluster.template` file in CloudFormation and give your stack a name like `lambci-ecs`.

(You should have already created a LambCI stack as documented at https://github.com/lambci/lambci)

This will create an auto-scaling group and an ECS cluster and task definition,
which you can find in the AWS console from `Services > EC2 Container Service`

LambCI-ECS will look for a `Dockerfile.test` is in the root of the repository. This is where you put your test/build instructions.

## LambCI configuration

You'll need to give the Lambda function in your LambCI stack access to run the task, so will need add to IAM
permissions something like this:

```json
{
"Effect": "Allow",
"Action": "ecs:RunTask",
"Resource": "arn:aws:ecs:*:*:task-definition/lambci-ecs-BuildTask-1PVABCDEFKFT"
"PolicyName": "LambCIECS",
"PolicyDocument": {
"Statement": {
"Effect": "Allow",
"Action": "ecs:RunTask",
"Resource": "arn:aws:ecs:*:*:task-definition/lambci-ecs-BuildTask-1PVABCDEFKFT"
}
}
}
```

Where you replace the resource with the name of the ECS task definition created in your `lambci-ecs` stack.
This block should be added as part of the `LambdaExecution > Properties > Policies` section of the `lambci` template.

Replace the `Resource` value with the name of the ECS task definition created in your `lambci-ecs` stack.

![Example resource location](http://i.imgur.com/3U7NHQr.png)

## Project configuration

Then in the project you want to build using ECS, you'll need to ensure the following LambCI config settings are given:

Expand All @@ -34,6 +47,8 @@ Then in the project you want to build using ECS, you'll need to ensure the follo
}
```

(replacing with the actual names of your cluster and task)
(replacing with the actual names of your ECS cluster and task)

![Example cluster and task location](http://i.imgur.com/DKgcdBU.png)

These are normal LambCI config settings which you can set in your `.lambci.js[on]` file or in the config DB.