2018-11-11 08:19:04 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -ex
|
2018-10-02 16:20:37 -07:00
|
|
|
|
2019-03-14 19:41:05 -07:00
|
|
|
cd "$(dirname "$0")"/../..
|
|
|
|
eval "$(ci/channel-info.sh)"
|
|
|
|
source ci/rust-version.sh
|
2018-10-02 16:20:37 -07:00
|
|
|
|
2019-12-12 16:15:31 -08:00
|
|
|
CHANNEL_OR_TAG=
|
|
|
|
if [[ -n "$CI_TAG" ]]; then
|
|
|
|
CHANNEL_OR_TAG=$CI_TAG
|
|
|
|
else
|
|
|
|
CHANNEL_OR_TAG=$CHANNEL
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -z $CHANNEL_OR_TAG ]]; then
|
|
|
|
echo Unable to determine channel or tag to publish into, exiting.
|
2019-01-07 19:53:39 -08:00
|
|
|
echo "^^^ +++"
|
|
|
|
exit 0
|
2018-10-02 16:20:37 -07:00
|
|
|
fi
|
|
|
|
|
2019-03-14 19:41:05 -07:00
|
|
|
cd "$(dirname "$0")"
|
2018-10-02 17:34:47 -07:00
|
|
|
rm -rf usr/
|
2019-03-14 19:41:05 -07:00
|
|
|
../../ci/docker-run.sh "$rust_stable_docker_image" \
|
2019-11-01 07:53:30 -07:00
|
|
|
scripts/cargo-install-all.sh --use-move sdk/docker-solana/usr
|
2018-12-19 10:30:24 -08:00
|
|
|
|
2019-02-16 09:58:28 -08:00
|
|
|
cp -f ../../run.sh usr/bin/solana-run.sh
|
2018-10-02 16:20:37 -07:00
|
|
|
|
2019-12-12 16:15:31 -08:00
|
|
|
docker build -t solanalabs/solana:"$CHANNEL_OR_TAG" .
|
2018-10-02 16:20:37 -07:00
|
|
|
|
|
|
|
maybeEcho=
|
|
|
|
if [[ -z $CI ]]; then
|
|
|
|
echo "Not CI, skipping |docker push|"
|
|
|
|
maybeEcho="echo"
|
|
|
|
else
|
|
|
|
(
|
|
|
|
set +x
|
|
|
|
if [[ -n $DOCKER_PASSWORD && -n $DOCKER_USERNAME ]]; then
|
|
|
|
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
|
|
|
|
fi
|
|
|
|
)
|
|
|
|
fi
|
2019-12-12 16:15:31 -08:00
|
|
|
$maybeEcho docker push solanalabs/solana:"$CHANNEL_OR_TAG"
|