-
Notifications
You must be signed in to change notification settings - Fork 17
/
.gitlab-ci.yml
228 lines (214 loc) · 7.01 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
image: prusa/oe-next
stages:
- build
- hwtest
- deploy
- nightly
variables:
GIT_SUBMODULE_STRATEGY: "recursive"
GIT_DEPTH: "0"
before_script:
- eval $(ssh-agent -s)
- echo "$NIGHTLY_DEPLOY_KEY" | tr -d '\r' | ssh-add - > /dev/null
- echo "$DEV_DEPLOY_KEY" | tr -d '\r' | ssh-add - > /dev/null
- ssh-keyscan github.com >> ~/.ssh/known_hosts
- cat ~/.ssh/known_hosts
- mkdir -p build/conf && touch build/conf/auto.conf
- cat build/conf/auto.conf
- echo "$DEV_CERT" > sources/meta-prusa/files/ca.cert.pem
- echo "$DEV_KEY" > sources/meta-prusa/files/ca.key.pem
- export VERSION=$(./version.sh)
- echo "Version ${VERSION}"
- export BB_ENV_EXTRAWHITE="${BB_ENV_EXTRAWHITE} CI_COMMIT_REF_NAME CI_COMMIT_TAG"
cache:
key: build-cache-honister
paths:
- build/cache
b:raucb-development:
stage: build
rules:
- if: $BUMP_ONLY
when: never
- if: $CI_COMMIT_REF_NAME =~ /^nightly-.*$/ || $CI_PIPELINE_SOURCE != "push"
when: always
- when: never
dependencies: []
needs: []
script:
- cat build/conf/auto.conf
- source oe-init-build-env
- bitbake --quiet sla-update-bundle
- cd ..
- mv build/tmp/deploy/images/prusa64-sl1/sla-update-bundle-prusa64-sl1-*.raucb ${VERSION}.dev-key.raucb
- mv build/tmp/deploy/images/prusa64-sl1/sla-image-prusa64-sl1-*.manifest ${VERSION}.manifest
- mv build/tmp/deploy/images/prusa64-sl1/Image--*.bin .
- mv Image--* `ls Image--* | sed 's#^Image--v\([^-]\+\)-.*$#Image-\1#'`
- mv changelog.md ${VERSION}.changelog.md
- cat build/tmp/log/cooker/prusa64-sl1/console-latest.log | xz > log.txt.xz
artifacts:
expire_in: 1 week
name: "$CI_COMMIT_REF_NAME"
paths:
- ./*.raucb
- ./*.manifest
- ./*.changelog.md
- ./log.txt.xz
- ./Image-*
b:raucb-production:
stage: build
rules:
- if: $BUMP_ONLY
when: never
- if: $CI_PIPELINE_SOURCE != "push" && $RAUC_CERT_FILE && $RAUC_KEY_FILE && $RAUC_PKCS11_PIN && $PKCS11_PROXY_SOCKET && $RAUC_PKCS11_MODULE && $CERT_VALID_DAYS
when: manual
allow_failure: true
- when: never
dependencies: []
needs: []
script:
- ./sign_cert_check.sh
- source oe-init-build-env
- export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE RAUC_CERT_FILE RAUC_KEY_FILE RAUC_PKCS11_PIN PKCS11_PROXY_SOCKET RAUC_PKCS11_MODULE"
- bitbake --quiet sla-update-bundle
- cd ..
- mv build/tmp/deploy/images/prusa64-sl1/sla-update-bundle-prusa64-sl1-*.raucb ${VERSION}.prod-key.raucb
- mv build/tmp/deploy/images/prusa64-sl1/sla-image-prusa64-sl1-*.manifest ${VERSION}.manifest
- mv changelog.md ${VERSION}.changelog.md
artifacts:
expire_in: 1 week
name: "$CI_COMMIT_REF_NAME"
paths:
- ./*.raucb
- ./*.manifest
- ./*.changelog.md
b:tools-sl1:
stage: build
rules:
- if: $BUMP_ONLY
when: never
- if: $CI_COMMIT_REF_NAME =~ /^nightly-.*$/ || $CI_PIPELINE_SOURCE != "push"
when: always
- when: never
dependencies: []
needs: []
script:
- source oe-init-build-env
- bitbake --quiet sla-dev-image sla-bootstrap
- cd ..
- cat build/tmp/log/cooker/prusa64-sl1/console-latest.log | xz > log.txt.xz
- xz -T0 --verbose build/tmp/deploy/images/prusa64-sl1/*.rootfs.wic
- mv build/tmp/deploy/images/prusa64-sl1/sla-dev-image-prusa64-sl1-*.wic.xz ${VERSION}.devsd.xz
- mv build/tmp/deploy/images/prusa64-sl1/sla-dev-image-prusa64-sl1-*.wic.bmap ${VERSION}.devsd.bmap
- mv build/tmp/deploy/images/prusa64-sl1/sla-dev-image-prusa64-sl1-*.manifest ${VERSION}.devsd.manifest
- mv build/tmp/deploy/images/prusa64-sl1/sla-bootstrap-prusa64-sl1-*.rootfs.wic.xz ${VERSION}.bootstrapsd.xz
- mv build/tmp/deploy/images/prusa64-sl1/sla-bootstrap-prusa64-sl1-*.rootfs.wic.bmap ${VERSION}.bootstrapsd.bmap
artifacts:
expire_in: 1 week
name: "$CI_COMMIT_REF_NAME"
paths:
- ./*.devsd.*
- ./*.bootstrapsd.*
- ./log*.txt.xz
# Deployment of tested devel images
d:raucb-development:
image: prusa/oe-deploy
stage: deploy
before_script:
- export VERSION=$(./version.sh)
- echo "Version ${VERSION}"
cache: {}
rules:
- if: $BUMP_ONLY == "1"
when: never
- if: $CI_COMMIT_REF_NAME =~ /^nightly-.*$/ || $CI_PIPELINE_SOURCE != "push"
when: manual
allow_failure: true
- when: never
dependencies:
- b:raucb-development
needs:
- b:raucb-development
script:
- >
smbclient ${SMB_BACKUP_SHARE} -U ${SMB_BACKUP_CREDENTIALS} -c " \
cd builds/Firmware/sl1; \
put ${VERSION}.dev-key.raucb; \
put ${VERSION}.changelog.md; \
"
- echo $GOOGLE_APPLICATION_CREDENTIALS > /tmp/google-credentials.json
- gcloud auth activate-service-account --key-file=/tmp/google-credentials.json
- gsutil cp ${VERSION}.dev-key.raucb gs://${GOOGLE_BUCKET_NAME}/images/net_update_sl1/;
- gsutil cp ${VERSION}.changelog.md gs://${GOOGLE_BUCKET_NAME}/images/net_update_sl1/;
- curl https://sl1.prusa3d.com/scan-bucket/?hash=$GOOGLE_BUCKET_HASH
d:raucb-production:
image: prusa/oe-deploy
stage: deploy
before_script:
- export VERSION=$(./version.sh)
- echo "Version ${VERSION}"
rules:
- if: $BUMP_ONLY
when: never
- if: $CI_PIPELINE_SOURCE != "push"
when: manual
allow_failure: true
- when: never
cache: {}
dependencies:
- "b:raucb-production"
needs:
- "b:raucb-production"
script:
- >
smbclient ${SMB_BACKUP_SHARE} -U ${SMB_BACKUP_CREDENTIALS} -c " \
cd builds/Firmware/sl1; \
put ${VERSION}.prod-key.raucb; \
put ${VERSION}.changelog.md; \
"
- echo $GOOGLE_APPLICATION_CREDENTIALS > /tmp/google-credentials.json
- gcloud auth activate-service-account --key-file=/tmp/google-credentials.json
- gsutil cp ${VERSION}.prod-key.raucb gs://${GOOGLE_BUCKET_NAME}/images/net_update_sl1/;
- gsutil cp ${VERSION}.changelog.md gs://${GOOGLE_BUCKET_NAME}/images/net_update_sl1/;
- curl https://sl1.prusa3d.com/scan-bucket/?hash=$GOOGLE_BUCKET_HASH
d:tools-sl1:
image: prusa/oe-deploy
stage: deploy
before_script:
- export VERSION=$(./version.sh)
- echo "Version ${VERSION}"
rules:
- if: $BUMP_ONLY
when: never
- if: $CI_PIPELINE_SOURCE != "push"
when: manual
- when: never
cache: {}
dependencies:
- b:tools-sl1
needs:
- b:tools-sl1
script:
- >
smbclient ${SMB_BACKUP_SHARE} -U ${SMB_BACKUP_CREDENTIALS} -c " \
cd builds/Firmware/sl1; \
put ${VERSION}.devsd.xz; \
put ${VERSION}.devsd.bmap; \
put ${VERSION}.bootstrapsd.xz; \
put ${VERSION}.bootstrapsd.bmap; \
"
n:update:
stage: nightly
cache: {}
rules:
- if: "$CI_COMMIT_REF_NAME !~ /^nightly-.*$/"
when: never
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: always
- when: manual
allow_failure: true
dependencies: []
needs: []
script:
- ./update_project.py $(echo ${CI_COMMIT_REF_NAME} | sed 's/^nightly-//')
- git remote set-url --push origin [email protected]:prusa3d/sl1/meta-sl1.git
- git push origin HEAD:${CI_COMMIT_REF_NAME}