forked from matrix-io/xc3sprog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
86 lines (78 loc) · 3.05 KB
/
.drone.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
pipeline:
build-debs:
when:
branch: master
event: [ push, pull_request, tag ]
image: gcr.io/admobilize-testing/creator-builder-${ARCHITECTURE}-${DISTRIBUTION}-${CODENAME}:${IMAGE_TAG}
privileged: true
commands:
- echo "build-debs for ${ARCHITECTURE}-${DISTRIBUTION}-${CODENAME}:${IMAGE_TAG}"
- ${UPDATE_CMD}
- apt-get install --yes --no-install-recommends wiringpi libftdi-dev
- debuild -us -uc -b
- mv ../*.deb .
upload-debs:
when:
branch: master
event: [ push, pull_request, tag ]
image: gcr.io/admobilize-testing/gce-builder:latest
secrets: [aws_access_key_id, aws_secret_access_key, gpg_key, gpg_pass]
commands:
# Prepare GPG
- echo "$${GPG_KEY}" > /tmp/tmpkey && gpg --import /tmp/tmpkey && rm /tmp/tmpkey
- echo "personal-digest-preferences SHA512" >> /root/.gnupg/gpg.conf
# Only TAG events are published to main
- export COMPONENT=$([ "${DRONE_BUILD_EVENT}" = "tag" ] && echo "main" || echo "unstable")
- export PKG_VER=$(dpkg-parsechangelog --show-field Version -ldebian/changelog)
# Upload packages
- mv matrixio-xc3sprog_$${PKG_VER}_armhf.deb
matrixio-xc3sprog_${DISTRIBUTION}-${CODENAME}-$${PKG_VER}-$${COMPONENT}_armhf.deb
- echo "$${GPG_PASS}" | deb-s3 upload --bucket apt.matrix.one
--prefix $DISTRIBUTION
--component $COMPONENT
--codename $CODENAME
--access-key-id $${AWS_ACCESS_KEY_ID}
--secret-access-key $${AWS_SECRET_ACCESS_KEY}
--sign info@matrix.one
--gpg-options="--batch --passphrase-fd 0"
matrixio-xc3sprog_${DISTRIBUTION}-${CODENAME}-$${PKG_VER}-$${COMPONENT}_armhf.deb
# Render the notification template for the notify-slack step
- j2 --var-delimiter '%%' .drone/slack.tpl > notification.tpl
notify-always:
image: plugins/slack
secrets: [slack_webhook]
username: drone-ci-builder
channel: notifications
template: |
{{#success build.status}}
{{build.author}} just built `{{repo.name}}:{{build.branch}}` from <${DRONE_COMMIT_LINK}|#{{truncate build.commit 8}}>
:new: {{build.message}}
{{else}}
{{build.author}} just broke the build of `{{repo.name}}:{{build.branch}}` with >${DRONE_COMMIT_LINK}|#{{truncate build.commit 8}}
:new: :zombie: {{build.message}}
{{/success}}
:stopwatch: {{ since build.started }}
:gear: {{build.link}}
notify-master:
image: plugins/slack
secrets: [slack_webhook]
username: drone-ci-builder
channel: notifications
when:
status: success
branch: master
event: [ push, tag ]
template: |
:loudspeaker: #{{truncate build.commit 8}} was uploaded to matrixio-xc3sprog
matrix:
include:
- CODENAME: stretch
DISTRIBUTION: raspbian
ARCHITECTURE: armhf
UPDATE_CMD: "apt update"
IMAGE_TAG: 84d9bfb7
- CODENAME: buster
DISTRIBUTION: raspbian
ARCHITECTURE: armhf
UPDATE_CMD: "apt update -y --allow-releaseinfo-change"
IMAGE_TAG: 84d9bfb7