Skip to content

Commit

Permalink
chore(scripts) check requirements in the patch version release script…
Browse files Browse the repository at this point in the history
… and switch to use ssh based git URI
  • Loading branch information
javierguerragiraldez authored Feb 1, 2021
1 parent 409a357 commit 7a0579f
Showing 1 changed file with 32 additions and 9 deletions.
41 changes: 32 additions & 9 deletions scripts/make-patch-release
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,27 @@ function usage() {
exit 0
}

#-------------------------------------------------------------------------------
function need() {
req="$1"

if [ -z $(which "$req") ]; then
echo "Required command $req not found."
exit 1
fi
}

function check_requirements() {
need git
need hub
need sed

if [[ ! "$(sed --version)" =~ "GNU sed" ]]; then
echo "FAIL: sed command isn't GNU."
exit 1
fi
}

#-------------------------------------------------------------------------------
# Default help
#-------------------------------------------------------------------------------
Expand All @@ -51,6 +72,8 @@ fi
# Variables
#-------------------------------------------------------------------------------

check_requirements

version="$1"
step="$2"

Expand Down Expand Up @@ -173,7 +196,7 @@ case "$step" in
cd ../docs.konghq.com
else
cd ..
git clone https://github.com/kong/docs.konghq.com
git clone git@github.com:Kong/docs.konghq.com.git
cd docs.konghq.com
fi
git checkout master
Expand All @@ -183,7 +206,7 @@ case "$step" in

git diff

CONFIRM "If everything looks all right, press Enter to commit and send a PR to https://github.com/kong/docs.konghq.com" \
CONFIRM "If everything looks all right, press Enter to commit and send a PR to git@github.com:Kong/docs.konghq.com.git" \
"or Ctrl-C to cancel."

set -e
Expand Down Expand Up @@ -240,7 +263,7 @@ case "$step" in
cd ../docker-kong
else
cd ..
git clone https://github.com/kong/docker-kong
git clone git@github.com:Kong/docker-kong.git
cd docker-kong
fi

Expand All @@ -264,7 +287,7 @@ case "$step" in
cd ../docker-kong
else
cd ..
git clone https://github.com/kong/docker-kong
git clone git@github.com:Kong/docker-kong.git
cd docker-kong
fi

Expand All @@ -281,7 +304,7 @@ case "$step" in
cd ../homebrew-kong
else
cd ..
git clone https://github.com/kong/homebrew-kong
git clone git@github.com:Kong/homebrew-kong.git
cd homebrew-kong
fi

Expand All @@ -292,7 +315,7 @@ case "$step" in

git diff

CONFIRM "If everything looks all right, press Enter to commit and send a PR to https://github.com/kong/homebrew-kong" \
CONFIRM "If everything looks all right, press Enter to commit and send a PR to git@github.com:Kong/homebrew-kong" \
"or Ctrl-C to cancel."

set -e
Expand All @@ -311,7 +334,7 @@ case "$step" in
cd ../kong-pongo
else
cd ..
git clone https://github.com/kong/kong-pongo
git clone git@github.com:Kong/kong-pongo.git
cd kong-pongo
fi

Expand All @@ -330,7 +353,7 @@ case "$step" in
cd ../kong-vagrant
else
cd ..
git clone https://github.com/kong/kong-vagrant
git clone git@github.com:Kong/kong-vagrant.git
cd kong-vagrant
fi

Expand All @@ -341,7 +364,7 @@ case "$step" in

git diff

CONFIRM "If everything looks all right, press Enter to commit and send a PR to https://github.com/kong/kong-vagrant" \
CONFIRM "If everything looks all right, press Enter to commit and send a PR to git@github.com:Kong/kong-vagrant" \
"or Ctrl-C to cancel."

set -e
Expand Down

0 comments on commit 7a0579f

Please sign in to comment.