authelia/.buildkite/pipeline.yml
Clément Michaud ce7b6b8167
Build docker image upfront in CI and use it in integration tests. (#555)
* Build docker image upfront in CI and use it in integration tests.

Previously, the development workflow was broken because the container
generated from Dockerfile.CI was used in dev environments but the binary
was not pre-built as it is on buildkite. I propose to just remove that
image and use the "to be published" image instead in integration tests.

This will have several advantages:
- Fix the dev workflow.
- Remove CI arch from authelia-scripts build command
- Optimize CI time in buildkite since we'll cache a way small artifact
- We don't build authelia more than once for earch arch.

* Fix suites and only build ARM images on master or tagged commits

* Optimise pipeline dependencies and Kubernetes suite to utilise cache

* Run unit tests and docker image build in parallel.

* Fix suite trying to write on read only fs.

Co-authored-by: Amir Zarrinkafsh <nightah@me.com>
2020-01-17 20:46:51 +01:00

42 lines
1.1 KiB
YAML

steps:
- label: ":hammer_and_wrench: Unit Test"
command: "authelia-scripts --log-level debug ci"
- label: ":docker: Image Builds"
command: ".buildkite/steps/buildimages.sh | buildkite-agent pipeline upload"
agents:
build: "true"
depends_on: ~
- wait
- label: ":chrome: Integration Tests"
command: ".buildkite/steps/e2etests.sh | buildkite-agent pipeline upload"
depends_on:
- "build-docker-amd64"
- wait:
if: build.branch == "master" || build.branch =~ /^v/
- label: ":docker: Image Deployments"
command: ".buildkite/steps/deployimages.sh | buildkite-agent pipeline upload"
branches: "master v*"
- wait:
if: build.branch == "master" || build.branch =~ /^v/
- label: ":docker: Deploy Manifests"
command: "authelia-scripts docker push-manifest"
branches: "master v*"
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
- label: ":github: Deploy Artifacts"
command: ".buildkite/steps/ghartifacts.sh"
agents:
upload: "fast"
depends_on:
- "build-docker-amd64"
- "build-docker-arm32v7"
- "build-docker-arm64v8"
if: build.tag != null