From d7eb3cb51ef6fed23e135b3aecc5fe1c8de66a8e Mon Sep 17 00:00:00 2001 From: "Denis S. Soldatov aka General-Beck" Date: Fri, 21 Jul 2017 16:48:59 +0300 Subject: [PATCH] fix docker build in stable & add Aura test --- .gitlab-ci.yml | 4 ++++ scripts/aura-test.sh | 25 +++++++++++++++++++++++++ scripts/docker-build.sh | 8 +++++--- 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100755 scripts/aura-test.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0b13bb66f..d93e2a785 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/scripts/aura-test.sh b/scripts/aura-test.sh new file mode 100755 index 000000000..43fa65736 --- /dev/null +++ b/scripts/aura-test.sh @@ -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" diff --git a/scripts/docker-build.sh b/scripts/docker-build.sh index 294e172eb..1f3987401 100644 --- a/scripts/docker-build.sh +++ b/scripts/docker-build.sh @@ -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