Dan Anglin
5fbdaa5a02
This is the first of a few commits for creating the GitLab CI pipeline for building and publishing my CV. This commit adds a pipeline for building and publishing the cv-builder docker image to the GitLab container registry. Additions: - The cv-builder docker image: This commit adds a Dockerfile for building the cv-builder docker image. The image is based on the golang (buster) image and installs ConTeXt (standalone version) and the Carlito font. - The gitlab-ci.yml file: This commit adds the gitlab-ci.yml file for running the pipeline for building and publishing the docker image to the GitLab Container Registry. Changes: - The Makefile now includes targets for building and publishing docker images.
47 lines
808 B
YAML
47 lines
808 B
YAML
---
|
|
stages:
|
|
- test
|
|
- build
|
|
- publish
|
|
|
|
variables:
|
|
IMAGE_NAME: ${CI_REGISTRY}/${CI_PROJECT_PATH}/cv-builder
|
|
IMAGE_TAG: ${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}
|
|
|
|
services:
|
|
- docker:19.03.5-dind
|
|
|
|
.use-docker:
|
|
image: docker:19.03.5
|
|
|
|
.install-deps: &install-deps
|
|
- apk add --no-cache make
|
|
|
|
test:docker-image:
|
|
extends: .use-docker
|
|
script:
|
|
- *install-deps
|
|
- make image
|
|
stage: test
|
|
only:
|
|
changes:
|
|
- docker/Dockerfile
|
|
except:
|
|
refs:
|
|
- master
|
|
|
|
publish:docker-image:
|
|
extends: .use-docker
|
|
before_script:
|
|
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
|
|
after_script:
|
|
- docker logout ${CI_REGISTRY}
|
|
script:
|
|
- *install-deps
|
|
- make publish
|
|
stage: publish
|
|
only:
|
|
changes:
|
|
- docker/Dockerfile
|
|
refs:
|
|
- master@dananglin/cv
|