diff --git a/docs/_bin/deploy-docs.sh b/docs/_bin/deploy-docs.sh index 68193492653..592ab4ff378 100755 --- a/docs/_bin/deploy-docs.sh +++ b/docs/_bin/deploy-docs.sh @@ -6,6 +6,13 @@ else version=$1 fi +docs=$(git -C "$(dirname "$0")" rev-parse --show-toplevel)/docs + +if [ -n "$(git -C "$docs" status --porcelain --untracked-files=no content)" ]; then + echo "Docs directory is not clean, aborting" + exit 1 +fi + if [ -z "$(git tag -l "druid-$version")" ] && [ "$version" != "latest" ]; then echo "Version tag does not exist: druid-$version" exit 1; @@ -16,9 +23,8 @@ tmp=$(mktemp -d -t druid-docs-deploy) echo "Using Version [$version]" echo "Working directory [$tmp]" -git clone https://github.com/druid-io/druid-io.github.io.git "$tmp" +git clone git@github.com:druid-io/druid-io.github.io.git "$tmp" -docs=$(git -C$(dirname "$0") rev-parse --show-toplevel)/docs target=$tmp/docs/$version mkdir -p $target @@ -26,22 +32,24 @@ rsync -a --delete "$docs/content/" $target branch=update-docs-$version -git -C $tmp checkout -b $branch +git -C $tmp checkout -b $branch git -C $tmp add -A . -#git -C $tmp commit -m "Update $version docs" -#git -C $tmp push origin $branch +git -C $tmp commit -m "Update $version docs" +git -C $tmp push origin $branch if [ -n "$GIT_TOKEN" ]; then -curl -u "$GIT_TOKEN:x-oauth-basic" \ - -XPOST https://api.github.com/repos/druid-io/druid-io.github.io/pulls -d<