Changes following review

This commit is contained in:
Marcin Grzejszczak
2019-07-26 14:56:43 +02:00
parent 3f2eb50c74
commit fb4e94d07c
3 changed files with 31 additions and 27 deletions

View File

@@ -36,7 +36,7 @@ function git_with_remotes {
if [[ "$*" == *"set-url"* ]]; then
echo "git $*"
elif [[ "$*" == *"config remote.origin.url"* ]]; then
echo "git://foo.bar/baz.git"
echo "git://example1.example2/example3.git"
else
git $*
fi
@@ -56,7 +56,7 @@ function printing_git_failing_with_diff_index {
function printing_git_with_remotes {
if [[ "$*" == *"config remote.origin.url"* ]]; then
echo "git://foo.bar/baz.git"
echo "git://example1.example2/example3.git"
else
printing_git $*
fi
@@ -64,7 +64,7 @@ function printing_git_with_remotes {
function stubbed_git {
if [[ "$*" == *"config remote.origin.url"* ]]; then
echo "git://foo.bar/baz.git"
echo "git://example1.example2/example3.git"
elif [[ "$*" == *"diff-index"* ]]; then
return 1
elif [[ "$*" == *"symbolic-ref"* ]]; then
@@ -88,12 +88,12 @@ export -f stubbed_git
export RELEASER_GIT_OAUTH_TOKEN="mytoken"
cd "${TEMP_DIR}/spring-cloud-stream/"
mkdir -p docs/target/generated-docs/
touch docs/target/generated-docs/foo.html
touch docs/target/generated-docs/example1.html
run "${SOURCE_DIR}"/ghpages.sh
assert_success
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
assert_output --partial "git fetch -q"
assert_output --partial "git checkout master"
assert_output --partial "git stash"
@@ -102,7 +102,7 @@ export -f stubbed_git
# Current branch is master - will copy the current docs only to the root folder
assert_output --partial "git add -A ${TEMP_DIR}/spring-cloud-stream"
assert_output --partial "git commit -a -m Sync docs from master to gh-pages"
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
assert_output --partial "git push origin gh-pages"
assert_output --partial "git checkout master"
assert_output --partial "git stash pop"
@@ -117,12 +117,12 @@ export -f stubbed_git
cd "${TEMP_DIR}/spring-cloud-stream/"
mkdir -p docs/target/generated-docs/
touch docs/target/generated-docs/foo.html
touch docs/target/generated-docs/example1.html
run "${SOURCE_DIR}"/ghpages.sh
assert_success
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
assert_output --partial "git remote set-branches --add origin gh-pages"
assert_output --partial "git fetch -q"
# Previous branch was [master]
@@ -132,10 +132,10 @@ export -f stubbed_git
assert_output --partial "git checkout gh-pages"
assert_output --partial "git pull origin gh-pages"
# Current branch is master - will copy the current docs only to the root folder
assert [ -f "${TEMP_DIR}/spring-cloud-static/spring-cloud-stream/${VERSION}/foo.html" ]
assert [ -f "${TEMP_DIR}/spring-cloud-static/spring-cloud-stream/${VERSION}/example1.html" ]
assert_output --partial "git add -A ${TEMP_DIR}/spring-cloud-static/spring-cloud-stream/${VERSION}"
assert_output --partial "git commit -a -m Sync docs from v1.0.0.RELEASE to gh-pages"
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
assert_output --partial "git push origin gh-pages"
assert_output --partial "git checkout master"
assert_output --partial "git stash pop"
@@ -151,22 +151,22 @@ export -f stubbed_git
cd "${TEMP_DIR}/spring-cloud-stream/"
mkdir -p docs/target/generated-docs/
touch docs/target/generated-docs/foo.html
touch docs/target/generated-docs/example1.html
run "${SOURCE_DIR}"/ghpages.sh
assert_success
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
# Previous branch was [master]
assert_output --partial "git checkout master"
assert_output --partial "git stash"
assert_output --partial "git checkout gh-pages"
assert_output --partial "git pull origin gh-pages"
# Current branch is master - will copy the current docs only to the root folder
assert [ -f "${TEMP_DIR}/spring-cloud-static/${VERSION}/foo.html" ]
assert [ -f "${TEMP_DIR}/spring-cloud-static/${VERSION}/example1.html" ]
assert_output --partial "git add -A ${TEMP_DIR}/spring-cloud-static/${VERSION}"
assert_output --partial "git commit -a -m Sync docs from vGreenwich.SR2 to gh-pages"
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
assert_output --partial "git push origin gh-pages"
assert_output --partial "git checkout master"
assert_output --partial "git stash pop"
@@ -197,7 +197,7 @@ export -f stubbed_git
run add_oauth_token_to_remote_url
assert_success
assert_output --partial "git remote set-url --push origin https://foo.bar/baz.git"
assert_output --partial "git remote set-url --push origin https://example1.example2/example3.git"
}
@test "should add auth token to URL if token is present" {
@@ -210,7 +210,7 @@ export -f stubbed_git
run add_oauth_token_to_remote_url
assert_success
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
}
@test "should retrieve the name of the current branch" {
@@ -322,7 +322,7 @@ export -f stubbed_git
export CURRENT_BRANCH="master"
cd "${TEMP_DIR}/spring-cloud-stream/"
mkdir -p docs/target/generated-docs/
touch docs/target/generated-docs/foo.html
touch docs/target/generated-docs/example1.html
source "${SOURCE_DIR}"/ghpages.sh
@@ -339,7 +339,7 @@ export -f stubbed_git
cd "${TEMP_DIR}/spring-cloud-stream/"
mkdir -p docs/target/generated-docs/
touch docs/target/generated-docs/my_doc.html
touch docs/target/generated-docs/foo.html
touch docs/target/generated-docs/example1.html
source "${SOURCE_DIR}"/ghpages.sh
@@ -352,7 +352,7 @@ export -f stubbed_git
assert_success
assert_output --partial "add -A ${ROOT_FOLDER}/present/my_doc.html"
assert_output --partial "add -A ${ROOT_FOLDER}/present/foo.html"
assert_output --partial "add -A ${ROOT_FOLDER}/present/example1.html"
}
@test "should do nothing if current branch is not whitelisted" {
@@ -391,7 +391,7 @@ export -f stubbed_git
assert_success
assert_output --partial "git commit -a -m Sync docs from to gh-pages"
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
assert_output --partial "git push origin gh-pages"
}
@@ -407,7 +407,7 @@ export -f stubbed_git
assert_success
assert_output --partial "git commit -a -m Sync docs from to gh-pages"
assert_output --partial "git remote set-url --push origin https://username:password@foo.bar/baz.git"
assert_output --partial "git remote set-url --push origin https://username:password@example1.example2/example3.git"
assert_output --partial "git push origin gh-pages"
}

View File

@@ -33,7 +33,7 @@ function git_with_remotes {
if [[ "$*" == *"set-url"* ]]; then
echo "git $*"
elif [[ "$*" == *"config remote.origin.url"* ]]; then
echo "git://foo.bar/baz.git"
echo "git://example1.example2/example3.git"
else
git $*
fi
@@ -45,7 +45,7 @@ function printing_git {
function printing_git_with_remotes {
if [[ "$*" == *"config remote.origin.url"* ]]; then
echo "git://foo.bar/baz.git"
echo "git://example1.example2/example3.git"
else
printing_git $*
fi
@@ -53,7 +53,7 @@ function printing_git_with_remotes {
function stubbed_git {
if [[ "$*" == *"config remote.origin.url"* ]]; then
echo "git://foo.bar/baz.git"
echo "git://example1.example2/example3.git"
elif [[ "$*" == *"commit"* ]]; then
printing_git $*
elif [[ "$*" == *"push"* ]]; then
@@ -111,7 +111,7 @@ export -f stubbed_git
assert_success
# change remote
assert_output --partial "git remote set-url --push origin https://mytoken@foo.bar/baz.git"
assert_output --partial "git remote set-url --push origin https://mytoken@example1.example2/example3.git"
# commit and push
assert_output --partial "git commit -m Updating guides"
assert_output --partial "git push origin master"

View File

@@ -1024,6 +1024,12 @@
</resource>
</resources>
<attributes>
<docinfo>shared</docinfo>
<allow-uri-read>true</allow-uri-read>
<nofooter/>
<toc>left</toc>
<toc-levels>4</toc-levels>
<sectlinks>true</sectlinks>
<sources-root>${project.basedir}/src</sources-root>
<asciidoc-sources-root>${project.basedir}/src/main/asciidoc</asciidoc-sources-root>
<generated-resources-root>${project.basedir}/target/generated-resources
@@ -1038,8 +1044,6 @@
<index-link>${index-link}</index-link>
<!-- Spring Cloud specific -->
<allow-uri-read>true</allow-uri-read>
<nofooter/>
<project-version>${project.version}</project-version>
<github-tag>${github-tag}</github-tag>
<version-type>${version-type}</version-type>