2019-12-18 18:44:49 -05:00
|
|
|
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# This script uploads the Darwin builds to artifactory, then triggers the
|
|
|
|
# circle ci job that signs them.
|
|
|
|
|
|
|
|
# ARTIFACTORY_USER="sa-circle-codesign"
|
|
|
|
# export PRODUCT_NAME="packer"
|
|
|
|
# export ARTIFACTORY_TOKEN=$ARTIFACTORY_TOKEN
|
|
|
|
|
2020-02-14 17:38:56 -05:00
|
|
|
ARTIFACTORY_TOKEN="${ARTIFACTORY_TOKEN:-""}"
|
|
|
|
|
|
|
|
if [ -z "$ARTIFACTORY_TOKEN" ]; then
|
|
|
|
echo "Missing required Artifactory credentials"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-12-18 18:44:49 -05:00
|
|
|
# Get the parent directory of where this script is.
|
|
|
|
SOURCE="${BASH_SOURCE[0]}"
|
|
|
|
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
|
|
|
|
DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
|
|
|
|
# Change into that dir because we expect that
|
|
|
|
cd $DIR
|
|
|
|
|
|
|
|
BIN_UUIDS=()
|
|
|
|
BUILD_NUMBERS=()
|
|
|
|
for DARWIN_BIN in $(find ./pkg/dist/*darwin_*.zip); do
|
|
|
|
echo "signing $DARWIN_BIN"
|
|
|
|
export ARTIFACTORY_USER="sa-circle-codesign"
|
|
|
|
export PRODUCT_NAME="packer"
|
|
|
|
export ARTIFACTORY_TOKEN=$ARTIFACTORY_TOKEN
|
|
|
|
export TARGET_ZIP=$DARWIN_BIN
|
|
|
|
|
|
|
|
echo $TARGET_ZIP
|
|
|
|
./scripts/codesign_example.sh
|
2020-02-14 18:27:21 -05:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-12-18 18:44:49 -05:00
|
|
|
done
|
|
|
|
|
2020-02-14 17:38:56 -05:00
|
|
|
exit 0
|