First order of business: Portainer shutdown after restarting Docker…which is nessary because Docker is reporting the incorrect time upon resumption from sleep. Looks like I just need to launch the conatiner with --restart.

Building a container on Travis CI

There is a wealth of knowledge available! Or at least the Google hits looking promising! Traivs’ blogs say we can’t use conatiners (at the bottom). Their user generated guide is fairly straight forward.

Trying to find a better, less confusing way to manage the automated Travis CI scripts I’ve settled on using a .travis directory to contain them. This will contain a number of subdirectories related to the actions intended. Right now I’ve got .traivs/deploy/development to deploy to the development environment. In the future I would expect to create additional directories, like .travis/deploy/release-candidate for deploying a release candiate and .travis/test/units for running the unit tests. These will probably have top-level actions eventually extracted to .travis/deploy.action.

The deployment process should be relatively simple: build the container, push the container into the remote repository. I finished validating container building on another computer this morning. Only minor changes need; not bad. Now for scaling the next mountain. I woudl imagine the steps to complete are as follows: authenticate to ECR, push to the container, notify ECS to swap out the tasks.

First problem I’ve encountered: aws ecr get-login returns a script to be evaluated. Grr! Why didn’t they just directly call out? Their guide says I need to copy and paste the output; I’m just going to use eval because it’s an automated process. Hmm, looks like someone has already entered AWS credentials. Time to version the credentials I guess? Just going to stick a I2_ in front of the vairables. Hmm, I’ll also have to compensate for the environment; I’ll handle that one later.

Well, I overlooked the deployment process specifically looks for specific branches to map to the target environment. I’ve don’t recall ever using an or operation with the shell if statement. Totally blanked on installing the AWS tools.

I got an interesting error: SignatureDoesNotMatch with a whole bunch of text. Turns out I didn’t get the CI user permission to login via docker. So a few lessons I’ve learned from this:

        {
            "Effect": "Allow",
            "Action": [
                "ecr:GetAuthorizationToken",
                "ecr:DescribeRepositories"
            ],
            "Resource": [
                "*"
            ]
        }

The above is required to use aws ecr get-login. After the ECR name you need a octothorp *. Then the big blow: ECR repositories function like images with tags :-/. That is really disappointing. Well, no rest of the weary.

Spining up another application under ECS

Two errors stand between me and getting this done. The first is a permissino error with an autoscaling target. I’m assuming this just means I need to source the correct policy to replicate. The second is about creating the ECS service which isn’t idemopodent. I think this stems from the bootstrapping container to registry issue. That I will have to resolve last and probably get creative. The first error was definitely a lack of a lax enough policy being attached. ECS idempodency wasn’t the issue; a missing container was.