2018-11-11 08:19:04 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
2018-06-18 13:45:53 -07:00
|
|
|
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
2018-11-26 17:54:40 -08:00
|
|
|
# This job doesn't run within a container, try once to upgrade tooling on a
|
|
|
|
# version check failure
|
|
|
|
ci/version-check-with-upgrade.sh stable
|
2018-10-24 19:36:50 -07:00
|
|
|
|
2018-06-18 13:45:53 -07:00
|
|
|
DRYRUN=
|
2018-11-12 21:16:53 -08:00
|
|
|
if [[ -z $BUILDKITE_BRANCH ]]; then
|
2018-06-18 13:45:53 -07:00
|
|
|
DRYRUN="echo"
|
|
|
|
fi
|
|
|
|
|
2018-11-12 21:16:53 -08:00
|
|
|
if ./ci/is-pr.sh; then
|
|
|
|
DRYRUN="echo"
|
|
|
|
CHANNEL="none (pullrequest)"
|
|
|
|
fi
|
|
|
|
|
2018-08-17 21:16:04 -07:00
|
|
|
eval "$(ci/channel-info.sh)"
|
|
|
|
|
2018-10-02 15:30:07 -07:00
|
|
|
if [[ -z $CHANNEL ]]; then
|
2018-08-17 21:16:04 -07:00
|
|
|
echo Unable to determine channel to publish into, exiting.
|
2018-11-30 08:50:17 -08:00
|
|
|
exit 1
|
2018-08-17 21:16:04 -07:00
|
|
|
fi
|
|
|
|
|
2018-06-24 21:24:08 -07:00
|
|
|
if [[ -z $DRYRUN ]]; then
|
|
|
|
[[ -n $SNAPCRAFT_CREDENTIALS_KEY ]] || {
|
|
|
|
echo SNAPCRAFT_CREDENTIALS_KEY not defined
|
|
|
|
exit 1;
|
|
|
|
}
|
2018-06-18 13:45:53 -07:00
|
|
|
(
|
|
|
|
openssl aes-256-cbc -d \
|
|
|
|
-in ci/snapcraft.credentials.enc \
|
|
|
|
-out ci/snapcraft.credentials \
|
|
|
|
-k "$SNAPCRAFT_CREDENTIALS_KEY"
|
|
|
|
|
|
|
|
snapcraft login --with ci/snapcraft.credentials
|
|
|
|
) || {
|
|
|
|
rm -f ci/snapcraft.credentials;
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -x
|
2018-06-24 21:24:08 -07:00
|
|
|
|
2018-07-17 13:31:24 -07:00
|
|
|
echo --- checking for multilog
|
|
|
|
if [[ ! -x /usr/bin/multilog ]]; then
|
2018-09-07 12:24:23 -07:00
|
|
|
if [[ -z $CI ]]; then
|
2018-09-07 11:56:23 -07:00
|
|
|
echo "multilog not found, install with: sudo apt-get install -y daemontools"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
sudo apt-get install -y daemontools
|
2018-07-17 13:31:24 -07:00
|
|
|
fi
|
|
|
|
|
2019-01-12 10:43:43 -08:00
|
|
|
echo "--- build: $CHANNEL channel"
|
2018-06-18 13:45:53 -07:00
|
|
|
snapcraft
|
2018-06-24 21:24:08 -07:00
|
|
|
|
2018-12-13 21:44:50 -08:00
|
|
|
source ci/upload-ci-artifact.sh
|
|
|
|
upload-ci-artifact solana_*.snap
|
2018-06-24 10:10:55 -07:00
|
|
|
|
2018-10-05 16:32:05 -07:00
|
|
|
if [[ -z $DO_NOT_PUBLISH_SNAP ]]; then
|
2019-01-12 10:43:43 -08:00
|
|
|
echo "--- publish: $CHANNEL channel"
|
|
|
|
$DRYRUN snapcraft push solana_*.snap --release "$CHANNEL"
|
2018-10-05 16:32:05 -07:00
|
|
|
fi
|