File tree Expand file tree Collapse file tree 2 files changed +42
-28
lines changed Expand file tree Collapse file tree 2 files changed +42
-28
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,13 @@ workflows:
164
164
- build-package-linux-amd64
165
165
- changelog :
166
166
<< : *any_filter
167
+ - sign-packages :
168
+ << : *release_filter
169
+ requires :
170
+ - build-package-linux-amd64
171
+ - build-package-linux-arm64
172
+ - build-package-darwin-amd64
173
+ - build-package-windows-amd64
167
174
- s3-publish-packages :
168
175
<< : *release_filter
169
176
requires :
@@ -172,6 +179,7 @@ workflows:
172
179
- build-package-linux-amd64
173
180
- build-package-linux-arm64
174
181
- build-package-windows-amd64
182
+ - sign-packages
175
183
- s3-publish-changelog :
176
184
<< : *release_filter
177
185
publish-type : release
@@ -517,8 +525,42 @@ jobs:
517
525
- artifacts
518
526
- store_artifacts :
519
527
path : /artifacts
528
+
520
529
destination : artifacts
521
530
531
+ sign-packages :
532
+ circleci_ip_ranges : true
533
+ docker :
534
+ - image : quay.io/influxdb/rsign:latest
535
+ auth :
536
+ username : $QUAY_RSIGN_USERNAME
537
+ password : $QUAY_RSIGN_PASSWORD
538
+ steps :
539
+ - add_ssh_keys :
540
+ fingerprints :
541
+ - fc:7b:6e:a6:38:7c:63:5a:13:be:cb:bb:fa:33:b3:3c
542
+ - attach_workspace :
543
+ at : /tmp/workspace
544
+ - run : |
545
+ for target in /tmp/workspace/artifacts/*
546
+ do
547
+ case "${target}"
548
+ in
549
+ # rsign is shipped on Alpine Linux which uses "busybox ash" instead
550
+ # of bash. ash is somewhat more posix compliant and is missing some
551
+ # extensions and niceties from bash.
552
+ *.deb|*.rpm|*.tar.gz|*.zip)
553
+ rsign "${target}"
554
+ ;;
555
+ esac
556
+ done
557
+ - persist_to_workspace :
558
+ root : /tmp/workspace
559
+ paths :
560
+ - artifacts
561
+ - store_artifacts :
562
+ path : /tmp/workspace/artifacts
563
+
522
564
s3-publish-packages :
523
565
docker :
524
566
- image : ubuntu:latest
Original file line number Diff line number Diff line change @@ -135,33 +135,5 @@ build_package_linux()
135
135
run_fpm rpm
136
136
}
137
137
138
- sign_artifacts ()
139
- {
140
- # If this is not a release version, don't sign the artifacts. This
141
- # prevents unathorized PRs and branches from being signed with our
142
- # signing key.
143
- if [[ ! ${RELEASE:- } ]]
144
- then
145
- return 0
146
- fi
147
-
148
- # CircleCI mangles environment variables with newlines. This key contians
149
- # escaped newlines. For `gpg` to import the key, it requires `echo -e` to
150
- # expand the escape sequences.
151
- gpg --batch --import <<< " $(echo -e " ${GPG_PRIVATE_KEY} " )"
152
-
153
- # TODO(bnpfeife): replace with code signing server
154
- for target in /artifacts/*
155
- do
156
- gpg \
157
- --batch \
158
- --pinentry-mode=loopback \
159
- --passphrase " ${PASSPHRASE} " \
160
- --detach-sign \
161
- --armor " ${target} "
162
- done
163
- }
164
-
165
138
build_archive
166
139
build_package_linux
167
- sign_artifacts
You can’t perform that action at this time.
0 commit comments