Alex Goodman ba4f63099d
Add release process (#89)
* add check for app update; fix ETUI error handling

* validate user args

* add goreleaser support

* replace cgo dependencies (go-rpm) with go equivalents

* add acceptance tests against build snapshot

* add brew tap + acceptance test pipeline

* add mac acceptance tests

* fix compare makefile

* fix mac acceptance tests

* add release pipeline with wait checks

* add token to release step

* rm dir presenters int test

* enforce dpkg to be non interactive

Co-authored-by: Alfredo Deza <adeza@anchore.com>

* pin brew formulae

* pin skopeo to formulae url

* only run acceptance tests

Co-authored-by: Alfredo Deza <adeza@anchore.com>
2020-07-23 10:52:44 -04:00

46 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -eux
DISTDIR=$1
ACC_DIR=$2
TEST_IMAGE=$3
TEST_TYPE=rpm
WORK_DIR=`mktemp -d -t "imgbom-acceptance-test-${TEST_TYPE}-XXXXXX"`
REPORT=${WORK_DIR}/acceptance-${TEST_TYPE}-${TEST_IMAGE}.json
GOLDEN_REPORT=${ACC_DIR}/test-fixtures/acceptance-${TEST_IMAGE}.json
# check if tmp dir was created
if [[ ! "${WORK_DIR}" || ! -d "${WORK_DIR}" ]]; then
echo "Could not create temp dir"
exit 1
fi
function cleanup {
rm -rf "${WORK_DIR}"
}
trap cleanup EXIT
# fetch test image
docker pull ${TEST_IMAGE}
# install and run imgbom
docker run --rm \
-v /var/run/docker.sock://var/run/docker.sock \
-v /${PWD}:/src \
-v ${WORK_DIR}:${WORK_DIR} \
-w /src \
centos:latest \
/bin/bash -x -c "\
rpm -ivh ${DISTDIR}/imgbom_*_linux_amd64.rpm && \
imgbom version -v && \
imgbom ${TEST_IMAGE} -vv -o json > ${REPORT} && \
cat ${REPORT} \
"
# compare the results to a known good output
${ACC_DIR}/compare.py \
${GOLDEN_REPORT} \
${REPORT}