44
55# Set default props like MAVEN_PATH, ROOT_FOLDER etc.
66function set_default_props() {
7- # The script should be executed from the root folder
7+ # The script should be run from the root folder
88 ROOT_FOLDER=` pwd`
99 echo " Current folder is ${ROOT_FOLDER} "
1010
@@ -65,7 +65,7 @@ function build_docs_if_applicable() {
6565}
6666
6767# 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
6969function retrieve_doc_properties() {
7070 MAIN_ADOC_VALUE=$( " ${MAVEN_PATH} " mvn -q \
7171 -Dexec.executable=" echo" \
@@ -75,14 +75,14 @@ function retrieve_doc_properties() {
7575 echo " Extracted 'main.adoc' from Maven build [${MAIN_ADOC_VALUE} ]"
7676
7777
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 \
8080 -Dexec.executable=" echo" \
81- -Dexec.args=" \$ {${WHITELIST_PROPERTY } }" \
81+ -Dexec.args=" \$ {${ALLOW_PROPERTY } }" \
8282 org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \
8383 -P docs \
8484 -pl docs)
85- echo " Extracted '${WHITELIST_PROPERTY } ' from Maven build [${WHITELISTED_BRANCHES_VALUE } ]"
85+ echo " Extracted '${ALLOW_PROPERTY } ' from Maven build [${ALLOWED_BRANCHES_VALUE } ]"
8686}
8787
8888# Stash any outstanding changes
@@ -148,9 +148,9 @@ function copy_docs_for_current_version() {
148148 else
149149 echo -e " Current branch is [${CURRENT_BRANCH} ]"
150150 # 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
152152 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"
154154 for f in docs/target/generated-docs/* ; do
155155 file=${f# docs/ target/ generated-docs/* }
156156 if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file $; then
@@ -169,7 +169,7 @@ function copy_docs_for_current_version() {
169169 done
170170 COMMIT_CHANGES=" yes"
171171 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
173173 [docs] module available under [docs] profile. Won't commit any changes to gh-pages for this branch."
174174 fi
175175 fi
@@ -250,10 +250,10 @@ the script will work in the following manner:
250250
251251- if there's no gh-pages / target for docs module then the script ends
252252- 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
254254 and docs are copied there
255255- 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
257257- if the destination switch is passed (-d) then the script will check if the provided dir is a git repo and then will
258258 switch to gh-pages of that repo and copy the generated docs to ` docs/< project-name> /< version> `
259259- 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
327327retrieve_doc_properties
328328stash_changes
329329add_docs_from_target
330- checkout_previous_branch
330+ checkout_previous_branch
0 commit comments