CV/.gitlab/ci/docker-gitlab-ci.yml
Dan Anglin 5fd72b045a
refactor: replace make with mage
This commit removes the Makefile and uses mage to build the CV files and Docker images.

Changes include:

- All make targets are re-written in go in magefile.go
- The spellcheck script is now written in go and is part of the magefile
- Created mage.go to remove dependency on a mage binary
- Updated CI pipelines to use mage
- Removed unused Makefile
- Removed unused spellcheck bash script
- Cleaned up .gitignore
- Updated .aspell/.aspell.en.pws

NOTE: The updated pipeline for generating the docker image is untested for this MR.
2020-08-09 05:08:30 +01:00

65 lines
1.4 KiB
YAML

---
#--------------------------------------------------------#
# Hidden job templates for Docker build/publish pipeline #
#--------------------------------------------------------#
.docker-build-setup:
image: docker:19.03.12
services:
- docker:19.03.12-dind
before_script:
- apk add --no-cache go
.dockerfile-lint:
stage: test
image: hadolint/hadolint:v1.18.0-alpine
script:
- "hadolint docker/Dockerfile"
.dockerbuild-test:
stage: test
extends: .docker-build-setup
.docker-test-rules:
rules:
- changes:
- "docker/Dockerfile"
when: always
.docker-publish-pre-post:
stage: publish
extends: .docker-build-setup
before_script:
- apk add --no-cache go
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
after_script:
- docker logout ${CI_REGISTRY}
.docker-publish-rules:
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PROJECT_PATH == "dananglin/cv"'
changes:
- "docker/Dockerfile"
when: always
#------------------------------------------------#
# Visible jobs for Docker build/publish pipeline #
#------------------------------------------------#
test:dockerfile:lint:
extends:
- .dockerfile-lint
- .docker-test-rules
test:docker:build:
extends:
- .dockerbuild-test
- .docker-test-rules
script:
- go run mage.go image
publish:docker-image:
extends:
- .docker-publish-pre-post
- .docker-publish-rules
script:
- go run mage.go publishImage