File tree 3 files changed +37
-3
lines changed
3 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ services:
11
11
script :
12
12
- gulp build
13
13
- gulp test --coverage
14
+ - ./scripts/docs-config.sh
14
15
- npm run docs
15
16
- npm run typedoc
16
17
- gulp package
Original file line number Diff line number Diff line change 5
5
TARGET_DIR=' gh-pages'
6
6
TARGET_BRANCH=' master'
7
7
TARGET_REPO_URL=" https://$GITHUB_AUTH_TOKEN @github.com/chartjs/chartjs.github.io.git"
8
- VERSION_REGEX=' [[:digit:]]+.[[:digit:]]+.[[:digit:]]+(-.*)?'
9
8
9
+ # Note: this code also exists in docs-config.sh
10
10
# Make sure that this script is executed only for the release and master branches
11
+ VERSION_REGEX=' [[:digit:]]+.[[:digit:]]+.[[:digit:]]+(-.*)?'
11
12
if [[ " $TRAVIS_BRANCH " =~ ^release.* $ ]]; then
12
13
# Travis executes this script from the repository root, so at the same level than package.json
13
14
VERSION=$( node -p -e " require('./package.json').version" )
@@ -35,10 +36,9 @@ function update_with_tag {
35
36
move_sample_scripts $tag
36
37
37
38
deploy_versioned_files $tag
38
-
39
- sed -i -e " s/VERSION/$tag /g" " docs/$tag /docusaurus.config.js"
40
39
}
41
40
41
+ # Note: this code also exists in docs-config.sh
42
42
# tag is next|latest|master
43
43
# https://www.chartjs.org/docs/$tag/
44
44
# https://www.chartjs.org/samples/$tag/
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -e
4
+
5
+ # Note: this code also exists in deploy.sh
6
+ # Make sure that this script is executed only for the release and master branches
7
+ VERSION_REGEX=' [[:digit:]]+.[[:digit:]]+.[[:digit:]]+(-.*)?'
8
+ if [[ " $TRAVIS_BRANCH " =~ ^release.* $ ]]; then
9
+ # Travis executes this script from the repository root, so at the same level than package.json
10
+ VERSION=$( node -p -e " require('./package.json').version" )
11
+ elif [ " $TRAVIS_BRANCH " == " master" ]; then
12
+ VERSION=" master"
13
+ else
14
+ echo " Skipping docs configuration because this is not the master or release branch"
15
+ exit 0
16
+ fi
17
+
18
+ # Note: this code also exists in deploy.sh
19
+ # tag is next|latest|master
20
+ # https://www.chartjs.org/docs/$tag/
21
+ function update_config {
22
+ local tag=' '
23
+ if [ " $VERSION " == " master" ]; then
24
+ tag=master
25
+ elif [[ " $VERSION " =~ ^[^-]+$ ]]; then
26
+ tag=lastest
27
+ else
28
+ tag=next
29
+ fi
30
+ sed -i -e " s/VERSION/$tag /g" " docs/docusaurus.config.js"
31
+ }
32
+
33
+ update_config
You can’t perform that action at this time.
0 commit comments