openethereum/scripts/gitlab/publish-docs.sh

78 lines
2.1 KiB
Bash
Raw Normal View History

#!/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
git clone https://github.com/paritytech/parity-config-generator
}
build_docs() {
echo "__________Build docs__________"
npm install
npm run build:markdown
}
build_config() {
echo "_______Build config docs______"
yarn install
AUTOGENSCRIPT=1 yarn generate-docs
}
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
mv parity-config-generator/docs/config.md wiki/Configuring-Parity-Ethereum.md
}
setup_git() {
echo "__________Set github__________"
backports for beta 2.5.2 (#10737) * version: bump beta to 2.5.2 * [CI] allow cargo audit to fail (#10676) * [CI] allow cargo audit to fail * [.gitlab-ci.yml] add a comment about cargo audit * [Cargo.lock] cargo update -p protobuf * Reset blockchain properly (#10669) * delete BlockDetails from COL_EXTRA * better proofs * added tests * PR suggestions * new image (#10673) * Update publishing (#10644) * docker images are now built on k8s: test run * copy check_sync.sh in build-linux job * copy scripts/docker/hub/* in build-linux job * removed cache var * cleanup, no more nightly dockers * cleanup in dockerfile * some new tags * removed sccsche debug log, cleanup * no_gits, new artifacts dir, changed scripts. Test run. * define version once * one source for TRACK * stop kovan onchain updates * moved changes for two images to a new branch * rename Dockerfile * no need in libudev-dev * enable lto for release builds (#10717) * Use RUSTFLAGS to set the optimization level (#10719) * Use RUSTFLAGS to set the optimization level Cargo has a [quirk]() in how configuration settings are propagated when `cargo test` runs: local code respect the settings in `[profile.test]` but all dependencies use the `[profile.dev]` settings. Here we force `opt-level=3` for all dependencies. * Remove unused profile settings * Maybe like this? * Turn off incremental compilation * Remove colors; try again with overflow-checks on * Use quiet CI machine * Turn overflow checking back on * Be explicit about what options we use * Remove "quiet machine" override * ethcore: enable ECIP-1054 for classic (#10731) * config: enable atlantis on ethereum classic * config: enable atlantis on morden classic * config: enable atlantis on morden classic * config: enable atlantis on kotti classic * ethcore: move kotti fork block to 0xAEF49 * ethcore: move morden fork block to 0x4829BA * ethcore: move classic fork block to 0x81B320 * remove trailing comma * remove trailing comma * fix chainspec * ethcore: move classic fork block to 0x7fffffffffffffff
2019-06-11 20:56:03 +02:00
git config --global user.email "devops-team@parity.io"
git config --global user.name "Devops Team Parity"
}
set_remote_wiki() {
git config remote.origin.url "https://${GITHUB_TOKEN}@github.com/paritytech/wiki.git"
}
commit_files() {
echo "__________Commit files__________"
git checkout -b rpcdoc-update-${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}
git add .
git commit -m "Update docs to ${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}"
git tag -a -f "${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}" -m "Update RPC and config docs to ${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}"
}
upload_files() {
echo "__________Upload files__________"
# this version of git (2.7.4) will dump the token on failure
git push -q origin HEAD 2>&1 \
| sed -r "s|(${GITHUB_USER}):[a-f0-9]+@|\1:REDACTED@|g"
git push -q -f --tags 2>&1 \
| sed -r "s|(${GITHUB_USER}):[a-f0-9]+@|\1:REDACTED@|g"
}
2018-09-13 14:36:44 +02:00
RPC_TRAITS_DIR="rpc/src/v1/traits"
2018-09-11 09:38:35 +02:00
setup_git
clone_repos
2018-09-11 09:38:35 +02:00
mkdir -p "jsonrpc/.parity/$RPC_TRAITS_DIR"
2018-09-13 14:36:44 +02:00
cp $RPC_TRAITS_DIR/*.rs "jsonrpc/.parity/$RPC_TRAITS_DIR"
cd jsonrpc
build_docs
cd ..
cd parity-config-generator
build_config
cd ..
update_wiki_docs
cd wiki
set_remote_wiki
commit_files
upload_files