mirror of https://github.com/apache/druid.git
new deploy script that automatically submits a pull request
This commit is contained in:
parent
91fc5fc82d
commit
8f615212a9
|
@ -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
|
||||
|
@ -28,20 +34,22 @@ branch=update-docs-$version
|
|||
|
||||
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<<EOF
|
||||
curl -u "$GIT_TOKEN:x-oauth-basic" -XPOST -d@- \
|
||||
https://api.github.com/repos/druid-io/druid-io.github.io/pulls <<EOF
|
||||
{
|
||||
"title" : "Update docs `$version`",
|
||||
"title" : "Update $version docs",
|
||||
"head" : "$branch",
|
||||
"base" : "master"
|
||||
}
|
||||
EOF
|
||||
|
||||
else
|
||||
echo "GitHub personal token not provided, not submitting pull request"
|
||||
echo "Please go to https://github.com/druid-io/druid-io.github.io and submit a pull request from the \`$branch\` branch"
|
||||
fi
|
||||
|
||||
#rm -rf ${tmp}
|
||||
rm -rf $tmp
|
||||
|
|
Loading…
Reference in New Issue