From 1fda99737098a825d012d0281c7ee5867f66334a Mon Sep 17 00:00:00 2001 From: joshua-mir <43032097+joshua-mir@users.noreply.github.com> Date: Mon, 7 Jan 2019 14:47:28 +0100 Subject: [PATCH] Autogen docs for the "Configuring Parity Ethereum" wiki page. (#10067) * publish docs changes for autogen config docs * Update publish-docs.sh adding an environment variable so js knows not to download git master and just grab the local repo * Update publish-docs.sh made some changes making this unnecessary * fix env variable env variable passes to node properly now * use yarn * test pipeline, revert me * fix test pipeline, revert me * change runner tag * change runner tag 2 * change runner tag * global git config * supress upload_files output * Update .gitlab-ci.yml reverting testing changes * Replace tag if exists Very unlikely to be important/useful --- .gitlab-ci.yml | 2 +- scripts/gitlab/publish-docs.sh | 21 ++++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e2cb77606..4597f667b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -121,7 +121,7 @@ publish-docs: script: - scripts/gitlab/publish-docs.sh tags: - - shell + - linux-docker build-android: stage: optional diff --git a/scripts/gitlab/publish-docs.sh b/scripts/gitlab/publish-docs.sh index 6bf90ad05..262ea8080 100755 --- a/scripts/gitlab/publish-docs.sh +++ b/scripts/gitlab/publish-docs.sh @@ -7,6 +7,7 @@ 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() { @@ -15,18 +16,25 @@ build_docs() { 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__________" - git config user.email "devops@parity.com" - git config user.name "Devops Parity" + git config --global user.email "devops@parity.com" + git config --global user.name "Devops Parity" } set_remote_wiki() { @@ -38,13 +46,13 @@ 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 "${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}" -m "Update RPC 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__________" - git push origin HEAD - git push --tags + git push -q origin HEAD + git push -q -f --tags } RPC_TRAITS_DIR="rpc/src/v1/traits" @@ -56,6 +64,9 @@ 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