forked from jetstack-experimental/couchbase-sidecar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
71 lines (66 loc) · 1.47 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
63
64
65
66
67
68
69
70
71
variables:
DOCKER_DRIVER: overlay
GO_PROJECT_DIR: /go/src/github.com/jetstack-experimental/couchbase-sidecar
stages:
- build
- docker
build:golang:
image: golang:1.7
stage: build
tags:
- docker
script:
- export OLD_DIR=$(pwd)
- mkdir -p $(dirname ${GO_PROJECT_DIR})
- mv ${OLD_DIR} ${GO_PROJECT_DIR}
- cd ${GO_PROJECT_DIR}
- make build APP_VERSION="${CI_BUILD_TAG}"
- mv ${GO_PROJECT_DIR} ${OLD_DIR}
artifacts:
paths:
- couchbase-sidecar
build:golang:
image: golang:1.7
stage: build
tags:
- docker
script:
- export OLD_DIR=$(pwd)
- mkdir -p $(dirname ${GO_PROJECT_DIR})
- mv ${OLD_DIR} ${GO_PROJECT_DIR}
- cd ${GO_PROJECT_DIR}
- make test build
- mv ${GO_PROJECT_DIR} ${OLD_DIR}
artifacts:
paths:
- couchbase-sidecar
docker:image:
image: docker:latest
stage: docker
tags:
- docker
script:
- apk --update add make
- mkdir -p ~/.docker && echo "${DOCKER_AUTH_CONFIG}" > ~/.docker/config.json && chmod 600 ~/.docker/config.json
- make image push IMAGE_TAGS="${CI_BUILD_REF_SLUG}-${CI_PIPELINE_ID} canary"
only:
- master
except:
- tags
services:
- docker:dind
docker:image_tagged:
image: docker:latest
stage: docker
tags:
- docker
script:
- apk --update add make
- mkdir -p ~/.docker && echo "${DOCKER_AUTH_CONFIG}" > ~/.docker/config.json && chmod 600 ~/.docker/config.json
- make image push IMAGE_TAGS="${CI_BUILD_TAG} latest"
only:
- tags
except:
- master
services:
- docker:dind