1
0
Fork 0
home-dns/.gitlab-ci.yml

77 lines
1.3 KiB
YAML

stages:
- status-pre
- build
- image
- status-post
build-go:
stage: build
image: apextoaster/golang:1.14
tags:
- platform:k8s
- runner:shared
script:
- time go build
- time go test
variables:
GOPATH: /build
artifacts:
paths:
- home-dns
expire_in: 1 hour
cache:
key: "${CI_COMMIT_REF_SLUG}"
policy: pull-push
paths:
- vendor
build-image:
stage: image
image: apextoaster/docker:18.09
services:
- apextoaster/docker-dind:18.09
tags:
- platform:k8s
- runner:k8s
dependencies:
- build-go
allow_failure: false
before_script:
- mkdir ${HOME}/.docker
- echo "${DOCKER_SECRET}" | base64 -d > ${HOME}/.docker/config.json
script:
- ${CI_PROJECT_DIR}/scripts/docker-build.sh --push
after_script:
- rm -rfv ${HOME}/.docker
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://localhost:237
github-pending:
stage: status-pre
extends:
- .build-base
script:
- ./scripts/github-status.sh pending
github-failure:
stage: status-post
extends:
- .build-base
when: on_failure
script:
- ./scripts/github-status.sh failure
github-success:
stage: status-post
extends:
- .build-base
when: on_success
script:
- ./scripts/github-status.sh success