Convert pipeline to full Docker multi-stage build
To speed up the deployment of the site, we can replace the individual build jobs to replace it with a single stage that only pushes the built branch if the tests pass.
This means we can get rid of the Dockerfile.test
and the test stage,
as it's now occurring within the build phase.
We can also remove the Dockerfile.deploy
as all we need is our gem
dependencies and git
and ssh
, remembering to check out our Git repo,
as we had previously removed set GIT_STRATEGY: none
so we could bundle
the deployment configuration into the deploy image.
We need to make sure that we copy all the right files in for testing, as we don't need everything in it, even though it increases the work we have to do to copy all the right bits in.
Unfortunately the theme_branch
Rake task doesn't translate to the new
build model, as it needs access to .git
and themes/
. Instead of
copying those in, as well, we can instead move the script out to a
separate build job, retaining the nice Ruby code, in a super quick
execution alongside our other jobs.
Actually closes #210 (closed), as this replaces the other Dockerfile
s to give
us a single Dockerfile
as a source-of-truth.
This will hopefully speed up the deployment pipeline, but maybe not! It'll be worth seeing what the real impact is long-term.