2018-01-22 03:53:05 +00:00
|
|
|
stages:
|
2020-04-06 04:04:28 +00:00
|
|
|
- status-pre
|
2018-01-22 03:53:05 +00:00
|
|
|
- build
|
2020-04-06 03:56:05 +00:00
|
|
|
- image
|
2020-04-06 04:04:28 +00:00
|
|
|
- status-post
|
2018-01-22 03:53:05 +00:00
|
|
|
|
2020-04-06 04:07:01 +00:00
|
|
|
.build-base:
|
|
|
|
image: apextoaster/base:1.3
|
2020-04-06 03:56:05 +00:00
|
|
|
tags:
|
|
|
|
- platform:k8s
|
|
|
|
- runner:shared
|
2018-03-31 14:52:12 +00:00
|
|
|
|
2020-04-06 04:07:01 +00:00
|
|
|
build-go:
|
|
|
|
extends:
|
|
|
|
- .build-base
|
|
|
|
stage: build
|
|
|
|
image: apextoaster/golang:1.14
|
2018-01-22 03:53:05 +00:00
|
|
|
script:
|
2018-04-01 19:03:00 +00:00
|
|
|
- time go build
|
|
|
|
- time go test
|
2018-03-31 14:35:30 +00:00
|
|
|
variables:
|
|
|
|
GOPATH: /build
|
|
|
|
|
2018-01-22 03:53:05 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2018-03-10 16:25:15 +00:00
|
|
|
- home-dns
|
2018-01-22 03:53:05 +00:00
|
|
|
expire_in: 1 hour
|
2018-03-09 03:45:51 +00:00
|
|
|
cache:
|
|
|
|
key: "${CI_COMMIT_REF_SLUG}"
|
2018-03-31 14:52:12 +00:00
|
|
|
policy: pull-push
|
|
|
|
paths:
|
|
|
|
- vendor
|
|
|
|
|
2020-04-06 03:56:05 +00:00
|
|
|
build-image:
|
2020-04-06 04:07:01 +00:00
|
|
|
extends:
|
|
|
|
- .build-base
|
2020-04-06 03:56:05 +00:00
|
|
|
stage: image
|
|
|
|
image: apextoaster/docker:18.09
|
2018-01-22 03:53:05 +00:00
|
|
|
services:
|
2020-04-06 03:56:05 +00:00
|
|
|
- apextoaster/docker-dind:18.09
|
2018-03-31 14:35:30 +00:00
|
|
|
dependencies:
|
2020-04-06 03:56:05 +00:00
|
|
|
- build-go
|
|
|
|
allow_failure: false
|
|
|
|
|
2018-03-31 14:35:30 +00:00
|
|
|
before_script:
|
2020-04-06 03:56:05 +00:00
|
|
|
- mkdir ${HOME}/.docker
|
|
|
|
- echo "${DOCKER_SECRET}" | base64 -d > ${HOME}/.docker/config.json
|
2018-03-31 14:35:30 +00:00
|
|
|
script:
|
2020-04-06 03:56:05 +00:00
|
|
|
- ${CI_PROJECT_DIR}/scripts/docker-build.sh --push
|
|
|
|
after_script:
|
|
|
|
- rm -rfv ${HOME}/.docker
|
|
|
|
|
2018-01-22 03:53:05 +00:00
|
|
|
variables:
|
|
|
|
DOCKER_DRIVER: overlay2
|
2020-04-06 04:11:40 +00:00
|
|
|
DOCKER_HOST: tcp://localhost:2375
|
2020-04-06 04:05:21 +00:00
|
|
|
IMAGE_ARCH: ubuntu
|
2020-04-06 04:04:28 +00:00
|
|
|
|
|
|
|
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
|