packer/scripts/sign.sh
hashicorp-copywrite[bot] 19055df3ec
[COMPLIANCE] License changes (#12568)
* Updating the license from MPL to Business Source License

Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at https://hashi.co/license-faq, and details of the license at www.hashicorp.com/bsl.

* Update copyright file headers to BUSL-1.1

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2023-08-10 15:53:29 -07:00

44 lines
1.1 KiB
Bash
Executable file

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
#!/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
ARTIFACTORY_TOKEN="${ARTIFACTORY_TOKEN:-""}"
if [ -z "$ARTIFACTORY_TOKEN" ]; then
echo "Missing required Artifactory credentials"
exit 1
fi
# 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
if [ $? -ne 0 ]; then
exit 1
fi
done
exit 0