From ef997cba5a51cf495330c3aec1620f2cf9b42231 Mon Sep 17 00:00:00 2001 From: "Denis S. Soldatov aka General-Beck" Date: Thu, 2 Aug 2018 15:35:53 +0300 Subject: [PATCH] small fixes --- .gitlab-ci.yml | 180 ++++------ docker/hub/Dockerfile | 79 ++--- scripts/cov.sh | 31 -- scripts/docker-build.sh | 11 - scripts/gitlab-test.sh | 47 --- scripts/gitlab/build-unix.sh | 5 +- scripts/gitlab/build-windows.sh | 14 +- scripts/gitlab/build.sh | 317 ------------------ scripts/gitlab/coverage.sh | 5 +- scripts/gitlab/msbuild.cmd | 1 - scripts/gitlab/package-macos.sh | 19 -- scripts/gitlab/package-snap.sh | 14 +- scripts/gitlab/package-unix.sh | 35 -- scripts/gitlab/package-windows.sh | 27 -- scripts/gitlab/publish-snap.sh | 8 +- scripts/gitlab/push-binaries.sh | 25 -- scripts/gitlab/push-github.sh | 38 --- scripts/gitlab/push-release.sh | 12 - scripts/gitlab/push.sh | 67 ++++ scripts/gitlab/rpc-docs.sh | 54 +++ scripts/{ => gitlab}/safe_curl.sh | 0 scripts/gitlab/templates/release-table.md | 14 +- .../gitlab/templates/snapcraft.template.yaml | 8 +- scripts/gitlab/test-qemu.sh | 10 - scripts/gitlab/uninstall-parity.sh | 4 - snap/snapcraft.yaml | 41 --- 26 files changed, 242 insertions(+), 824 deletions(-) delete mode 100755 scripts/cov.sh delete mode 100755 scripts/docker-build.sh delete mode 100755 scripts/gitlab-test.sh delete mode 100755 scripts/gitlab/build.sh delete mode 100755 scripts/gitlab/msbuild.cmd delete mode 100755 scripts/gitlab/package-macos.sh delete mode 100755 scripts/gitlab/package-unix.sh delete mode 100755 scripts/gitlab/package-windows.sh delete mode 100755 scripts/gitlab/push-binaries.sh delete mode 100755 scripts/gitlab/push-github.sh delete mode 100755 scripts/gitlab/push-release.sh create mode 100755 scripts/gitlab/push.sh create mode 100755 scripts/gitlab/rpc-docs.sh rename scripts/{ => gitlab}/safe_curl.sh (100%) delete mode 100755 scripts/gitlab/test-qemu.sh delete mode 100755 scripts/gitlab/uninstall-parity.sh delete mode 100644 snap/snapcraft.yaml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f3708fb9b..bf0974bd2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,7 @@ stages: - build - package - publish - - push-release + - docs image: parity/rust:gitlab-ci @@ -14,7 +14,6 @@ variables: BUILD_TARGET: ubuntu BUILD_ARCH: amd64 CARGO_TARGET: x86_64-unknown-linux-gnu - LIBSSL: "libssl1.0.0 (>=1.0.0)" cache: key: "${CI_JOB_NAME}" @@ -28,14 +27,13 @@ cache: - stable - beta - tags - - nightly - - triggers + - gitlab-next .publishable_branches: # list of git refs for publishing builds to the "production" locations only: &publishable_branches - nightly # Our nightly builds from schedule, on `master` - "v*" # Our version tags - - triggers + - gitlab-next .collect_artifacts: &collect_artifacts artifacts: @@ -45,14 +43,6 @@ cache: paths: - artifacts/ -.collect_packages: &collect_packages - artifacts: - name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}" - when: on_success - expire_in: 1 mos - paths: - - packages/ - .determine_version: &determine_version | export VERSION=$(grep -m 1 "version =" Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n") echo "Version" $VERSION @@ -71,21 +61,17 @@ test:rust:stable: &test <<: *test allow_failure: true only: - - triggers - master - - nightly test:rust:beta: <<: *optional_test script: - scripts/gitlab/test.sh beta - allow_failure: true test:rust:nightly: <<: *optional_test script: - scripts/gitlab/test.sh nightly - allow_failure: true #test:rustfmt: # <<: *optional_test @@ -101,7 +87,6 @@ test:coverage: stage: test only: - master - - gitlab-next script: - scripts/gitlab/coverage.sh tags: @@ -121,18 +106,13 @@ build:linux:ubuntu:amd64: &build <<: *collect_artifacts tags: - rust-stable + allow_failure: true -build:linux:debian:amd64: +build:linux:ubuntu:i386: <<: *build - image: parity/rust-debian:gitlab-ci + image: parity/rust-i686:gitlab-ci variables: - LIBSSL: "libssl1.1 (>=1.1.0)" - CARGO_TARGET: x86_64-unknown-linux-gnu - -build:linux:centos:x86_64: - <<: *build - image: parity/rust-centos:gitlab-ci - retry: 2 #if version `GLIBC_2.18' not found + CARGO_TARGET: i686-unknown-linux-gnu build:linux:ubuntu:arm64: <<: *build @@ -156,6 +136,8 @@ build:macos:x86_64: <<: *build variables: CARGO_TARGET: x86_64-apple-darwin + CC: gcc + CXX: g++ tags: - osx <<: *collect_artifacts @@ -168,6 +150,7 @@ build-windows-x86_64: paths: - "%CI_PROJECT_DIR%/target/" - "%CI_PROJECT_DIR%/cargo/" + # No cargo caching, since fetch-locking on Windows gets stuck variables: CARGO_TARGET: x86_64-pc-windows-msvc script: @@ -179,88 +162,35 @@ build-windows-x86_64: #### stage: package -package:ubuntu:deb:amd64: &package_unix - stage: package - only: *releaseable_branches - before_script: - - *determine_version - variables: - BUILD_ARCH: amd64 - IDENT: ubuntu - PKG: deb - LIBSSL: "libssl1.1 (>=1.1.0)" - dependencies: - - build:linux:ubuntu:amd64 - script: - - scripts/gitlab/package-unix.sh - tags: - - rust-stable - <<: *collect_packages - -package:ubuntu:deb:arm64: - <<: *package_unix - variables: - BUILD_ARCH: arm64 - IDENT: ubuntu - PKG: deb - dependencies: - - build:linux:ubuntu:arm64 - -package:ubuntu:deb:armhf: - <<: *package_unix - variables: - BUILD_ARCH: armhf - IDENT: ubuntu - PKG: deb - dependencies: - - build:linux:ubuntu:armhf - -package:debian:deb:amd64: - <<: *package_unix - variables: - BUILD_ARCH: amd64 - IDENT: debian - PKG: deb - dependencies: - - build:linux:debian:amd64 - -package:centos:rpm:x86_64: - <<: *package_unix - variables: - BUILD_ARCH: x86_64 - IDENT: centos - PKG: rpm - LIBSSL: "libssl >= 1.0.0" - dependencies: - - build:linux:centos:x86_64 - - -package:macos:pkg:x86_64: - <<: *package_unix - dependencies: - - build:macos:x86_64 - script: - - scripts/gitlab/package-macos.sh - tags: - - osx - package:linux:snap:amd64: &package_snap stage: package only: *releaseable_branches + cache: {} before_script: - *determine_version + variables: + CARGO_TARGET: x86_64-unknown-linux-gnu dependencies: - build:linux:ubuntu:amd64 script: - scripts/gitlab/package-snap.sh tags: - rust-stable - <<: *collect_packages + <<: *collect_artifacts + +package:linux:snap:i386: + <<: *package_snap + variables: + BUILD_ARCH: i386 + CARGO_TARGET: i686-unknown-linux-gnu + dependencies: + - build:linux:ubuntu:i386 package:linux:snap:arm64: <<: *package_snap variables: BUILD_ARCH: arm64 + CARGO_TARGET: aarch64-unknown-linux-gnu dependencies: - build:linux:ubuntu:arm64 @@ -268,19 +198,10 @@ package:linux:snap:armhf: <<: *package_snap variables: BUILD_ARCH: armhf + CARGO_TARGET: armv7-unknown-linux-gnueabihf dependencies: - build:linux:ubuntu:armhf -package-windows-exe-x86_64: - stage: package - only: *releaseable_branches - dependencies: - - build-windows-x86_64 - script: - - sh scripts/gitlab/package-windows.sh - <<: *collect_packages - tags: - - rust-windows #### stage: publish @@ -288,6 +209,7 @@ publish:linux:snap:amd64: &publish_snap stage: publish only: *publishable_branches image: snapcore/snapcraft:stable + cache: {} before_script: - *determine_version variables: @@ -299,11 +221,21 @@ publish:linux:snap:amd64: &publish_snap tags: - rust-stable +publish:linux:snap:i386: + <<: *publish_snap + before_script: + - *determine_version + #- sleep 60 + variables: + BUILD_ARCH: i386 + dependencies: + - package:linux:snap:i386 + publish:linux:snap:arm64: <<: *publish_snap before_script: - *determine_version - - sleep 120 + #- sleep 360 variables: BUILD_ARCH: arm64 dependencies: @@ -313,7 +245,7 @@ publish:linux:snap:armhf: <<: *publish_snap before_script: - *determine_version - - sleep 360 + #- sleep 520 variables: BUILD_ARCH: armhf dependencies: @@ -322,10 +254,12 @@ publish:linux:snap:armhf: publish:docker:parity:amd64: &publish_docker stage: publish only: *publishable_branches + cache: {} dependencies: - build:linux:ubuntu:amd64 tags: - shell + allow_failure: true script: - scripts/gitlab/publish-docker.sh parity @@ -334,31 +268,35 @@ publish:docker:parity-evm:amd64: script: - scripts/gitlab/publish-docker.sh parity-evm -publish:github: +publish:github:s3: stage: publish only: *publishable_branches + cache: {} dependencies: - - package:ubuntu:deb:amd64 - - package:ubuntu:deb:armhf - - package:ubuntu:deb:arm64 - - package:debian:deb:amd64 - - package:centos:rpm:x86_64 - - package:macos:pkg:x86_64 - - package-windows-exe-x86_64 + - build:linux:ubuntu:amd64 + - build:linux:ubuntu:i386 + - build:linux:ubuntu:armhf + - build:linux:ubuntu:arm64 + - build:macos:x86_64 + - build-windows-x86_64 before_script: - *determine_version script: - - scripts/gitlab/push-github.sh + - scripts/gitlab/push.sh + tags: + - shell + allow_failure: true -#### stage: push-release -push:release: - stage: push-release +####stage: docs + +json:rpc:docs: + stage: docs only: - tags - - triggers - image: parity/rust:gitlab-ci + - gitlab-next + cache: {} script: - - scripts/gitlab/push-release.sh + - scripts/gitlab/rpc-docs.sh tags: - - curl + - shell diff --git a/docker/hub/Dockerfile b/docker/hub/Dockerfile index eb007dc10..4eec8cfc6 100644 --- a/docker/hub/Dockerfile +++ b/docker/hub/Dockerfile @@ -1,64 +1,27 @@ FROM ubuntu:xenial MAINTAINER Parity Technologies -WORKDIR /build -#ENV for build TAG -ARG BUILD_TAG -ENV BUILD_TAG ${BUILD_TAG:-master} -RUN echo "Build tag:" $BUILD_TAG +#set ENVIROMENT +ARG TARGET +ENV TARGET ${TARGET} + # install tools and dependencies -RUN apt-get update && \ - apt-get install -y --force-yes --no-install-recommends \ - # make - build-essential \ - # add-apt-repository - software-properties-common \ - make \ - cmake \ - curl \ - wget \ - git \ - g++ \ - gcc \ - libc6 \ - libc6-dev \ - binutils \ - file \ - libudev-dev \ - pkg-config \ - dpkg-dev &&\ -# install rustup - curl https://sh.rustup.rs -sSf | sh -s -- -y && \ -# rustup directory - PATH=/root/.cargo/bin:$PATH && \ +RUN apt update && apt install -y --no-install-recommends openssl libudev-dev file + # show backtraces - RUST_BACKTRACE=1 && \ -# build parity -cd /build&&git clone https://github.com/paritytech/parity-ethereum && \ - cd parity-ethereum&& \ - git pull&& \ - git checkout $BUILD_TAG && \ - cargo build --verbose --release --features final && \ - strip /build/parity-ethereum/target/release/parity && \ - file /build/parity-ethereum/target/release/parity&&mkdir -p /parity&& cp /build/parity-ethereum/target/release/parity /parity&&\ +ENV RUST_BACKTRACE 1 + #cleanup Docker image - rm -rf /root/.cargo&&rm -rf /root/.multirust&&rm -rf /root/.rustup&&rm -rf /build&&\ - apt-get purge -y \ - # make - build-essential \ - # add-apt-repository - software-properties-common \ - make \ - cmake \ - curl \ - wget \ - git \ - g++ \ - gcc \ - binutils \ - file \ - pkg-config \ - dpkg-dev &&\ - rm -rf /var/lib/apt/lists/* +RUN apt autoremove -y +RUN apt clean -y +RUN rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* + +#add TARGET to docker image +COPY artifacts/x86_64-unknown-linux-gnu/$TARGET /usr/bin/$TARGET + +# Build a shell script because the ENTRYPOINT command doesn't like using ENV +RUN echo "#!/bin/bash \n ${TARGET} \$@" > ./entrypoint.sh +RUN chmod +x ./entrypoint.sh + # setup ENTRYPOINT -EXPOSE 8080 8545 8180 -ENTRYPOINT ["/parity/parity"] +EXPOSE 5001 8080 8082 8083 8545 8546 8180 30303/tcp 30303/udp +ENTRYPOINT ["./entrypoint.sh"] diff --git a/scripts/cov.sh b/scripts/cov.sh deleted file mode 100755 index b6d25c692..000000000 --- a/scripts/cov.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Installing KCOV under ubuntu -# https://users.rust-lang.org/t/tutorial-how-to-collect-test-coverages-for-rust-project/650# -### Install deps -# $ sudo apt-get install libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev -# -### Compile kcov -# $ wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && tar xf master.tar.gz -# $ cd kcov-master && mkdir build && cd build -# $ cmake .. && make && sudo make install - -### Running coverage - -set -x -RUSTFLAGS="-C link-dead-code" cargo test --all --no-run || exit $? -KCOV_TARGET="target/cov" -KCOV_FLAGS="--verify" -mkdir -p $KCOV_TARGET -echo "Cover RUST" -for FILE in `find target/debug/deps ! -name "*.*"` -do - timeout --signal=SIGKILL 5m kcov --include-path=$(pwd) --exclude-path=$(pwd)/target $KCOV_FLAGS $KCOV_TARGET $FILE -done -timeout --signal=SIGKILL 5m kcov --include-path=$(pwd) --exclude-path=$(pwd)/target $KCOV_FLAGS $KCOV_TARGET target/debug/parity-* -echo "Cover JS" -cd js -npm install&&npm run test:coverage -cd .. -bash <(curl -s https://codecov.io/bash)&& - echo "Uploaded code coverage" -exit 0 diff --git a/scripts/docker-build.sh b/scripts/docker-build.sh deleted file mode 100755 index b880d33b7..000000000 --- a/scripts/docker-build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -cd docker/hub -DOCKER_BUILD_TAG=$1 -echo "Docker build tag: " $DOCKER_BUILD_TAG -if [[ "$DOCKER_BUILD_TAG" = "latest" ]]; then - docker build --build-arg BUILD_TAG="master" --no-cache=true --tag parity/parity:$DOCKER_BUILD_TAG . -else - docker build --build-arg BUILD_TAG=$DOCKER_BUILD_TAG --no-cache=true --tag parity/parity:$DOCKER_BUILD_TAG . -fi -docker run -it parity/parity:$DOCKER_BUILD_TAG -v -docker push parity/parity:$DOCKER_BUILD_TAG diff --git a/scripts/gitlab-test.sh b/scripts/gitlab-test.sh deleted file mode 100755 index fbd93167a..000000000 --- a/scripts/gitlab-test.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash -#ARGUMENT test for RUST and COVERAGE -set -e # fail on any error -set -u # treat unset variables as error -if [[ "$CI_COMMIT_REF_NAME" = "master" || "$CI_COMMIT_REF_NAME" = "beta" || "$CI_COMMIT_REF_NAME" = "stable" ]]; then - export GIT_COMPARE=$CI_COMMIT_REF_NAME~; -else - export GIT_COMPARE=master; -fi -git fetch -a -export RUST_FILES_MODIFIED="$(git --no-pager diff --name-only $GIT_COMPARE...$CI_COMMIT_SHA | grep -v -e ^\\. -e ^LICENSE -e ^README.md -e ^test.sh -e ^windows/ -e ^scripts/ -e ^mac/ -e ^nsis/ -e ^docs/ | wc -l)" -echo "RUST_FILES_MODIFIED: $RUST_FILES_MODIFIED" -TEST_SWITCH=$1 -rust_test () { - git submodule update --init --recursive - rustup show - if [[ "${RUST_FILES_MODIFIED}" == "0" ]]; - then echo "Skipping Rust tests since no Rust files modified."; - else ./test.sh || exit $?; - fi - # if [[ "$CI_COMMIT_REF_NAME" == "nightly" ]]; - # ### @TODO re-enable fail after https://github.com/paritytech/parity-import-tests/issues/3 - # then sh scripts/aura-test.sh; # || exit $?; - # fi -} -coverage_test () { - git submodule update --init --recursive - rm -rf target/* - scripts/cov.sh -} -case $TEST_SWITCH in - stable ) - rustup default stable - rust_test - ;; - beta) - rustup default beta - rust_test - ;; - nightly) - rustup default nightly - rust_test - ;; - test-coverage) - coverage_test - ;; -esac diff --git a/scripts/gitlab/build-unix.sh b/scripts/gitlab/build-unix.sh index 55f69e507..50ae7314c 100755 --- a/scripts/gitlab/build-unix.sh +++ b/scripts/gitlab/build-unix.sh @@ -18,12 +18,15 @@ time cargo build --target $CARGO_TARGET --release --features final time cargo build --target $CARGO_TARGET --release -p evmbin time cargo build --target $CARGO_TARGET --release -p ethstore-cli time cargo build --target $CARGO_TARGET --release -p ethkey-cli +time cargo build --target $CARGO_TARGET --release -p whisper-cli echo "_____ Post-processing binaries _____" rm -rf artifacts mkdir -p artifacts cd artifacts -cp ../target/$CARGO_TARGET/release/{parity,parity-evm,ethstore,ethkey} . +mkdir -p $CARGO_TARGET +cd $CARGO_TARGET +cp ../../target/$CARGO_TARGET/release/{parity,parity-evm,ethstore,ethkey,whisper} . strip -v ./* echo "_____ Calculating checksums _____" for binary in $(ls) diff --git a/scripts/gitlab/build-windows.sh b/scripts/gitlab/build-windows.sh index e3631e6d4..a5510875c 100755 --- a/scripts/gitlab/build-windows.sh +++ b/scripts/gitlab/build-windows.sh @@ -11,15 +11,25 @@ time cargo build --target $CARGO_TARGET --release --features final time cargo build --target $CARGO_TARGET --release -p evmbin time cargo build --target $CARGO_TARGET --release -p ethstore-cli time cargo build --target $CARGO_TARGET --release -p ethkey-cli +time cargo build --target $CARGO_TARGET --release -p whisper-cli +echo "__________Sign binaries__________" +scripts/gitlab/sign.cmd $keyfile $certpass target/$CARGO_TARGET/release/parity.exe +scripts/gitlab/sign.cmd $keyfile $certpass target/$CARGO_TARGET/release/parity-evm.exe +scripts/gitlab/sign.cmd $keyfile $certpass target/$CARGO_TARGET/release/ethstore.exe +scripts/gitlab/sign.cmd $keyfile $certpass target/$CARGO_TARGET/release/ethkey.exe +scripts/gitlab/sign.cmd $keyfile $certpass target/$CARGO_TARGET/release/whisper.exe echo "_____ Post-processing binaries _____" rm -rf artifacts mkdir -p artifacts cd artifacts -cp --verbose ../target/$CARGO_TARGET/release/{parity,parity-evm,ethstore,ethkey}.exe . +mkdir -p $CARGO_TARGET +cd $CARGO_TARGET +cp --verbose ../../target/$CARGO_TARGET/release/{parity.exe,parity-evm.exe,ethstore.exe,ethkey.exe,whisper.exe} . echo "_____ Calculating checksums _____" for binary in $(ls) do - rhash --sha256 $binary -o $binary.unsigned.sha256 + rhash --sha256 $binary -o $binary.sha256 done +cp parity.exe.sha256 parity.sha256 diff --git a/scripts/gitlab/build.sh b/scripts/gitlab/build.sh deleted file mode 100755 index bd2000576..000000000 --- a/scripts/gitlab/build.sh +++ /dev/null @@ -1,317 +0,0 @@ -#!/usr/bin/env bash - -set -e # fail on any error -#ARGUMENTS: 1. BUILD_PLATFORM (target for binaries) 2. PLATFORM (target for cargo) 3. ARC (architecture) 4. & 5. CC & CXX flags 6. binary identifier -BUILD_PLATFORM=$1 -PLATFORM=$2 -ARC=$3 -CC=$4 -CXX=$5 -IDENT=$6 -VER="$(grep -m 1 "version =" Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")" -S3WIN="" -echo "--------------------" -echo "Build for platform: " $BUILD_PLATFORM -echo "Build identifier: " $IDENT -echo "Cargo target: " $PLATFORM -echo "CC&CXX flags: " $CC ", " $CXX -echo "Architecture: " $ARC -echo "Parity version: " $VER -echo "Branch: " $CI_BUILD_REF_NAME -echo "Protect? " $protect -echo "--------------------" - -# NOTE for sha256 we want to display filename as well -# hence we use --* instead of -p * -SHA256_BIN="rhash --sha256" - -set_env () { - echo "__________Set ENVIROMENT__________" - export HOST_CC=gcc - export HOST_CXX=g++ - rm -rf .cargo - mkdir -p .cargo - echo "[target.$PLATFORM]" >> .cargo/config - echo "linker= \"$CC\"" >> .cargo/config - cat .cargo/config -} -set_env_win () { - set PLATFORM=x86_64-pc-windows-msvc - set INCLUDE="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;C:\vs2015\VC\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt" - set LIB="C:\vs2015\VC\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64" - set RUST_BACKTRACE=1 - #export RUSTFLAGS=$RUSTFLAGS - rustup default stable-x86_64-pc-windows-msvc - echo "@ signtool sign /f "\%"1 /p "\%"2 /tr http://timestamp.comodoca.com /du https://parity.io "\%"3" > sign.cmd -} -build () { - echo "__________Build parity__________" - time cargo build --target $PLATFORM --features final --release - echo "__________Build evmbin__________" - time cargo build --target $PLATFORM --release -p evmbin - echo "__________Build ethstore-cli__________" - time cargo build --target $PLATFORM --release -p ethstore-cli - echo "__________Build ethkey-cli__________" - time cargo build --target $PLATFORM --release -p ethkey-cli -} -strip_binaries () { - echo "__________Strip binaries__________" - $STRIP_BIN -v target/$PLATFORM/release/parity - $STRIP_BIN -v target/$PLATFORM/release/parity-evm - $STRIP_BIN -v target/$PLATFORM/release/ethstore - $STRIP_BIN -v target/$PLATFORM/release/ethkey; -} -calculate_checksums () { - echo "__________Checksum calculation__________" - rhash --version - - rm -rf *.sha256 - BIN="target/$PLATFORM/release/parity$S3WIN" - export SHA3="$($BIN tools hash $BIN)" - - echo "Parity file SHA3: $SHA3" - $SHA256_BIN target/$PLATFORM/release/parity$S3WIN > parity$S3WIN.sha256 - $SHA256_BIN target/$PLATFORM/release/parity-evm$S3WIN > parity-evm$S3WIN.sha256 - $SHA256_BIN target/$PLATFORM/release/ethstore$S3WIN > ethstore$S3WIN.sha256 - $SHA256_BIN target/$PLATFORM/release/ethkey$S3WIN > ethkey$S3WIN.sha256 - $SHA256_BIN target/$PLATFORM/release/whisper$S3WIN > whisper$S3WIN.sha256 -} -sign_exe () { - if [[ -z "$protect" ]]; then echo "__________Skipping sign binaries__________"&&return; fi - ./sign.cmd $keyfile $certpass "target/$PLATFORM/release/parity.exe" -<<<<<<< HEAD:scripts/gitlab/build.sh - ./sign.cmd $keyfile $certpass windows/ptray/x64/release/ptray.exe -} -make_exe () { - ./msbuild.cmd - sign_exe - cd nsis - curl -sL --url "https://github.com/paritytech/win-build/raw/master/vc_redist.x64.exe" -o vc_redist.x64.exe - echo "makensis.exe installer.nsi" > nsis.cmd - ./nsis.cmd - cd .. - cp nsis/installer.exe "parity_"$VER"_"$IDENT"_"$ARC"."$EXT - ./sign.cmd $keyfile $certpass "parity_"$VER"_"$IDENT"_"$ARC"."$EXT - $MD5_BIN "parity_"$VER"_"$IDENT"_"$ARC"."$EXT -p %h > "parity_"$VER"_"$IDENT"_"$ARC"."$EXT".md5" - $SHA256_BIN "parity_"$VER"_"$IDENT"_"$ARC"."$EXT -p %h > "parity_"$VER"_"$IDENT"_"$ARC"."$EXT".sha256" -======= - ./sign.cmd $keyfile $certpass "target/$PLATFORM/release/parity-evm.exe" - ./sign.cmd $keyfile $certpass "target/$PLATFORM/release/ethstore.exe" - ./sign.cmd $keyfile $certpass "target/$PLATFORM/release/ethkey.exe" - ./sign.cmd $keyfile $certpass "target/$PLATFORM/release/whisper.exe" ->>>>>>> master:scripts/gitlab-build.sh -} -push_snap () { - if [[ -z "$protect" ]]; then echo "__________Skipping push and release snap__________"&&return; fi - snapcraft_login=$(expect -c " - spawn snapcraft login - expect \"Email:\" - send \"$SNAP_EMAIL\n\" - expect \"Password:\" - send \"$SNAP_PASS\n\" - expect \"\$\" - ") - echo "$snapcraft_login" - snapcraft push "parity_"$VER"_"$ARC".snap" >> push.log - cat push.log - REVISION="$(grep -m 1 "Revision " push.log | awk '{print $2}')" - echo "__________Revision__________" - echo $REVISION - sleep 120 - if [[ "$CI_BUILD_REF_NAME" = "beta" || "$VER" == *1.9* ]]; - then - snapcraft release parity_"$VER"_"$ARC".snap $REVISION beta - snapcraft release parity_"$VER"_"$ARC".snap $REVISION candidate; - fi - if [[ "$CI_BUILD_REF_NAME" = "nightly" ]]; - then - snapcraft release parity_"$VER"_"$ARC".snap $REVISION edge; - fi - if [[ "$CI_BUILD_REF_NAME" = "beta" || "$VER" == *1.8* ]]; - then - snapcraft release parity_"$VER"_"$ARC".snap $REVISION stable; - fi - snapcraft status parity - snapcraft logout -} -make_snap () { - export HOST_CC=gcc - export HOST_CXX=g++ - apt install -y expect zip rhash - snapcraft clean - echo "__________ Prepare snapcraft.yaml for build on Gitlab CI in Docker image __________" - sed -i 's/git/'"$VER"'/g' snap/snapcraft.yaml - if [[ "$CI_BUILD_REF_NAME" = "beta" || "$VER" == *1.9* ]]; - then - sed -i -e 's/grade: devel/grade: stable/' snap/snapcraft.yaml; - fi - if [[ "$ARC" = "i386" ]]; - then - export ARCH=i686&&ln -s /usr/bin/gcc /usr/bin/i386-linux-gnu-gcc; - fi - mv -f snap/snapcraft.yaml snapcraft.yaml - snapcraft --target-arch=$ARC -d - echo "__________Build comlete__________" - push_snap - echo "__________Checksum calculation__________" - $MD5_BIN "parity_"$VER"_"$ARC".snap" > "parity_"$VER"_"$ARC".snap.md5" - $SHA256_BIN "parity_"$VER"_"$ARC".snap" > "parity_"$VER"_"$ARC".snap.sha256" - echo "__________Copy all artifacts to one place__________" - rm -rf artifacts - mkdir -p artifacts - cp "parity_"$VER"_"$ARC".snap" artifacts - cp "parity_"$VER"_"$ARC".snap.md5" artifacts - cp "parity_"$VER"_"$ARC".snap.sha256" artifacts -} -push_binaries () { - if [[ -z "$protect" ]]; then echo "__________Skipping push to S3__________"&&return; fi - echo "__________Push binaries to AWS S3__________" - aws configure set aws_access_key_id $s3_key - aws configure set aws_secret_access_key $s3_secret - if [[ "$CI_BUILD_REF_NAME" = "beta" || "$CI_BUILD_REF_NAME" = "stable" || "$CI_BUILD_REF_NAME" = "nightly" ]]; - then - export S3_BUCKET=builds-parity-published; - else - export S3_BUCKET=builds-parity; - fi - aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$BUILD_PLATFORM - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity$S3WIN --body target/$PLATFORM/release/parity$S3WIN - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity$S3WIN.sha256 --body parity$S3WIN.sha256 - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity-evm$S3WIN --body target/$PLATFORM/release/parity-evm$S3WIN - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity-evm$S3WIN.sha256 --body parity-evm$S3WIN.sha256 - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethstore$S3WIN --body target/$PLATFORM/release/ethstore$S3WIN - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethstore$S3WIN.sha256 --body ethstore$S3WIN.sha256 - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN --body target/$PLATFORM/release/ethkey$S3WIN - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN.sha256 --body ethkey$S3WIN.sha256 - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/whisper$S3WIN --body target/$PLATFORM/release/whisper$S3WIN - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/whisper$S3WIN.sha256 --body whisper$S3WIN.sha256 -} - -make_archive () { - echo "add artifacts to archive" - rm -rf parity.zip - zip -r parity.zip target/$PLATFORM/release/parity$S3WIN target/$PLATFORM/release/parity-evm$S3WIN target/$PLATFORM/release/ethstore$S3WIN target/$PLATFORM/release/ethkey$S3WIN target/$PLATFORM/release/whisper$S3WIN parity$S3WIN.sha256 parity-evm$S3WIN.sha256 ethstore$S3WIN.sha256 ethkey$S3WIN.sha256 whisper$S3WIN.sha256 -} -updater_push_release () { - echo "__________Build comlete__________" - if [[ -z "$protect" ]]; then echo "__________Skipping push release__________"&&return; fi - echo "__________Push release___________" - DATA="commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity$S3WIN&secret=$RELEASES_SECRET" - # Mainnet - source scripts/safe_curl.sh $DATA "http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$BUILD_PLATFORM" - # Kovan - source scripts/safe_curl.sh $DATA "http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$BUILD_PLATFORM" -} -build_and_push () { - build - strip_binaries - calculate_checksums - make_deb - prepare_artifacts - push_binaries - updater_push_release -} -case $BUILD_PLATFORM in - x86_64-unknown-linux-gnu) - #set strip bin - STRIP_BIN="strip" - #package extention - build - strip_binaries - calculate_checksums - make_archive - push_binaries - updater_push_release - ;; - i686-unknown-linux-gnu) - STRIP_BIN="strip" - set_env -<<<<<<< HEAD:scripts/gitlab/build.sh - build_and_push -======= - build - strip_binaries - calculate_checksums - make_archive - push_binaries ->>>>>>> master:scripts/gitlab-build.sh - ;; - armv7-unknown-linux-gnueabihf) - STRIP_BIN="arm-linux-gnueabihf-strip" - set_env - build - strip_binaries - calculate_checksums - make_archive - push_binaries - ;; - arm-unknown-linux-gnueabihf) - STRIP_BIN="arm-linux-gnueabihf-strip" - set_env - build - strip_binaries - calculate_checksums - make_archive - push_binaries - ;; - aarch64-unknown-linux-gnu) - STRIP_BIN="aarch64-linux-gnu-strip" - set_env - build - strip_binaries - calculate_checksums - make_archive - push_binaries - ;; - x86_64-apple-darwin) - STRIP_BIN="strip" - PLATFORM="x86_64-apple-darwin" - build - strip_binaries - calculate_checksums - make_archive - push_binaries - updater_push_release - ;; - x86_64-unknown-snap-gnu) - ARC="amd64" - EXT="snap" - apt update - apt install -y expect zip rhash - snapcraft clean - echo "Prepare snapcraft.yaml for build on Gitlab CI in Docker image" - sed -i 's/git/'"$VER"'/g' snap/snapcraft.yaml - if [[ "$CI_BUILD_REF_NAME" = "stable" || "$CI_BUILD_REF_NAME" = "beta" || "$VER" == *1.11* || "$VER" == *2.0* ]]; - then - sed -i -e 's/grade: devel/grade: stable/' snap/snapcraft.yaml; - fi - mv -f snap/snapcraft.yaml snapcraft.yaml - snapcraft -d - snapcraft_login=$(expect -c " - spawn snapcraft login - expect \"Email:\" - send \"$SNAP_EMAIL\n\" - expect \"Password:\" - send \"$SNAP_PASS\n\" - expect \"\$\" - ") - echo "$snapcraft_login" - snapcraft push "parity_"$VER"_amd64.snap" - snapcraft status parity - snapcraft logout - $SHA256_BIN "parity_"$VER"_amd64.snap" > "parity_"$VER"_amd64.snap.sha256" - echo "add artifacts to archive" - rm -rf parity.zip - zip -r parity.zip "parity_"$VER"_amd64.snap" "parity_"$VER"_amd64.snap.sha256" - ;; - x86_64-pc-windows-msvc) - set_env_win - EXT="exe" - S3WIN=".exe" - build - sign_exe - calculate_checksums - make_archive - push_binaries - updater_push_release -esac diff --git a/scripts/gitlab/coverage.sh b/scripts/gitlab/coverage.sh index e3371f142..1ddf340a1 100755 --- a/scripts/gitlab/coverage.sh +++ b/scripts/gitlab/coverage.sh @@ -3,7 +3,7 @@ set -x git submodule update --init --recursive rm -rf target/* -cargo test --all --exclude evmjit --no-run || exit $? +cargo test --all --exclude evmjit --no-run -- --test-threads 8|| exit $? KCOV_TARGET="target/cov" KCOV_FLAGS="--verify" EXCLUDE="/usr/lib,/usr/include,$HOME/.cargo,$HOME/.multirust,rocksdb,secp256k1" @@ -15,9 +15,6 @@ for FILE in `find target/debug/deps ! -name "*.*"` done timeout --signal=SIGKILL 5m kcov --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET target/debug/parity-* echo "Cover JS" -cd ../../js -npm install&&npm run test:coverage -cd .. bash <(curl -s https://codecov.io/bash)&& echo "Uploaded code coverage" exit 0 diff --git a/scripts/gitlab/msbuild.cmd b/scripts/gitlab/msbuild.cmd deleted file mode 100755 index 16d23cfcf..000000000 --- a/scripts/gitlab/msbuild.cmd +++ /dev/null @@ -1 +0,0 @@ -MsBuild.exe windows\ptray\ptray.vcxproj /p:Platform=x64 /p:Configuration=Release diff --git a/scripts/gitlab/package-macos.sh b/scripts/gitlab/package-macos.sh deleted file mode 100755 index 42fa7f38c..000000000 --- a/scripts/gitlab/package-macos.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -set -e # fail on any error -set -u # treat unset variables as error -OSX_PACKAGE="parity_"$VERSION"_macos_x86_64.pkg" -echo "__________Create MacOS package__________" -cd mac -xcodebuild -configuration Release -cd .. -packagesbuild -v mac/Parity.pkgproj -echo "__________Sign Package__________" -find . -name \*.pkg -productsign --sign 'Developer ID Installer: PARITY TECHNOLOGIES LIMITED (P2PX3JU8FT)' Parity\ Ethereum.pkg $OSX_PACKAGE -echo "__________Move package to artifacts__________" -mkdir -p packages -mv -v $OSX_PACKAGE packages/$OSX_PACKAGE -cd packages -echo "_____ Calculating checksums _____" -rhash --sha256 "parity_"$VERSION"_macos_x86_64.pkg" >> "parity_"$VERSION"_macos_x86_64.pkg.sha256" diff --git a/scripts/gitlab/package-snap.sh b/scripts/gitlab/package-snap.sh index c3e5b0045..dc140b5a9 100755 --- a/scripts/gitlab/package-snap.sh +++ b/scripts/gitlab/package-snap.sh @@ -3,9 +3,9 @@ set -e # fail on any error set -u # treat unset variables as error case ${CI_COMMIT_REF_NAME} in - master|*v1.12*|gitlab-next) export GRADE="devel";; - beta|*v1.11*) export GRADE="stable";; - stable|*v1.10*) export GRADE="stable";; + master|*v2.1*|gitlab-next) export GRADE="devel";; + beta|*v2.0*) export GRADE="stable";; + stable|*v1.11*) export GRADE="stable";; *) echo "No release" exit 0;; esac SNAP_PACKAGE="parity_"$VERSION"_"$BUILD_ARCH".snap" @@ -13,13 +13,13 @@ echo "__________Create snap package__________" echo "Release channel :" $GRADE " Branch/tag: " $CI_COMMIT_REF_NAME snapcraft clean echo $VERSION:$GRADE:$BUILD_ARCH -cat scripts/gitlab/templates/snapcraft.template.yaml | envsubst '$VERSION:$GRADE:$BUILD_ARCH' > snapcraft.yaml +cat scripts/gitlab/templates/snapcraft.template.yaml | envsubst '$VERSION:$GRADE:$BUILD_ARCH:$CARGO_TARGET' > snapcraft.yaml cat snapcraft.yaml snapcraft --target-arch=$BUILD_ARCH ls *.snap echo "__________Post-processing snap package__________" -mkdir -p packages -mv -v $SNAP_PACKAGE "packages/"$SNAP_PACKAGE +mkdir -p artifacts +mv -v $SNAP_PACKAGE "artifacts/"$SNAP_PACKAGE echo "_____ Calculating checksums _____" -cd packages +cd artifacts rhash --sha256 $SNAP_PACKAGE -o $SNAP_PACKAGE".sha256" diff --git a/scripts/gitlab/package-unix.sh b/scripts/gitlab/package-unix.sh deleted file mode 100755 index e43d2a8d2..000000000 --- a/scripts/gitlab/package-unix.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -set -e # fail on any error -set -u # treat unset variables as error - -rm -rf /install -mkdir -p packages -echo "__________Create "$PKG" package__________" -PACKAGE="parity_"$VERSION"_"$IDENT"_"$BUILD_ARCH"."$PKG -mkdir -p /install/usr/bin -cp artifacts/parity /install/usr/bin -cp artifacts/parity-evm /install/usr/bin/parity-evm -cp artifacts/ethstore /install/usr/bin/ethstore -cp artifacts/ethkey /install/usr/bin/ethkey -cp scripts/gitlab/uninstall-parity.sh /install/usr/bin/uninstall-parity.sh -fpm --input-type dir \ ---output-type $PKG \ ---name parity \ ---version $VERSION \ ---license GPLv3 \ ---depends "$LIBSSL" \ ---provides parity \ ---url https://parity.io \ ---vendor "Parity Technologies" \ ---architecture $BUILD_ARCH \ ---maintainer "" \ ---description "Ethereum network client by Parity Technologies" \ ---before-install scripts/gitlab/install-readme.sh \ ---before-upgrade scripts/gitlab/uninstall-parity.sh \ ---after-remove scripts/gitlab/uninstall-parity.sh \ --C /install \ --p packages/$PACKAGE -echo "_____ Calculating checksums _____" -cd packages -rhash --sha256 $PACKAGE > $PACKAGE".sha256" diff --git a/scripts/gitlab/package-windows.sh b/scripts/gitlab/package-windows.sh deleted file mode 100755 index d83bd2e4d..000000000 --- a/scripts/gitlab/package-windows.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -set -e # fail on any error -set -u # treat unset variables as error - -VERSION=$(grep -m 1 "version =" Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n") -echo "__________Create Windows package__________" -scripts/gitlab/msbuild.cmd -echo "__________Sign binaries__________" -scripts/gitlab/sign.cmd $keyfile $certpass artifacts/parity.exe -scripts/gitlab/sign.cmd $keyfile $certpass windows/ptray/x64/release/ptray.exe -echo "__________Create Windows installer__________" -cd nsis -curl -sL --url "https://github.com/paritytech/win-build/raw/master/vc_redist.x64.exe" -o vc_redist.x64.exe -echo "makensis.exe installer.nsi" > nsis.cmd -./nsis.cmd -cd .. -echo "__________Move package to artifacts__________" -mkdir -p packages -cp nsis/installer.exe packages/"parity_"$VERSION"_windows_x86_64.exe" -echo "__________Sign installer__________" -scripts/gitlab/sign.cmd $keyfile $certpass packages/"parity_"$VERSION"_windows_x86_64.exe" -echo "_____ Calculating checksums _____" -cd packages -for binary in $(ls) -do - rhash --sha256 $binary -o $binary.sha256 -done diff --git a/scripts/gitlab/publish-snap.sh b/scripts/gitlab/publish-snap.sh index 6e6f7ef47..40abd105e 100755 --- a/scripts/gitlab/publish-snap.sh +++ b/scripts/gitlab/publish-snap.sh @@ -4,15 +4,15 @@ set -e # fail on any error set -u # treat unset variables as error case ${CI_COMMIT_REF_NAME} in - master|*v1.12*|gitlab-next) export CHANNEL="edge";; - beta|*v1.11*) export CHANNEL="beta";; - stable|*v1.10*) export CHANNEL="stable";; + master|*v2.1*|gitlab-next) export CHANNEL="edge";; + beta|*v2.0*) export CHANNEL="beta";; + stable|*v1.11*) export CHANNEL="stable";; *) echo "No release" exit 0;; esac 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 "packages/parity_"$VERSION"_"$BUILD_ARCH".snap" +snapcraft push --release $CHANNEL "artifacts/parity_"$VERSION"_"$BUILD_ARCH".snap" snapcraft status parity snapcraft logout diff --git a/scripts/gitlab/push-binaries.sh b/scripts/gitlab/push-binaries.sh deleted file mode 100755 index 5c15b7ccf..000000000 --- a/scripts/gitlab/push-binaries.sh +++ /dev/null @@ -1,25 +0,0 @@ -echo "__________Push binaries to AWS S3__________" -aws configure set aws_access_key_id $s3_key -aws configure set aws_secret_access_key $s3_secret -if [[ "$CI_BUILD_REF_NAME" = "master" || "$CI_BUILD_REF_NAME" = "beta" || "$CI_BUILD_REF_NAME" = "stable" || "$CI_BUILD_REF_NAME" = "nightly" ]]; -then - export S3_BUCKET=builds-parity-published; -else - export S3_BUCKET=builds-parity; -fi -aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$BUILD_PLATFORM -aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity$S3WIN --body target/$PLATFORM/release/parity$S3WIN -aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity$S3WIN.md5 --body parity$S3WIN.md5 -aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity$S3WIN.sha256 --body parity$S3WIN.sha256 -aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity-evm$S3WIN --body target/$PLATFORM/release/parity-evm$S3WIN -aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity-evm$S3WIN.md5 --body parity-evm$S3WIN.md5 -aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity-evm$S3WIN.sha256 --body parity-evm$S3WIN.sha256 -aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethstore$S3WIN --body target/$PLATFORM/release/ethstore$S3WIN -aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethstore$S3WIN.md5 --body ethstore$S3WIN.md5 -aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethstore$S3WIN.sha256 --body ethstore$S3WIN.sha256 -aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN --body target/$PLATFORM/release/ethkey$S3WIN -aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN.md5 --body ethkey$S3WIN.md5 -aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN.sha256 --body ethkey$S3WIN.sha256 -aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/"parity_"$VER"_"$IDENT"_"$ARC"."$EXT --body "parity_"$VER"_"$IDENT"_"$ARC"."$EXT -aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/"parity_"$VER"_"$IDENT"_"$ARC"."$EXT".md5" --body "parity_"$VER"_"$IDENT"_"$ARC"."$EXT".md5" -aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/"parity_"$VER"_"$IDENT"_"$ARC"."$EXT".sha256" --body "parity_"$VER"_"$IDENT"_"$ARC"."$EXT".sha256" diff --git a/scripts/gitlab/push-github.sh b/scripts/gitlab/push-github.sh deleted file mode 100755 index 71e99677c..000000000 --- a/scripts/gitlab/push-github.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -set -e # fail on any error -set -u # treat unset variables as error -echo "__________Set ENVIROMENT__________" -DOWNLOAD_PREFIX="https://github.com/paritytech/parity/releases/download/"$CI_COMMIT_REF_NAME"/" -DESCRIPTION="$(cat CHANGELOG.md)" -RELEASE_TABLE="$(cat scripts/gitlab/templates/release-table.md)" -RELEASE_TABLE="$(echo "${RELEASE_TABLE//\$VERSION/${VERSION}}")" -RELEASE_TABLE="$(echo "${RELEASE_TABLE//\$DOWNLOAD_PREFIX/${DOWNLOAD_PREFIX}}")" -#The text in the file CANGELOG.md before which the table with links is inserted. Must be present in this file necessarily -REPLACE_TEXT="The full list of included changes:" -case ${CI_COMMIT_REF_NAME} in - master|*v1.12*|nightly) NAME="Parity "$VERSION" nightly";; - beta|*v1.11*) NAME="Parity "$VERSION" beta";; - stable|*v1.10*) NAME="Parity "$VERSION" stable";; - *) echo "No release" exit 0;; -esac -cd packages -i=1 -for binary in $(ls *.sha256) -do - sha256=$(cat $binary | awk '{ print $1}' ) - RELEASE_TABLE="$(echo "${RELEASE_TABLE/sha${i}/${sha256}}")" - let ++i -done -#do not touch the following 3 lines. Features of output in Markdown -DESCRIPTION="$(echo "${DESCRIPTION/${REPLACE_TEXT}/${RELEASE_TABLE} - -${REPLACE_TEXT}}")" -echo "__________Create release to Github____________" -github-release release --user "$GITHUB_USER" --repo parity --tag "$CI_COMMIT_REF_NAME" --draft --name "$NAME" --description "$DESCRIPTION" -echo "__________Upload files to Github____________" - -for binary in $(ls -I "*.sha256") -do - github-release upload --user "$GITHUB_USER" --repo parity --tag "$CI_COMMIT_REF_NAME" --replace --name "$binary" --file $binary -done diff --git a/scripts/gitlab/push-release.sh b/scripts/gitlab/push-release.sh deleted file mode 100755 index 207d66c11..000000000 --- a/scripts/gitlab/push-release.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e # fail on any error -set -u # treat unset variables as error - -DATA="secret=$RELEASES_SECRET" - -echo "Pushing release to Mainnet" -./scripts/safe_curl.sh $DATA "http://update.parity.io:1337/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF" - -echo "Pushing release to Kovan" -./scripts/safe_curl.sh $DATA "http://update.parity.io:1338/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF" diff --git a/scripts/gitlab/push.sh b/scripts/gitlab/push.sh new file mode 100755 index 000000000..ac4e88bd4 --- /dev/null +++ b/scripts/gitlab/push.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +set -e # fail on any error +set -u # treat unset variables as error +updater_push_release () { + echo "push release" + # Mainnet + +} +echo "__________Set ENVIROMENT__________" +DESCRIPTION="$(cat CHANGELOG.md)" +RELEASE_TABLE="$(cat scripts/gitlab/templates/release-table.md)" +RELEASE_TABLE="$(echo "${RELEASE_TABLE//\$VERSION/${VERSION}}")" +#The text in the file CANGELOG.md before which the table with links is inserted. Must be present in this file necessarily +REPLACE_TEXT="The full list of included changes:" +case ${CI_COMMIT_REF_NAME} in + master|*v2.1*|gitlab-next) NAME="Parity "$VERSION" nightly";; + beta|*v2.0*) NAME="Parity "$VERSION" beta";; + stable|*v1.11*) NAME="Parity "$VERSION" stable";; + *) echo "No release" exit 0;; +esac +cd artifacts +ls -l | sort -k9 +filetest=( * ) +echo ${filetest[*]} +for DIR in "${filetest[@]}"; +do + cd $DIR + if [[ $DIR == "*windows*" ]]; + then + WIN=".exe"; + else + WIN=""; + fi + for binary in $(ls parity.sha256) + do + sha256=$(cat $binary | awk '{ print $1}' ) + case $DIR in + x86_64* ) + DATA="commit=$CI_BUILD_REF&sha3=$sha256&filename=parity$WIN&secret=$RELEASES_SECRET" + ../../scripts/gitlab/safe_curl.sh $DATA "http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$DIR" + # Kovan + ../../scripts/gitlab/safe_curl.sh $DATA "http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$DIR" + ;; + esac + RELEASE_TABLE="$(echo "${RELEASE_TABLE/sha$DIR/${sha256}}")" + done + cd .. +done +#do not touch the following 3 lines. Features of output in Markdown +DESCRIPTION="$(echo "${DESCRIPTION/${REPLACE_TEXT}/${RELEASE_TABLE} + +${REPLACE_TEXT}}")" +echo "$DESCRIPTION" +if [["$CI_COMMIT_REF_NAME" == "nightly" ]]; then DESCRIPTION=""; fi #TODO in the future, we need to prepare a script that will do changelog +echo "__________Create release to Github____________" +github-release release --user devops-parity --repo parity-ethereum --tag "$CI_COMMIT_REF_NAME" --draft --name "$NAME" --description "$DESCRIPTION" +echo "__________Push binaries to AWS S3____________" +aws configure set aws_access_key_id $s3_key +aws configure set aws_secret_access_key $s3_secret +if [[ "$CI_BUILD_REF_NAME" = "beta" || "$CI_BUILD_REF_NAME" = "stable" || "$CI_BUILD_REF_NAME" = "nightly" ]]; + then + export S3_BUCKET=builds-parity-published; + else + export S3_BUCKET=builds-parity; +fi +aws s3 sync ./ s3://$S3_BUCKET/$CI_BUILD_REF_NAME/ diff --git a/scripts/gitlab/rpc-docs.sh b/scripts/gitlab/rpc-docs.sh new file mode 100755 index 000000000..0e37b24ec --- /dev/null +++ b/scripts/gitlab/rpc-docs.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +set -e # fail on any error +set -u # treat unset variables as error + +clone_repos() { + echo "__________Clone repos__________" + git clone https://github.com/parity-js/jsonrpc.git jsonrpc + git clone https://github.com/paritytech/wiki.git wiki +} + +build_docs() { + echo "__________Build docs__________" + npm install + npm run build:markdown +} + +update_wiki_docs() { + echo "__________Update WIKI docs__________" + for file in $(ls jsonrpc/docs); do + module_name=${file:0:-3} + mv jsonrpc/docs/$file wiki/JSONRPC-$module_name-module.md + done +} + +setup_git() { + echo "__________Set github__________" + git config user.email "devops@parity.com" + git config user.name "Devops Parity" +} + +commit_files() { + echo "__________Commit files__________" + git checkout -b rpcdoc-update-${CI_COMMIT_REF_NAME} + git commit . + git commit -m "Update docs to ${CI_COMMIT_REF_NAME}" + git tag -a "${CI_COMMIT_REF_NAME}" +} + +upload_files() { + echo "__________Upload files__________" + git push --tags +} + +setup_git +clone_repos +cp parity jsonrpc/.parity +cd jsonrpc +build_docs +cd .. +update_wiki_docs +cd wiki +commit_files +upload_files diff --git a/scripts/safe_curl.sh b/scripts/gitlab/safe_curl.sh similarity index 100% rename from scripts/safe_curl.sh rename to scripts/gitlab/safe_curl.sh diff --git a/scripts/gitlab/templates/release-table.md b/scripts/gitlab/templates/release-table.md index 8dc639397..614552152 100644 --- a/scripts/gitlab/templates/release-table.md +++ b/scripts/gitlab/templates/release-table.md @@ -1,12 +1,12 @@ | OS | Arch | Download | SHA256 Checksum | |:---:|:---:|:---|:---| -| Linux Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect | x64 | [parity_$VERSION_centos_x86_64.rpm]($DOWNLOAD_PREFIXparity_$VERSION_centos_x86_64.rpm) | `sha1` | -| Linux Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect | x64 | [parity_$VERSION_debian_amd64.deb]($DOWNLOAD_PREFIXx86_64-unknown-debian-gnu/parity_$VERSION_debian_amd64.deb) | `sha2` | -| Apple Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect | x64 | [parity_$VERSION_macos_macos.pkg]($DOWNLOAD_PREFIXx86_64-apple-darwin/parity_$VERSION_macos_macos.pkg) | `sha3` | -| Linux Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect | x64 | [parity_$VERSION_ubuntu_amd64.deb]($DOWNLOAD_PREFIXx86_64-unknown-linux-gnu/parity_$VERSION_ubuntu_amd64.deb) | `sha4` | -| Linux Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect | arm64 | [parity_$VERSION_ubuntu_arm64.deb]($DOWNLOAD_PREFIXaarch64-unknown-linux-gnu/parity_$VERSION_ubuntu_arm64.deb) | `sha5` | -| Linux Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect | armv7 | [parity_$VERSION_ubuntu_armhf.deb]($DOWNLOAD_PREFIXarmv7-unknown-linux-gnueabihf/parity_$VERSION_ubuntu_armhf.deb) | `sha6` | -| Windows Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect | x64 | [parity_$VERSION_windows_x86_64.exe]($DOWNLOAD_PREFIXx86_64-pc-windows-msvc/parity_$VERSION_windows_x86_64.exe) | `sha7` | +| linux | arm64 | [parity](https://releases.parity.io/$VERSION/aarch64-unknown-linux-gnu/parity) | `shaaarch64-unknown-linux-gnu` | +| android | armv7 | [parity](https://releases.parity.io/$VERSION/armv7-linux-androideabi/parity) | `shaarmv7-linux-androideabi` | +| linux | armv7 | [parity](https://releases.parity.io/$VERSION/armv7-unknown-linux-gnueabihf/parity) | `shaarmv7-unknown-linux-gnueabihf` | +| linux | i686 | [parity](https://releases.parity.io/$VERSION/i686-unknown-linux-gnu/parity) | `shai686-unknown-linux-gnu` | +| osx | x64 | [parity](https://releases.parity.io/$VERSION/x86_64-apple-darwin/parity) | `shax86_64-apple-darwin` | +| windows | x64 | [parity.exe](https://releases.parity.io/$VERSION/x86_64-pc-windows-msvc/parity.exe) | `shax86_64-pc-windows-msvc` | +| linux | x64 | [parity](https://releases.parity.io/$VERSION/x86_64-unknown-linux-gnu/parity) | `shax86_64-unknown-linux-gnu` | | OS | Alternative | Link | |:---:|:---:|:---| diff --git a/scripts/gitlab/templates/snapcraft.template.yaml b/scripts/gitlab/templates/snapcraft.template.yaml index 951fc7780..97bb39aa1 100644 --- a/scripts/gitlab/templates/snapcraft.template.yaml +++ b/scripts/gitlab/templates/snapcraft.template.yaml @@ -26,6 +26,9 @@ apps: ethstore: command: ethstore plugs: [home] + whisper: + command: whisper + plugs: [home] icon: snap/gui/icon.png @@ -39,7 +42,7 @@ parts: cp -v gui/parity.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/ cp -v gui/icon.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/ parity: - source: ./artifacts + source: ./artifacts/$CARGO_TARGET plugin: nil override-build: | mkdir -p $SNAPCRAFT_PART_INSTALL/usr/bin @@ -47,7 +50,8 @@ parts: cp -v parity-evm $SNAPCRAFT_PART_INSTALL/usr/bin/parity-evm cp -v ethkey $SNAPCRAFT_PART_INSTALL/usr/bin/ethkey cp -v ethstore $SNAPCRAFT_PART_INSTALL/usr/bin/ethstore - stage-packages: [libc6, libssl1.0.0, libudev1, libstdc++6] + cp -v whisper $SNAPCRAFT_PART_INSTALL/usr/bin/whisper + stage-packages: [libc6, libssl1.0.0, libudev1, libstdc++6, cmake] df: plugin: nil stage-packages: [coreutils] diff --git a/scripts/gitlab/test-qemu.sh b/scripts/gitlab/test-qemu.sh deleted file mode 100755 index a7b57ed70..000000000 --- a/scripts/gitlab/test-qemu.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -##ARGUMENTS: 1. Docker target -set -e # fail on any error -set -u # treat unset variables as error - -docker pull parity/rust-qemu:armhf -echo "Test wasmi on armhf" -docker run -it --rm -v /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static parity/rust-qemu:armhf \ -bash `git clone https://github.com/paritytech/parity.git&&\ -cd parity&&./test.sh&&cd ..&&rm -rf parity/` diff --git a/scripts/gitlab/uninstall-parity.sh b/scripts/gitlab/uninstall-parity.sh deleted file mode 100755 index cae406c44..000000000 --- a/scripts/gitlab/uninstall-parity.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -sudo killall -9 parity && sleep 5 -sudo rm -f /usr/bin/parity /usr/bin/uninstall-parity.sh /usr/bin/ethstore /usr/bin/ethkey /usr/bin/parity-evm diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml deleted file mode 100644 index c7da23960..000000000 --- a/snap/snapcraft.yaml +++ /dev/null @@ -1,41 +0,0 @@ -name: parity -version: git -summary: Fast, light, robust Ethereum implementation -description: | - Parity's goal is to be the fastest, lightest, and most secure Ethereum - client. We are developing Parity using the sophisticated and cutting-edge - Rust programming language. Parity is licensed under the GPLv3, and can be - used for all your Ethereum needs. - -grade: devel -confinement: strict - -apps: - parity: - command: parity - plugs: [home, network, network-bind, mount-observe, x11, unity7, desktop, desktop-legacy, wayland] - desktop: usr/share/applications/parity.desktop - -icon: snap/gui/icon.png - -parts: - desktop-icon: - source: ./snap - plugin: nil - prepare: | - mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/applications - mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps - cp -v gui/parity.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/ - cp -v gui/icon.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/ - parity: - source: . - plugin: rust - # rust-channel: stable # @TODO enable after https://bugs.launchpad.net/snapcraft/+bug/1778530 - rust-revision: 1.26.2 # @TODO remove after https://bugs.launchpad.net/snapcraft/+bug/1778530 - build-attributes: [no-system-libraries] - build-packages: [g++, libudev-dev, make, pkg-config, cmake] - stage-packages: [libc6, libudev1, libstdc++6] - df: - plugin: nil - stage-packages: [coreutils] - stage: [bin/df]