Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ jobs:
- stage: tests
name: "static tests"
script: npm run lint
- stage: update docs
if: tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$
addons:
apt:
packages:
- curl
script:
- ./scripts/ci/trigger_docs_update "${TRAVIS_TAG}"

notifications:
slack:
Expand Down
32 changes: 32 additions & 0 deletions scripts/ci/trigger_docs_update
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
#
# Trigger the job that will update the documentation website.
# Argument:
# version: the version of the new release. This should be a tag in the
# https://github.com/OpenZeppelin/openzeppelin-solidity repository.

set -ev

if [ "$#" -lt 1 ]; then
echo "Usage: $0 <version>"
exit 1
fi

readonly VERSION="$1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know about this keyword in bash, cool!


readonly BODY="{
\"request\": {
\"branch\": \"master\",
\"config\": {
\"env\": [\"VERSION=${VERSION}\"]
}
}
}"

curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token ${DOCS_TRAVIS_API_TOKEN}" \
-d "${BODY}" \
https://api.travis-ci.com/repo/OpenZeppelin%2Fopenzeppelin-docs/requests