openethereum/scripts/gitlab/package-snap.sh

26 lines
905 B
Bash
Raw Normal View History

2018-06-02 04:13:28 +02:00
#!/bin/bash
set -e # fail on any error
set -u # treat unset variables as error
case ${CI_COMMIT_REF_NAME} in
nightly|*v2.1*) export GRADE="devel";;
2018-08-02 14:35:53 +02:00
beta|*v2.0*) export GRADE="stable";;
stable|*v1.11*) export GRADE="stable";;
2018-06-02 04:13:28 +02:00
*) echo "No release" exit 0;;
esac
SNAP_PACKAGE="parity_"$VERSION"_"$BUILD_ARCH".snap"
echo "__________Create snap package__________"
echo "Release channel :" $GRADE " Branch/tag: " $CI_COMMIT_REF_NAME
snapcraft clean
echo $VERSION:$GRADE:$BUILD_ARCH
2018-08-02 14:35:53 +02:00
cat scripts/gitlab/templates/snapcraft.template.yaml | envsubst '$VERSION:$GRADE:$BUILD_ARCH:$CARGO_TARGET' > snapcraft.yaml
2018-06-02 04:13:28 +02:00
cat snapcraft.yaml
snapcraft --target-arch=$BUILD_ARCH
ls *.snap
echo "__________Post-processing snap package__________"
2018-08-02 14:35:53 +02:00
mkdir -p artifacts
mv -v $SNAP_PACKAGE "artifacts/"$SNAP_PACKAGE
2018-06-02 04:13:28 +02:00
echo "_____ Calculating checksums _____"
2018-08-02 14:35:53 +02:00
cd artifacts
2018-06-02 04:13:28 +02:00
rhash --sha256 $SNAP_PACKAGE -o $SNAP_PACKAGE".sha256"