fix docker build in stable & add Aura test

This commit is contained in:
Denis S. Soldatov aka General-Beck 2017-07-21 16:48:59 +03:00
parent bf3bd1257f
commit d7eb3cb51e
3 changed files with 34 additions and 3 deletions

View File

@ -526,12 +526,15 @@ windows:
docker-build:
stage: build
only:
- beta
- stable
- tags
- triggers
before_script:
- docker info
script:
- if [ "$CI_BUILD_REF_NAME" == "beta-release" ]; then DOCKER_TAG="latest"; else DOCKER_TAG=$CI_BUILD_REF_NAME; fi
- echo "Tag:" $DOCKER_TAG
- docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity
- sh scripts/docker-build.sh $DOCKER_TAG
- docker logout
@ -571,6 +574,7 @@ test-rust-stable:
script:
- export RUST_BACKTRACE=1
- if [ $RUST_FILES_MODIFIED -eq 0 ]; then echo "Skipping Rust tests since no Rust files modified."; else ./test.sh $CARGOFLAGS; fi
- if [ $CI_BUILD_REF_NAME =~ ^(beta|stable|nightly)$ ]; then sh scripts/aura-test.sh; fi
tags:
- rust
- rust-stable

25
scripts/aura-test.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
rm -rf parity-import-tests/
cargo build -j $(nproc) --release --features final
git clone https://github.com/paritytech/parity-import-tests
cp target/release/parity parity-import-tests/aura/parity
cd parity-import-tests/aura
./parity -v
echo "Start Aura test"
./parity import blocks.rlp --chain chain.json
if [ $? -eq 0 ]
then
echo "Import test passed"
else
echo "Import test failed" >&2
exit 1
fi
./parity restore snap --chain chain.json --log-file restore.log
if [ $? -eq 0 ]
then
echo "Restore test passed"
else
echo "Restore test failed" >&2
exit 1
fi
echo "Aura test complete"

View File

@ -1,6 +1,8 @@
#!/bin/bash
cd docker/hub
if [ "$1" == "latest" ]; then DOCKER_BUILD_TAG="beta-release"; fi
docker build --build-arg BUILD_TAG=$DOCKER_BUILD_TAG --no-cache=true --tag ethcore/parity:$1 .
docker push ethcore/parity:$1
DOCKER_BUILD_TAG=$1
echo "Docker build tag: " $DOCKER_BUILD_TAG
docker build --build-arg BUILD_TAG=$DOCKER_BUILD_TAG --no-cache=true --tag parity/parity:$DOCKER_BUILD_TAG .
docker run -it parity/parity:$DOCKER_BUILD_TAG -v
docker push parity/parity:$DOCKER_BUILD_TAG