Skip to main content

Exonum precheck deployment script

Project description

Exonum deployment precheck script

exonum_precheck is a script which verifies that all the expected checks are OK for code you're about to push. It is supposed that you'll run this script before every push at the Exonum repository.

This command loads .travis.yml and performs all the checks (tests and lints) exactly as they will be performed on the CI server. Also if installed rustc version doesn't match the one in the travis config, a warning will be shown.

Prerequirements

You should have clippy, rustfmt, deadlinks, cspell and md installed:

cargo install cargo-deadlinks
rustup component add rustfmt
rustup component add clippy
npm install cspell
npm install md

Example

cd exonum_folder
python3 -m exonum_precheck

Example output (actually it's colored):

 Tests results:
 Error: cargo test --all
 Success: cargo run -p exonum --example explorer
 Success: cargo run -p exonum-testkit --example timestamping
 Success: cargo run -p exonum-time --example simple_service
 Lints results:
 Success: npm run cspell
 Success: npm run md
 Success: cargo clippy --all --benches --features "long_benchmarks"
 Success: cargo fmt --all -- --check
 Success: cargo clean --doc
 Success: cargo doc --no-deps
 Success: mkdir -p target/doc/exonum_configuration
 Success: mkdir -p target/std/string
 Success: touch target/std/string/struct.String.html
 Success: touch target/std/primitive.usize.html
 Success: touch target/doc/enum.HashTag.html
 Success: cargo deadlinks --dir target/doc

You can also specify jobs to run manually.

python3 -m exonum_precheck --jobs linux-tests sample-job lints tests

Those jobs will be executed instead of default ones ("unit-test", "lints") in the provided order.

This maybe helpful if you want to use this script on another repository.

Using as a git hook

This script can be also used as a prepush hook:

echo '#!/bin/sh\npython3 -m exonum_precheck || exit 1\n' > ./exonum_folder/.git/hooks/pre-push
chmod +x ./exonum_folder/.git/hooks/pre-push

With that hook you won't be able to push unless all the expected CI checks are passed. However, be careful: if you're going to work on a work-in-progress branch which'll have broken tests, you'll have to temporary remove the hook.

Example of more advanced hook:

#!/bin/sh
npm install && git checkout package-lock.json package.json

export RUST_BACKTRACE=0
export RUST_LOG=off
export RUST_TEST_THREADS=4
export CARGO_BUILD_JOBS=4
ulimit -n 2048

python3 -m exonum_precheck || exit 1

Installing

Install and update using pip:

pip install -U exonum_precheck

LICENSE

exonum_precheck is licensed under the MIT License. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

exonum_precheck-0.1.5.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

exonum_precheck-0.1.5-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file exonum_precheck-0.1.5.tar.gz.

File metadata

  • Download URL: exonum_precheck-0.1.5.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for exonum_precheck-0.1.5.tar.gz
Algorithm Hash digest
SHA256 84835d678959bfd888f8bc8801af6d156e040e23685d3e4b5e4b8d7b43c7ad76
MD5 098bb1fbd0bd56dfeb03b3bc327d56a9
BLAKE2b-256 d74240bbd8e9b77631e8c4105af907709da8fa3dcf4ab7bd77370cf824317193

See more details on using hashes here.

File details

Details for the file exonum_precheck-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: exonum_precheck-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for exonum_precheck-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1b99c2cc872c5fc334a5c5027c99bed43373edef8a82fee53142d81ed46dc19b
MD5 d2991de3183774ec9bfd3f2464a0fad9
BLAKE2b-256 19d9e7e6e04a00998611544bfb72fa54fafdb9114393538d627a585e2495e392

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page