-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
148 lines (139 loc) · 4.66 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
---
image: $CI_REGISTRY_IMAGE/devlab-build:latest
.tags:
tags:
- docker
stages:
- docker-images
- test
- build
- upload
- deploy
.kaniko-build:
stage: docker-images
only:
refs:
- branches
- merge_requests
tags:
- docker
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- if [ "$CI_COMMIT_REF_SLUG" == 'master' ]; then KANIKO_ARGS="--destination $CI_REGISTRY_IMAGE/${DOCKER_IMAGE_NAME}:latest $KANIKO_ARGS"; fi
- echo "${KANIKO_ARGS}"
- |
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" \
> /kaniko/.docker/config.json
- |
echo "-----BEGIN CERTIFICATE-----
MIIFJTCCAw2gAwIBAgIUMI0Z8YSLeRq8pZks40O3Dq2m8TIwDQYJKoZIhvcNAQEL
BQAwGjEYMBYGA1UEAxMPRXZlcm55bSBSb290IENBMB4XDTE3MTAxMTIwMTAxMFoX
DTQ3MTAwNDIwMTAzOVowGjEYMBYGA1UEAxMPRXZlcm55bSBSb290IENBMIICIjAN
BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA1kjmtmMfLJfsqUNaco44N3brW8Vu
b02lAeEwbxc65mwfAG8kAj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5NyQ+yn
pOSN2NOh5h3ZrYAxm3i4Il0orVLveVcTVDGeAgZUII4YLJi/01RHGqit3aCuApSh
bzFTZ5FldFss+JX9iAhqpFDbHLgae0F3QmYEnGilt/PzO4j23QJo3FZKeruQLH7P
L9aOgN6S2+Akbbm9YTc59yzU5TZMxANwTdaYFWFqk/8nKgZiBR1l8jnWTlWnm86A
qVssH3DLKwiYrWSOHRzGuN5BmPXxxtKQJlwAXt0wJE3puUkaJSRo7CJQ3QNMoKDe
OjzXc9WvkFIXr3Eui8UTiHB/WT7N4o8hmVN404akGfWE0YNwRVfWpjGdew6g0tZi
lFnjUUk49av67um43JHcinT5NFPuleZzkjaL/D8ueOrjXQDy05rwVdgmw9pXog4B
Tw6APXtEnjfD2H8HOpOX/7ef4gWK0O1Q7A==
-----END CERTIFICATE-----" >> /kaniko/ssl/certs/ca-certificates.crt
- |
/kaniko/executor ${KANIKO_ARGS} --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/${DOCKERFILE_PATH} \
--destination $CI_REGISTRY_IMAGE/${DOCKER_IMAGE_NAME}:${CI_COMMIT_REF_SLUG}
dockerimage_devlab_debpackage:
extends: .kaniko-build
variables:
DOCKERFILE_PATH: 'ci/builder.Dockerfile'
DOCKER_IMAGE_NAME: 'devlab-build'
only:
changes:
- ci/builder.Dockerfile
syntax:
stage: test
extends: .tags
script:
- python -m py_compile devlab
- python -m py_compile installer.py
- pylint devlab
- pylint -E devlab_bench
- pylint installer.py
make_pkg:
stage: build
extends: .tags
script:
- ci/build.sh
needs:
- syntax
artifacts:
paths:
- artifacts/*
expire_in: 1 week
upload_release_asset:
stage: upload
extends: .tags
variables:
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/devlab"
VERSION: $CI_COMMIT_TAG
needs:
- make_pkg
script:
- ci/upload_release_asset.sh
artifacts:
paths:
- artifacts/assets.out
only:
- tags@te/devlab
- tags@evernym/utilities/devlab
create_github_release:
stage: deploy
extends: .tags
environment:
name: Github
url: https://github.com/evernym/devlab/releases
variables:
GITHUB_OWNER: evernym
GITHUB_REPO: devlab
script:
- ci/create_github_release.sh
needs:
- make_pkg
only:
- tags@te/devlab
- tags@evernym/utilities/devlab
when: on_success
create_gitlab_release:
stage: deploy
extends: .tags
image: registry.gitlab.com/gitlab-org/release-cli:latest
variables:
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/devlab"
VERSION: $CI_COMMIT_TAG
script:
- ci/create_gitlab_release.sh
needs:
- upload_release_asset
- make_pkg
only:
- tags@te/devlab
- tags@evernym/utilities/devlab
when: on_success