4
4
5
5
# Set default props like MAVEN_PATH, ROOT_FOLDER etc.
6
6
function set_default_props() {
7
- # The script should be executed from the root folder
7
+ # The script should be run from the root folder
8
8
ROOT_FOLDER=` pwd`
9
9
echo " Current folder is ${ROOT_FOLDER} "
10
10
@@ -65,7 +65,7 @@ function build_docs_if_applicable() {
65
65
}
66
66
67
67
# Get the name of the `docs.main` property
68
- # Get whitelisted branches - assumes that a `docs` module is available under `docs` profile
68
+ # Get allowed branches - assumes that a `docs` module is available under `docs` profile
69
69
function retrieve_doc_properties() {
70
70
MAIN_ADOC_VALUE=$( " ${MAVEN_PATH} " mvn -q \
71
71
-Dexec.executable=" echo" \
@@ -75,14 +75,14 @@ function retrieve_doc_properties() {
75
75
echo " Extracted 'main.adoc' from Maven build [${MAIN_ADOC_VALUE} ]"
76
76
77
77
78
- WHITELIST_PROPERTY =${WHITELIST_PROPERTY :- " docs.whitelisted .branches" }
79
- WHITELISTED_BRANCHES_VALUE =$( " ${MAVEN_PATH} " mvn -q \
78
+ ALLOW_PROPERTY =${ALLOW_PROPERTY :- " docs.allowed .branches" }
79
+ ALLOWED_BRANCHES_VALUE =$( " ${MAVEN_PATH} " mvn -q \
80
80
-Dexec.executable=" echo" \
81
- -Dexec.args=" \$ {${WHITELIST_PROPERTY } }" \
81
+ -Dexec.args=" \$ {${ALLOW_PROPERTY } }" \
82
82
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \
83
83
-P docs \
84
84
-pl docs)
85
- echo " Extracted '${WHITELIST_PROPERTY } ' from Maven build [${WHITELISTED_BRANCHES_VALUE } ]"
85
+ echo " Extracted '${ALLOW_PROPERTY } ' from Maven build [${ALLOWED_BRANCHES_VALUE } ]"
86
86
}
87
87
88
88
# Stash any outstanding changes
@@ -148,9 +148,9 @@ function copy_docs_for_current_version() {
148
148
else
149
149
echo -e " Current branch is [${CURRENT_BRANCH} ]"
150
150
# https://stackoverflow.com/questions/29300806/a-bash-script-to-check-if-a-string-is-present-in-a-comma-separated-list-of-strin
151
- if [[ " ,${WHITELISTED_BRANCHES_VALUE } ," = * " ,${CURRENT_BRANCH} ," * ]] ; then
151
+ if [[ " ,${ALLOWED_BRANCHES_VALUE } ," = * " ,${CURRENT_BRANCH} ," * ]] ; then
152
152
mkdir -p ${ROOT_FOLDER} /${CURRENT_BRANCH}
153
- echo -e " Branch [${CURRENT_BRANCH} ] is whitelisted ! Will copy the current docs to the [${CURRENT_BRANCH} ] folder"
153
+ echo -e " Branch [${CURRENT_BRANCH} ] is allowed ! Will copy the current docs to the [${CURRENT_BRANCH} ] folder"
154
154
for f in docs/target/generated-docs/* ; do
155
155
file=${f# docs/ target/ generated-docs/* }
156
156
if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file $; then
@@ -169,7 +169,7 @@ function copy_docs_for_current_version() {
169
169
done
170
170
COMMIT_CHANGES=" yes"
171
171
else
172
- echo -e " Branch [${CURRENT_BRANCH} ] is not on the white list! Check out the Maven [${WHITELIST_PROPERTY } ] property in
172
+ echo -e " Branch [${CURRENT_BRANCH} ] is not on the allow list! Check out the Maven [${ALLOW_PROPERTY } ] property in
173
173
[docs] module available under [docs] profile. Won't commit any changes to gh-pages for this branch."
174
174
fi
175
175
fi
@@ -250,10 +250,10 @@ the script will work in the following manner:
250
250
251
251
- if there's no gh-pages / target for docs module then the script ends
252
252
- for master branch the generated docs are copied to the root of gh-pages branch
253
- - for any other branch (if that branch is whitelisted ) a subfolder with branch name is created
253
+ - for any other branch (if that branch is allowed ) a subfolder with branch name is created
254
254
and docs are copied there
255
255
- if the version switch is passed (-v) then a tag with (v) prefix will be retrieved and a folder
256
- with that version number will be created in the gh-pages branch. WARNING! No whitelist verification will take place
256
+ with that version number will be created in the gh-pages branch. WARNING! No allow verification will take place
257
257
- if the destination switch is passed (-d) then the script will check if the provided dir is a git repo and then will
258
258
switch to gh-pages of that repo and copy the generated docs to ` docs/< project-name> /< version> `
259
259
- if the destination switch is passed (-d) then the script will check if the provided dir is a git repo and then will
@@ -327,4 +327,4 @@ build_docs_if_applicable
327
327
retrieve_doc_properties
328
328
stash_changes
329
329
add_docs_from_target
330
- checkout_previous_branch
330
+ checkout_previous_branch
0 commit comments