forked from mindrunner/docker-android-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
124 lines (106 loc) · 3.26 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [ "" ]
cache:
paths:
- .docker-cache
stages:
- build-lazydl
- build-standalone-1
- build-standalone-2
- release
before_script:
- echo "{\"auths\":{\"https://index.docker.io/v1/\":{\"auth\":\"$(echo -n ${DOCKER_HUB_USERNAME}:${DOCKER_HUB_KEY} | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
.build-image: &build-image
- |-
export DOCKER_REPO=$(echo "$DOCKER_REPO" | tr '[:upper:]' '[:lower:]')
/kaniko/executor \
--cache=true \
--cache-dir "./.docker-cache" \
--cache-repo "${DOCKER_REPO}/cache" \
--compressed-caching=false \
--snapshotMode=redo \
--single-snapshot \
--use-new-run \
--context "${CONTEXT}" \
--dockerfile "${DOCKERFILE}" \
--destination "${DOCKER_REPO}:${TAG_PREFIX}-${CI_COMMIT_REF_SLUG}" \
--destination "${DOCKER_REPO}:${TAG_PREFIX}-${CI_COMMIT_SHORT_SHA}" \
$(if [ ! -z "${CI_COMMIT_TAG}" ]; then echo "--destination ${DOCKER_REPO}:${CI_COMMIT_TAG}"; fi) \
${DOCKER_BUILD_ARGS}
.release-lazydl: &release-lazydl
- echo "FROM runmymind/docker-android-sdk:${TAG_PREFIX}-master" | /kaniko/executor --dockerfile /dev/stdin --destination runmymind/docker-android-sdk:lazydl
.release-latest: &release-latest
- echo "FROM runmymind/docker-android-sdk:${TAG_PREFIX}-master" | /kaniko/executor --dockerfile /dev/stdin --destination runmymind/docker-android-sdk:latest
.release-image: &release-image
- echo "FROM runmymind/docker-android-sdk:${TAG_PREFIX}-master" | /kaniko/executor --dockerfile /dev/stdin --destination runmymind/docker-android-sdk:${TAG_PREFIX}
build-alpine-lazydl:
stage: build-lazydl
variables:
CONTEXT: ${CI_PROJECT_DIR}
DOCKERFILE: ${CI_PROJECT_DIR}/alpine/lazydl/Dockerfile
DOCKER_REPO: runmymind/docker-android-sdk
TAG_PREFIX: "alpine-lazydl"
script:
- *build-image
build-alpine-standalone:
stage: build-standalone-1
variables:
CONTEXT: ${CI_PROJECT_DIR}
DOCKERFILE: ${CI_PROJECT_DIR}/alpine/standalone/Dockerfile
DOCKER_REPO: runmymind/docker-android-sdk
TAG_PREFIX: "alpine-standalone"
script:
- *build-image
build-ubuntu-lazydl:
stage: build-lazydl
variables:
CONTEXT: ${CI_PROJECT_DIR}
DOCKERFILE: ${CI_PROJECT_DIR}/ubuntu/lazydl/Dockerfile
DOCKER_REPO: runmymind/docker-android-sdk
TAG_PREFIX: "ubuntu-lazydl"
script:
- *build-image
build-ubuntu-standalone:
stage: build-standalone-2
variables:
CONTEXT: ${CI_PROJECT_DIR}
DOCKERFILE: ${CI_PROJECT_DIR}/ubuntu/standalone/Dockerfile
DOCKER_REPO: runmymind/docker-android-sdk
TAG_PREFIX: "ubuntu-standalone"
script:
- *build-image
release-alpine-lazydl:
stage: release
variables:
TAG_PREFIX: "alpine-lazydl"
script:
- *release-image
only:
- master
release-alpine-standalone:
stage: release
variables:
TAG_PREFIX: "alpine-standalone"
script:
- *release-image
only:
- master
release-ubuntu-lazydl:
stage: release
variables:
TAG_PREFIX: "ubuntu-lazydl"
script:
- *release-image
- *release-lazydl
only:
- master
release-ubuntu-standalone:
stage: release
variables:
TAG_PREFIX: "ubuntu-standalone"
script:
- *release-image
- *release-latest
only:
- master