forked from prusa3d/Prusa-Firmware-SL1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
185 lines (158 loc) · 5.42 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
image: prusa/oe
stages:
- build
- deploy
- sign
variables:
GIT_SUBMODULE_STRATEGY: "normal"
before_script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- echo "$DEV_DEPLOY_KEY" | tr -d '\r' | ssh-add - > /dev/null
- cat ~/.ssh/known_hosts
- mkdir -p build/conf && touch build/conf/auto.conf
- sed -i -e '/SSTATE_DIR/d' -e '/DL_DIR/d' build/conf/auto.conf
- cat build/conf/auto.conf
- echo "$DEV_CA_CERT" > sources/meta-prusa/files/dev-ca.pem
- echo "$DEV_CA_CERT" > sources/meta-prusa/recipes-core/rauc/files/ca.cert.pem
- echo "$DEV_CA_KEY" > sources/meta-prusa/recipes-core/rauc/files/ca.key.pem
- echo "$DEV_CERT" > sources/meta-prusa/files/ca.cert.pem
- echo "$DEV_KEY" > sources/meta-prusa/files/ca.key.pem
cache:
key: build-cache
paths:
- build/downloads
- build/cache
- build/sstate-cache
build:raucb:
stage: build
only:
- tags
- merge_requests
- web
script:
- cat build/conf/auto.conf
- source oe-init-build-env
- bitbake sla-update-bundle
- cd ..
- BASE=$(git describe --dirty)
- mv build/tmp/deploy/images/prusa64-sl1/sla-update-bundle-prusa64-sl1-*.raucb ${BASE}.raucb
- mv build/tmp/deploy/images/prusa64-sl1/sla-image-prusa64-sl1-*.etc.ext4 ${BASE}.etc.ext4
- mv build/tmp/deploy/images/prusa64-sl1/sla-initramfs-prusa64-sl1-*.manifest ${BASE}.initramfs.manifest
- mv build/tmp/deploy/images/prusa64-sl1/sla-image-prusa64-sl1-*.manifest ${BASE}.manifest
- mv changelog.md ${BASE}.changelog.md
- mv known-issues.txt ${BASE}.known-issues.txt
artifacts:
expire_in: 1 week
name: "$CI_COMMIT_REF_NAME"
paths:
- ./*.raucb
- ./*.etc.ext4
- ./*.manifest
- ./*.changelog.md
- ./*.known-issues.txt
build:tools:
stage: build
when: manual
dependencies: []
only:
- tags
- merge_requests
- web
script:
- source oe-init-build-env
- bitbake sla-image-dev sla-bootstrap
- xz -T0 --verbose tmp/deploy/images/prusa64-sl1/*.rootfs.wic
- cd ..
- BASE=$(git describe --dirty)
- mv build/tmp/deploy/images/prusa64-sl1/sla-image-dev-prusa64-sl1-*.wic.xz ${BASE}.devsd.xz
- mv build/tmp/deploy/images/prusa64-sl1/sla-image-dev-prusa64-sl1-*.wic.bmap ${BASE}.devsd.bmap
- mv build/tmp/deploy/images/prusa64-sl1/sla-image-dev-prusa64-sl1-*.manifest ${BASE}.devsd.manifest
- mv build/tmp/deploy/images/prusa64-sl1/sla-bootstrap-prusa64-sl1-*.rootfs.wic.xz ${BASE}.bootstrapsd.xz
- mv build/tmp/deploy/images/prusa64-sl1/sla-bootstrap-prusa64-sl1-*.rootfs.wic.bmap ${BASE}.bootstrapsd.bmap
artifacts:
expire_in: 1 week
name: "$CI_COMMIT_REF_NAME"
paths:
- ./*.devsd.*
- ./*.bootstrapsd.*
deploy:raucb:
stage: deploy
when: manual
cache: {}
dependencies:
- build:raucb
only:
- tags
- merge_requests
- web
script:
- BASE=$(git describe --dirty)
- >
lftp -c "
set ssl:verify-certificate ${DEPLOY_FTP_FINGERPRINT};
open -u ${DEPLOY_FTP_USER},${DEPLOY_FTP_PASS} ${DEPLOY_FTP_HOST};
put -O ${DEST} ${BASE}.raucb;
put -O ${DEST} ${BASE}.changelog.md;
put -O ${DEST} ${BASE}.known-issues.txt;
"
- echo "put ${BASE}.raucb" | sftp ${DEV_DEPLOY_USER}@${DEV_DEPLOY_HOST}
- echo "put ${BASE}.changelog.md" | sftp ${DEV_DEPLOY_USER}@${DEV_DEPLOY_HOST}
- echo "put ${BASE}.known-issues.txt" | sftp ${DEV_DEPLOY_USER}@${DEV_DEPLOY_HOST}
deploy:tools:
stage: deploy
when: manual
cache: {}
dependencies:
- build:tools
only:
- tags
- merge_requests
- web
script:
- BASE=$(git describe --dirty)
- echo "put ${BASE}.devsd.xz" | sftp ${DEV_DEPLOY_USER}@${DEV_DEPLOY_HOST}
- echo "put ${BASE}.devsd.bmap" | sftp ${DEV_DEPLOY_USER}@${DEV_DEPLOY_HOST}
- echo "put ${BASE}.bootstrapsd.xz" | sftp ${DEV_DEPLOY_USER}@${DEV_DEPLOY_HOST}
- echo "put ${BASE}.bootstrapsd.bmap" | sftp ${DEV_DEPLOY_USER}@${DEV_DEPLOY_HOST}
sign:raub:
stage: sign
when: manual
dependencies:
- build:raucb
only:
refs:
- tags
- merge_requests
- web
variables:
- $RAUC_CERT_FILE
- $RAUC_KEY_FILE
- $RAUC_KEYRING_FILE
- $RAUC_INTERMEDIATE_FILE
- $RAUC_PKCS11_PIN
- $PKCS11_PROXY_SOCKET
- $RAUC_PKCS11_MODULE
script:
- RAUC_KEYRING_FILE=$(echo ${RAUC_KEYRING_FILE} | sed 's/\\//g')
- p11tool --provider ${RAUC_PKCS11_MODULE} --export ${RAUC_KEYRING_FILE} > sources/meta-prusa/recipes-core/rauc/files/ca.cert.pem
- source oe-init-build-env
- export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE RAUC_CERT_FILE RAUC_KEY_FILE RAUC_INTERMEDIATE_FILE RAUC_PKCS11_PIN PKCS11_PROXY_SOCKET RAUC_PKCS11_MODULE"
- bitbake sla-update-bundle
- cd ..
- BASE=$(git describe --dirty)
- mv build/tmp/deploy/images/prusa64-sl1/sla-update-bundle-prusa64-sl1-*.raucb ${BASE}.raucb
- mv build/tmp/deploy/images/prusa64-sl1/sla-image-prusa64-sl1-*.etc.ext4 ${BASE}.etc.ext4
- mv build/tmp/deploy/images/prusa64-sl1/sla-initramfs-prusa64-sl1-*.manifest ${BASE}.initramfs.manifest
- mv build/tmp/deploy/images/prusa64-sl1/sla-image-prusa64-sl1-*.manifest ${BASE}.manifest
- mv changelog.md ${BASE}.changelog.md
- mv known-issues.txt ${BASE}.known-issues.txt
artifacts:
expire_in: 1 week
name: "$CI_COMMIT_REF_NAME"
paths:
- ./*.raucb
- ./*.etc.ext4
- ./*.manifest
- ./*.changelog.md
- ./*.known-issues.txt