@@ -4,7 +4,7 @@ set -e
|
|||||||
|
|
||||||
# Set default props like MAVEN_PATH, ROOT_FOLDER etc.
|
# Set default props like MAVEN_PATH, ROOT_FOLDER etc.
|
||||||
function set_default_props() {
|
function set_default_props() {
|
||||||
# The script should be executed from the root folder
|
# The script should be run from the root folder
|
||||||
ROOT_FOLDER=`pwd`
|
ROOT_FOLDER=`pwd`
|
||||||
echo "Current folder is ${ROOT_FOLDER}"
|
echo "Current folder is ${ROOT_FOLDER}"
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ function build_docs_if_applicable() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Get the name of the `docs.main` property
|
# Get the name of the `docs.main` property
|
||||||
# Get whitelisted branches - assumes that a `docs` module is available under `docs` profile
|
# Get allowed branches - assumes that a `docs` module is available under `docs` profile
|
||||||
function retrieve_doc_properties() {
|
function retrieve_doc_properties() {
|
||||||
MAIN_ADOC_VALUE=$("${MAVEN_PATH}"mvn -q \
|
MAIN_ADOC_VALUE=$("${MAVEN_PATH}"mvn -q \
|
||||||
-Dexec.executable="echo" \
|
-Dexec.executable="echo" \
|
||||||
@@ -75,14 +75,14 @@ function retrieve_doc_properties() {
|
|||||||
echo "Extracted 'main.adoc' from Maven build [${MAIN_ADOC_VALUE}]"
|
echo "Extracted 'main.adoc' from Maven build [${MAIN_ADOC_VALUE}]"
|
||||||
|
|
||||||
|
|
||||||
WHITELIST_PROPERTY=${WHITELIST_PROPERTY:-"docs.whitelisted.branches"}
|
ALLOW_PROPERTY=${ALLOW_PROPERTY:-"docs.allowed.branches"}
|
||||||
WHITELISTED_BRANCHES_VALUE=$("${MAVEN_PATH}"mvn -q \
|
ALLOWED_BRANCHES_VALUE=$("${MAVEN_PATH}"mvn -q \
|
||||||
-Dexec.executable="echo" \
|
-Dexec.executable="echo" \
|
||||||
-Dexec.args="\${${WHITELIST_PROPERTY}}" \
|
-Dexec.args="\${${ALLOW_PROPERTY}}" \
|
||||||
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \
|
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \
|
||||||
-P docs \
|
-P docs \
|
||||||
-pl docs)
|
-pl docs)
|
||||||
echo "Extracted '${WHITELIST_PROPERTY}' from Maven build [${WHITELISTED_BRANCHES_VALUE}]"
|
echo "Extracted '${ALLOW_PROPERTY}' from Maven build [${ALLOWED_BRANCHES_VALUE}]"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Stash any outstanding changes
|
# Stash any outstanding changes
|
||||||
@@ -148,9 +148,9 @@ function copy_docs_for_current_version() {
|
|||||||
else
|
else
|
||||||
echo -e "Current branch is [${CURRENT_BRANCH}]"
|
echo -e "Current branch is [${CURRENT_BRANCH}]"
|
||||||
# https://stackoverflow.com/questions/29300806/a-bash-script-to-check-if-a-string-is-present-in-a-comma-separated-list-of-strin
|
# https://stackoverflow.com/questions/29300806/a-bash-script-to-check-if-a-string-is-present-in-a-comma-separated-list-of-strin
|
||||||
if [[ ",${WHITELISTED_BRANCHES_VALUE}," = *",${CURRENT_BRANCH},"* ]] ; then
|
if [[ ",${ALLOWED_BRANCHES_VALUE}," = *",${CURRENT_BRANCH},"* ]] ; then
|
||||||
mkdir -p ${ROOT_FOLDER}/${CURRENT_BRANCH}
|
mkdir -p ${ROOT_FOLDER}/${CURRENT_BRANCH}
|
||||||
echo -e "Branch [${CURRENT_BRANCH}] is whitelisted! Will copy the current docs to the [${CURRENT_BRANCH}] folder"
|
echo -e "Branch [${CURRENT_BRANCH}] is allowed! Will copy the current docs to the [${CURRENT_BRANCH}] folder"
|
||||||
for f in docs/target/generated-docs/*; do
|
for f in docs/target/generated-docs/*; do
|
||||||
file=${f#docs/target/generated-docs/*}
|
file=${f#docs/target/generated-docs/*}
|
||||||
if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then
|
if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then
|
||||||
@@ -169,7 +169,7 @@ function copy_docs_for_current_version() {
|
|||||||
done
|
done
|
||||||
COMMIT_CHANGES="yes"
|
COMMIT_CHANGES="yes"
|
||||||
else
|
else
|
||||||
echo -e "Branch [${CURRENT_BRANCH}] is not on the white list! Check out the Maven [${WHITELIST_PROPERTY}] property in
|
echo -e "Branch [${CURRENT_BRANCH}] is not on the allow list! Check out the Maven [${ALLOW_PROPERTY}] property in
|
||||||
[docs] module available under [docs] profile. Won't commit any changes to gh-pages for this branch."
|
[docs] module available under [docs] profile. Won't commit any changes to gh-pages for this branch."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -250,10 +250,10 @@ the script will work in the following manner:
|
|||||||
|
|
||||||
- if there's no gh-pages / target for docs module then the script ends
|
- if there's no gh-pages / target for docs module then the script ends
|
||||||
- for master branch the generated docs are copied to the root of gh-pages branch
|
- for master branch the generated docs are copied to the root of gh-pages branch
|
||||||
- for any other branch (if that branch is whitelisted) a subfolder with branch name is created
|
- for any other branch (if that branch is allowed) a subfolder with branch name is created
|
||||||
and docs are copied there
|
and docs are copied there
|
||||||
- if the version switch is passed (-v) then a tag with (v) prefix will be retrieved and a folder
|
- if the version switch is passed (-v) then a tag with (v) prefix will be retrieved and a folder
|
||||||
with that version number will be created in the gh-pages branch. WARNING! No whitelist verification will take place
|
with that version number will be created in the gh-pages branch. WARNING! No allow verification will take place
|
||||||
- if the destination switch is passed (-d) then the script will check if the provided dir is a git repo and then will
|
- if the destination switch is passed (-d) then the script will check if the provided dir is a git repo and then will
|
||||||
switch to gh-pages of that repo and copy the generated docs to `docs/<project-name>/<version>`
|
switch to gh-pages of that repo and copy the generated docs to `docs/<project-name>/<version>`
|
||||||
- if the destination switch is passed (-d) then the script will check if the provided dir is a git repo and then will
|
- 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
|
|||||||
retrieve_doc_properties
|
retrieve_doc_properties
|
||||||
stash_changes
|
stash_changes
|
||||||
add_docs_from_target
|
add_docs_from_target
|
||||||
checkout_previous_branch
|
checkout_previous_branch
|
||||||
|
|||||||
@@ -98,14 +98,14 @@ No prefixing applies with these keys. What you set is literally what is used.
|
|||||||
A name set in either of these properties will result in a `BaggageField` of the same name.
|
A name set in either of these properties will result in a `BaggageField` of the same name.
|
||||||
|
|
||||||
In order to automatically set the baggage values to Slf4j's MDC, you have to set
|
In order to automatically set the baggage values to Slf4j's MDC, you have to set
|
||||||
the `spring.sleuth.baggage.correlation-fields` property with a list of whitelisted
|
the `spring.sleuth.baggage.correlation-fields` property with a list of allowed
|
||||||
local or remote keys. E.g. `spring.sleuth.baggage.correlation-fields=country-code` will set the
|
local or remote keys. E.g. `spring.sleuth.baggage.correlation-fields=country-code` will set the
|
||||||
value of the `country-code` baggage into MDC.
|
value of the `country-code` baggage into MDC.
|
||||||
|
|
||||||
IMPORTANT: Remember that adding entries to MDC can drastically decrease the performance of your application!
|
IMPORTANT: Remember that adding entries to MDC can drastically decrease the performance of your application!
|
||||||
|
|
||||||
If you want to add the baggage entries as tags, to make it possible to search for spans via the baggage entries, you can set the value of
|
If you want to add the baggage entries as tags, to make it possible to search for spans via the baggage entries, you can set the value of
|
||||||
`spring.sleuth.baggage.tag-fields` with a list of whitelisted baggage keys. To disable the feature you have to pass the `spring.sleuth.propagation.tag.enabled=false` property.
|
`spring.sleuth.baggage.tag-fields` with a list of allowed baggage keys. To disable the feature you have to pass the `spring.sleuth.propagation.tag.enabled=false` property.
|
||||||
|
|
||||||
=== Java configuration
|
=== Java configuration
|
||||||
|
|
||||||
@@ -1079,4 +1079,3 @@ Otherwise, your custom logback file does not properly read the property.
|
|||||||
== Configuration properties
|
== Configuration properties
|
||||||
|
|
||||||
To see the list of all Sleuth related configuration properties please check link:appendix.html[the Appendix page].
|
To see the list of all Sleuth related configuration properties please check link:appendix.html[the Appendix page].
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user