Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Add update docs script to CI #9219

Merged
merged 7 commits into from
Aug 24, 2018
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ stages:
- test
- push-release
- build
- docs
variables:
RUST_BACKTRACE: "1"
RUSTFLAGS: ""
Expand Down Expand Up @@ -220,6 +221,15 @@ test-rust-nightly:
- rust
- rust-nightly
allow_failure: true
json-rpc-docs:
stage: docs
only:
- tags
image: parity/rust:gitlab-ci
script:
- scripts/gitlab-rpc-docs.sh
tags:
- docs
push-release:
stage: push-release
only:
Expand Down
45 changes: 45 additions & 0 deletions scripts/gitlab-rpc-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env bash

clone_repos() {
git clone https://github.com/parity-js/jsonrpc.git jsonrpc
git clone https://github.com/paritytech/wiki.git wiki
}

build_docs() {
npm install
npm run build:markdown
}

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() {
git config user.email "devops@parity.com"
git config user.name "Devops Parity"
}

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() {
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