openethereum/scripts/gitlab/publish-snap.sh

47 lines
1.5 KiB
Bash
Raw Normal View History

#!/bin/bash
set -e # fail on any error
set -u # treat unset variables as error
# prepare variables
backports for beta 2.5.2 (#10737) * version: bump beta to 2.5.2 * [CI] allow cargo audit to fail (#10676) * [CI] allow cargo audit to fail * [.gitlab-ci.yml] add a comment about cargo audit * [Cargo.lock] cargo update -p protobuf * Reset blockchain properly (#10669) * delete BlockDetails from COL_EXTRA * better proofs * added tests * PR suggestions * new image (#10673) * Update publishing (#10644) * docker images are now built on k8s: test run * copy check_sync.sh in build-linux job * copy scripts/docker/hub/* in build-linux job * removed cache var * cleanup, no more nightly dockers * cleanup in dockerfile * some new tags * removed sccsche debug log, cleanup * no_gits, new artifacts dir, changed scripts. Test run. * define version once * one source for TRACK * stop kovan onchain updates * moved changes for two images to a new branch * rename Dockerfile * no need in libudev-dev * enable lto for release builds (#10717) * Use RUSTFLAGS to set the optimization level (#10719) * Use RUSTFLAGS to set the optimization level Cargo has a [quirk]() in how configuration settings are propagated when `cargo test` runs: local code respect the settings in `[profile.test]` but all dependencies use the `[profile.dev]` settings. Here we force `opt-level=3` for all dependencies. * Remove unused profile settings * Maybe like this? * Turn off incremental compilation * Remove colors; try again with overflow-checks on * Use quiet CI machine * Turn overflow checking back on * Be explicit about what options we use * Remove "quiet machine" override * ethcore: enable ECIP-1054 for classic (#10731) * config: enable atlantis on ethereum classic * config: enable atlantis on morden classic * config: enable atlantis on morden classic * config: enable atlantis on kotti classic * ethcore: move kotti fork block to 0xAEF49 * ethcore: move morden fork block to 0x4829BA * ethcore: move classic fork block to 0x81B320 * remove trailing comma * remove trailing comma * fix chainspec * ethcore: move classic fork block to 0x7fffffffffffffff
2019-06-11 20:56:03 +02:00
TRACK=$(cat ./tools/TRACK)
echo "Track is: ${TRACK}"
VERSION=$(cat ./tools/VERSION)
SNAP_PACKAGE="parity_"$VERSION"_"$BUILD_ARCH".snap"
# Choose snap release channel based on parity ethereum version track
case ${TRACK} in
nightly) export GRADE="devel" CHANNEL="edge";;
beta) export GRADE="stable" CHANNEL="beta";;
stable) export GRADE="stable" CHANNEL="stable";;
*) echo "No release" && exit 0;;
esac
echo "__________Create snap package__________"
backports for beta 2.5.2 (#10737) * version: bump beta to 2.5.2 * [CI] allow cargo audit to fail (#10676) * [CI] allow cargo audit to fail * [.gitlab-ci.yml] add a comment about cargo audit * [Cargo.lock] cargo update -p protobuf * Reset blockchain properly (#10669) * delete BlockDetails from COL_EXTRA * better proofs * added tests * PR suggestions * new image (#10673) * Update publishing (#10644) * docker images are now built on k8s: test run * copy check_sync.sh in build-linux job * copy scripts/docker/hub/* in build-linux job * removed cache var * cleanup, no more nightly dockers * cleanup in dockerfile * some new tags * removed sccsche debug log, cleanup * no_gits, new artifacts dir, changed scripts. Test run. * define version once * one source for TRACK * stop kovan onchain updates * moved changes for two images to a new branch * rename Dockerfile * no need in libudev-dev * enable lto for release builds (#10717) * Use RUSTFLAGS to set the optimization level (#10719) * Use RUSTFLAGS to set the optimization level Cargo has a [quirk]() in how configuration settings are propagated when `cargo test` runs: local code respect the settings in `[profile.test]` but all dependencies use the `[profile.dev]` settings. Here we force `opt-level=3` for all dependencies. * Remove unused profile settings * Maybe like this? * Turn off incremental compilation * Remove colors; try again with overflow-checks on * Use quiet CI machine * Turn overflow checking back on * Be explicit about what options we use * Remove "quiet machine" override * ethcore: enable ECIP-1054 for classic (#10731) * config: enable atlantis on ethereum classic * config: enable atlantis on morden classic * config: enable atlantis on morden classic * config: enable atlantis on kotti classic * ethcore: move kotti fork block to 0xAEF49 * ethcore: move morden fork block to 0x4829BA * ethcore: move classic fork block to 0x81B320 * remove trailing comma * remove trailing comma * fix chainspec * ethcore: move classic fork block to 0x7fffffffffffffff
2019-06-11 20:56:03 +02:00
echo "Release channel :" $GRADE " Branch/tag: " $CI_COMMIT_REF_NAME "Track: " ${TRACK}
echo $VERSION:$GRADE:$BUILD_ARCH:$CARGO_TARGET
sed -e 's/$VERSION/'"$VERSION"'/g' \
-e 's/$GRADE/'"$GRADE"'/g' \
-e 's/$BUILD_ARCH/'"$BUILD_ARCH"'/g' \
-e 's/$CARGO_TARGET/'"$CARGO_TARGET"'/g' \
scripts/snap/snapcraft.template.yaml > snapcraft.yaml
apt update
apt install -y --no-install-recommends rhash
cat snapcraft.yaml
snapcraft --target-arch=$BUILD_ARCH
ls *.snap
echo "__________Calculating checksums__________"
rhash --sha256 $SNAP_PACKAGE -o $SNAP_PACKAGE".sha256"
cat $SNAP_PACKAGE".sha256"
echo "__________Releasing snap package__________"
echo "Release channel :" $CHANNEL " Branch/tag: " $CI_COMMIT_REF_NAME
echo $SNAPCRAFT_LOGIN_PARITY_BASE64 | base64 --decode > snapcraft.login
snapcraft login --with snapcraft.login
snapcraft push --release $CHANNEL $SNAP_PACKAGE
snapcraft status parity
snapcraft logout