Skip to content

Commit

Permalink
modified travis.yml that it makes use of generic
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Rebischke <[email protected]>
  • Loading branch information
Christian Rebischke committed Sep 30, 2019
1 parent 8f2c838 commit 3cdd3b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 27 deletions.
29 changes: 3 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,11 @@ language: generic
dist: trusty
sudo: false

env:
matrix:
- DIST=trusty
global:
# 20170821: as of writing there is no 'latest' (hashicorp/packer/issues/5265)
- PACKER_CURRENT_VERSION="$(curl -s https://checkpoint-api.hashicorp.com/v1/check/packer | jq -r -M '.current_version')"
- PACKER_URL="https://releases.hashicorp.com/packer/$PACKER_CURRENT_VERSION/packer_${PACKER_CURRENT_VERSION}_linux_amd64.zip"
- PACKER_SHA256="https://releases.hashicorp.com/packer/$PACKER_CURRENT_VERSION/packer_${PACKER_CURRENT_VERSION}_SHA256SUMS"
- PACKER_SHA256_SIG="https://releases.hashicorp.com/packer/$PACKER_CURRENT_VERSION/packer_${PACKER_CURRENT_VERSION}_SHA256SUMS.sig"
- HASHICORP_FINGERPRINT=91a6e7f85d05c65630bef18951852d87348ffc4c
- HASHICORP_KEY="https://keybase.io/hashicorp/pgp_keys.asc?fingerprint=${HASHICORP_FINGERPRINT}"

install:
- wget ${PACKER_URL}
- wget ${PACKER_SHA256}
- wget ${PACKER_SHA256_SIG}
- wget -O hashicorp.key ${HASHICORP_KEY}
- gpg --with-fingerprint --with-colons hashicorp.key | grep ${HASHICORP_FINGERPRINT^^}
- gpg --import hashicorp.key
- gpg --verify packer_${PACKER_CURRENT_VERSION}_SHA256SUMS.sig packer_${PACKER_CURRENT_VERSION}_SHA256SUMS
- grep linux_amd64 packer_${PACKER_CURRENT_VERSION}_SHA256SUMS > packer_SHA256SUM_linux_amd64
- sha256sum --check --status packer_SHA256SUM_linux_amd64
- unzip packer_${PACKER_CURRENT_VERSION}_linux_amd64.zip
- ./generic-ci.sh install

script:
- ./packer --version
- # ./packer validate -var "iso_url=https://downloads.archlinux.de/iso/$(date +'%Y.%m').01/archlinux-$(date +'%Y.%m').01-x86_64.iso" -var "iso_checksum_url=https://downloads.archlinux.de/iso/$(date +'%Y.%m').01/sha1sums.txt" vagrant.json
- jq ".\"post-processors\"[0] |= map(select(.\"type\" != \"vagrant-cloud\"))" vagrant.json | ./packer validate -var "iso_url=https://downloads.archlinux.de/iso/$(date +'%Y.%m').01/archlinux-$(date +'%Y.%m').01-x86_64.iso" -var "iso_checksum_url=https://downloads.archlinux.de/iso/$(date +'%Y.%m').01/sha1sums.txt" -
- ./generic-ci.sh verify

notifications:
- email: false
- email: false
3 changes: 2 additions & 1 deletion generic-ci.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -x

case $1 in

Expand All @@ -16,7 +17,7 @@ case $1 in
gpg --with-fingerprint --with-colons hashicorp.key | grep ${HASHICORP_FINGERPRINT^^}
gpg --import hashicorp.key
gpg --verify "packer_${PACKER_CURRENT_VERSION}_SHA256SUMS.sig" "packer_${PACKER_CURRENT_VERSION}_SHA256SUMS"
grep "linux_amd64 packer_${PACKER_CURRENT_VERSION}_SHA256SUMS" >packer_SHA256SUM_linux_amd64
grep linux_amd64 "packer_${PACKER_CURRENT_VERSION}_SHA256SUMS" > packer_SHA256SUM_linux_amd64
sha256sum --check --status packer_SHA256SUM_linux_amd64
unzip "packer_${PACKER_CURRENT_VERSION}_linux_amd64.zip"
;;
Expand Down

0 comments on commit 3cdd3b4

Please sign in to comment.