-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.gitlab-ci.yml
62 lines (53 loc) · 1.32 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
image: docker:18.09.8
services:
- docker:18.09.8-dind
stages:
- build
cache:
paths:
- .cache/
before_script:
- docker info
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- mkdir -p .cache/apk && ln -sf `pwd`/.cache/apk /etc/apk/cache
setup_cache:
stage: .pre
script:
- apk update
- apk add git
.docker_build_template: &docker_build
stage: build
script:
- apk add git
- git archive --output=docker/opendiamond-HEAD.tar.gz HEAD
- |
[ "$CI_COMMIT_REF_NAME" = "master" ] && IMAGE_TAG="$CI_REGISTRY_IMAGE" ||
IMAGE_TAG="$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME"
- docker pull $IMAGE_TAG:$DIST || true
- |
docker build -t $IMAGE_TAG:$DIST -f docker/Dockerfile.$DIST \
--cache-from $IMAGE_TAG:$DIST \
--build-arg PIP_INDEX_URL=http://$PROXPI_SERVICE_HOST:5000/index/ \
--build-arg PIP_TRUSTED_HOST=$PROXPI_SERVICE_HOST \
docker
- docker push $IMAGE_TAG:$DIST \
cache:
policy: pull
# Discontinued distribution?
#build.centos6:
# <<: *docker_build
# variables:
# DIST: centos6
# Unclear how to properly fix xml2rfc errors
#build.centos7:
# <<: *docker_build
# variables:
# DIST: centos7
build.buster:
<<: *docker_build
variables:
DIST: buster
build.xenial:
<<: *docker_build
variables:
DIST: xenial