redbadger / react.london

:star2: react.london conference & community website :star2:
https://react.london
10 stars 3 forks source link

make-circle-ci-green-again #375

Closed jdockeray closed 3 years ago

jdockeray commented 3 years ago

Make circle ci green again

What was the issue?

All builds were failing due to a change to the underlying circle ubuntu image. Read this thread on the circle forums if you would like context on what was happening.

What has changed?

After investigating with @kephail we changed the underlying base image which was over 2 years old to use the circle ci node image. This then led some sudo commands starting docker service to stop working. After some further investigation, I realized that docker was already available on the image so I removed these commands.

Now the build was passing but the push and deploy script that pushes to Amazons Elastic Container Registry was not authenticating properly and so was not able to push. I suspect that this is due to the way circle ci 2.1 runs docker commands in a remote separate environment for security reasons. I looked at some examples of communicating between AWS and circle and it seemed like the recommended way to do this was to use orbs (which are like functions for ci).

Using the orb for aws/ecr and for aws/cli I was able to get the deploy and push scripts working again. This did mean I had to change the structure of the circle.yml and the shell script for pushing and deploying images.

How can we test it?

[x] circle ci passes [] make sure staging works

SiAshbery commented 3 years ago

Thank you for tackling this! It's great to see things running green again!