diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-01-13 16:30:49 +0800 |
---|---|---|
committer | Jimmy Hu <jimmy.hu@dexon.org> | 2019-01-13 16:56:40 +0800 |
commit | b633e9e6fa52637f5fd0f028f19acdfc6242914a (patch) | |
tree | 72c8cc919b99f776926e3cea048e5435bb738260 | |
parent | 3cddc01a78f59a42d40a29693ff5785eda626b93 (diff) | |
download | dexon-governance-abi-b633e9e6fa52637f5fd0f028f19acdfc6242914a.tar.gz dexon-governance-abi-b633e9e6fa52637f5fd0f028f19acdfc6242914a.tar.zst dexon-governance-abi-b633e9e6fa52637f5fd0f028f19acdfc6242914a.zip |
Auto update Wiki script
-rwxr-xr-x | ci/update_wiki.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/ci/update_wiki.sh b/ci/update_wiki.sh new file mode 100755 index 0000000..7b84fa8 --- /dev/null +++ b/ci/update_wiki.sh @@ -0,0 +1,39 @@ +#!/bin/bash -f + +rm -rf ci/wiki.wiki + +set -e + +cd ci +eval $(ssh-agent -s) +ssh-add wiki_deploy_key +git clone --depth=1 git@github.com:dexon-foundation/wiki.wiki.git + +newABI=`cat ../build/contracts/Governance.json | jq -r '.abi'` + +abi=false + +rm -rf wiki.md +touch wiki.md + +while IFE= read -r line; do + if [[ $line == *"ABI AUTOGEN START"* ]]; then + abi=true + printf "<!-- [[ABI AUTOGEN START]] -->\n\`\`\`\n${newABI}\n\`\`\`\n<!-- [[ABI AUTOGEN START]] -->\n" >> wiki.md + fi + if [[ $abi == true && $line == *"ABI AUTOGEN END"* ]]; then + abi=false + fi + if [[ $abi == false ]] ; then + echo $line >> wiki.md + fi +done < wiki.wiki/Governance-Contract-Interface.md + +mv -f wiki.md wiki.wiki/Governance-Contract-Interface.md + +cd wiki.wiki + +git config user.email "TravisCI@dexon.org" +git config user.name "Travis CI" +git commit -am "Update Governance-Contract-Interface" +git push |