From c8c4dfba6e047e1abebb74477b5de2707f6d52fe Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Mon, 22 Aug 2016 13:32:23 +0200 Subject: [PATCH] Updating ghpages for all projects --- docs/src/main/asciidoc/ghpages.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/src/main/asciidoc/ghpages.sh b/docs/src/main/asciidoc/ghpages.sh index 6a6363ba..57c5da3a 100755 --- a/docs/src/main/asciidoc/ghpages.sh +++ b/docs/src/main/asciidoc/ghpages.sh @@ -32,7 +32,7 @@ function check_if_anything_to_sync() { exit 0 fi - if ! [ -d docs/target/generated-docs ]; then + if ! [ -d docs/target/generated-docs ] && ! [ "${BUILD}" == "yes" ]; then echo "No gh-pages sources in docs/target/generated-docs, so not syncing" exit 0 fi @@ -101,12 +101,13 @@ function add_docs_from_target() { local clonedStatic=${ROOT_FOLDER}/target/spring-cloud-static if [[ ! -e "${clonedStatic}/.git" ]]; then echo "Cloning Spring Cloud Static to target" - git clone ${SPRING_CLOUD_STATIC_REPO} ${clonedStatic} + git clone ${SPRING_CLOUD_STATIC_REPO} ${clonedStatic} && git checkout gh-pages else echo "Spring Cloud Static already cloned - will pull changes" cd ${clonedStatic} && git checkout gh-pages && git pull origin gh-pages fi DESTINATION_REPO_FOLDER=${clonedStatic}/${REPO_NAME} + mkdir -p ${DESTINATION_REPO_FOLDER} else if [[ ! -e "${DESTINATION}/.git" ]]; then echo "[${DESTINATION}] is not a git repository"