Skip to content

Commit

Permalink
Merge pull request #910 from pi-hole/fix/verify_download
Browse files Browse the repository at this point in the history
Verify CI-generated binaries after uploading
  • Loading branch information
DL6ER authored Oct 25, 2020
2 parents 88521d5 + 450537f commit 86d5b8a
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,34 @@ version: 2
name: "Binary checks"
command: bash test/arch_test.sh
- run:
name: "Upload"
name: "Compute checksum"
command: |
[ -z "${CIRCLE_PR_USERNAME}" ] || exit 0
DIR="${CIRCLE_TAG:-${CIRCLE_BRANCH}}"
mv pihole-FTL "${BIN_NAME}"
sha1sum pihole-FTL-* > ${BIN_NAME}.sha1
- run:
name: "Upload binary to binary bucket"
command: |
[ -z "${CIRCLE_PR_USERNAME}" ] || exit 0
DIR="${CIRCLE_TAG:-${CIRCLE_BRANCH}}"
mkdir -p ~/.ssh/
ssh-keyscan -H $SSH_HOST >> ~/.ssh/known_hosts
sftp -b - $SSH_USER@$SSH_HOST <<< "-mkdir ${DIR}
put ${BIN_NAME}* ${DIR}"
mv "${BIN_NAME}" pihole-FTL
sftp -b - $SSH_USER@$SSH_HOST <<< "-mkdir html/${DIR}
put ${BIN_NAME}* html/${DIR}"
- run:
name: "Verify uploaded binary"
command: |
[ -z "${CIRCLE_PR_USERNAME}" ] || exit 0
DIR="${CIRCLE_TAG:-${CIRCLE_BRANCH}}"
mkdir download
cd download
wget "https://ftl.pi-hole.net/${DIR}/${BIN_NAME}"
wget "https://ftl.pi-hole.net/${DIR}/${BIN_NAME}.sha1"
sha1sum -c "${BIN_NAME}.sha1"
cd ..
- run:
name: "Test"
command: |
mv "${BIN_NAME}" pihole-FTL
test/run.sh
.docker_template: &docker_template
Expand Down

0 comments on commit 86d5b8a

Please sign in to comment.