forked from cert-manager/cert-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
56 lines (49 loc) · 1.69 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
image: golang:1.9
variables:
DOCKER_DRIVER: overlay
PKG_PATH: github.com/jetstack/cert-manager
services:
- docker:1.12-dind
before_script:
# Install docker
# Note: 1.11+ changes the tarball format
- curl -L "https://get.docker.com/builds/Linux/x86_64/docker-1.9.1.tgz" | tar -C /usr/bin -xvzf- --strip-components=3 usr/local/bin/docker
- curl -L https://storage.googleapis.com/kubernetes-helm/helm-v2.8.1-linux-amd64.tar.gz | tar -C /tmp -xvzf- && mv /tmp/linux-amd64/helm /usr/local/bin
- curl -L https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 >/tmp/dep && chmod +x /tmp/dep && mv /tmp/dep /usr/local/bin/
- apt-get update
- apt-get install -y make curl
- export DOCKER_HOST=${DOCKER_PORT}
- docker info > /dev/null
- mkdir -p "${GOPATH}/src/${PKG_PATH}" && rmdir "${GOPATH}/src/${PKG_PATH}"
- mv "${CI_PROJECT_DIR}" "${GOPATH}/src/${PKG_PATH}"
- cd "${GOPATH}/src/${PKG_PATH}"
- mkdir -p "${CI_PROJECT_DIR}"
- export PULL_BASE_SHA=${CI_COMMIT_SHA}
after_script:
- cd "/"
- rm -rf "${CI_PROJECT_DIR}"
- mv "${GOPATH}/src/${PKG_PATH}" "${CI_PROJECT_DIR}"
build:
tags:
- docker
script:
- make verify build
except:
- master
- tags
master_push:
tags:
- docker
script:
- mkdir -p ~/.docker && echo "${DOCKER_AUTH_CONFIG}" > ~/.docker/config.json && chmod 600 ~/.docker/config.json
- make verify build push IMAGE_TAGS="${CI_BUILD_REF_SLUG}-${CI_PIPELINE_ID} canary"
only:
- master
release_push:
tags:
- docker
script:
- mkdir -p ~/.docker && echo "${DOCKER_AUTH_CONFIG}" > ~/.docker/config.json && chmod 600 ~/.docker/config.json
- APP_VERSION=${CI_COMMIT_TAG} make verify build push IMAGE_TAGS="${CI_COMMIT_TAG}"
only:
- tags