gitlab-build-images/.gitlab-ci.yml
Lukas Eipert a9cf88c469 Welcome to the matrix
This refactors our custom image building to utilize GitLab parallel jobs
with a matrix.

This makes it easier to parse what kind of matrix we are going to build
in our docker images. Furthermore instead of splitting the image name,
we can simply pull the versions of the tools from the environment
variables.

The ultimative reason: Dogfooding
2021-12-07 12:10:42 +01:00

36 lines
952 B
YAML

# we support merge request workflow only
include:
- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
- local: '.gitlab/ci/*.yml'
default:
image: docker:20.10.9-git
services:
- docker:20.10.9-dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
- apk add -U bash
tags:
- gitlab-org-docker
stages:
- test
- deploy
- automation
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2375
cache-google-chrome:
stage: automation
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Starts the job immediately
needs: []
variables:
MOUNT_POINT: /builds/$CI_PROJECT_PATH/mnt
script:
- mkdir -p "$MOUNT_POINT"
- cp scripts/cache-google-chrome $MOUNT_POINT
- docker run -e "AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID" -e "AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY" -v "$MOUNT_POINT:/mnt" ubuntu:16.04 /mnt/cache-google-chrome