Skip to content

Commit b5f42b9

Browse files
committed
parameterize gitHost in git_push
1 parent 29e6442 commit b5f42b9

40 files changed

+433
-192
lines changed

modules/openapi-generator/src/main/resources/Java/git_push.sh.mustache

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/bin/sh
22
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
33
#
4-
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
4+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
55

66
git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
9+
git_host=$4
10+
11+
if [ "$git_host" = "" ]; then
12+
git_host="{{{gitHost}}}"
13+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14+
fi
915

1016
if [ "$git_user_id" = "" ]; then
1117
git_user_id="{{{gitUserId}}}"
@@ -28,7 +34,7 @@ git init
2834
# Adds the files in the local repository and stages them for commit.
2935
git add .
3036

31-
# Commits the tracked changes and prepares them to be pushed to a remote repository.
37+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
3238
git commit -m "$release_note"
3339

3440
# Sets the new remote
@@ -37,16 +43,16 @@ if [ "$git_remote" = "" ]; then # git remote not defined
3743

3844
if [ "$GIT_TOKEN" = "" ]; then
3945
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
40-
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
46+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
4147
else
42-
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
48+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
4349
fi
4450

4551
fi
4652

4753
git pull origin master
4854

4955
# Pushes (Forces) the changes in the local repository up to the remote repository
50-
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
56+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
5157
git push origin master 2>&1 | grep -v 'To https'
5258

modules/openapi-generator/src/main/resources/Javascript/es6/git_push.sh.mustache

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/bin/sh
22
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
33
#
4-
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
4+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
55

66
git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
9+
git_host=$4
10+
11+
if [ "$git_host" = "" ]; then
12+
git_host="{{{gitHost}}}"
13+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14+
fi
915

1016
if [ "$git_user_id" = "" ]; then
1117
git_user_id="{{{gitUserId}}}"
@@ -28,25 +34,25 @@ git init
2834
# Adds the files in the local repository and stages them for commit.
2935
git add .
3036

31-
# Commits the tracked changes and prepares them to be pushed to a remote repository.
37+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
3238
git commit -m "$release_note"
3339

3440
# Sets the new remote
3541
git_remote=`git remote`
3642
if [ "$git_remote" = "" ]; then # git remote not defined
3743

3844
if [ "$GIT_TOKEN" = "" ]; then
39-
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the Git credential in your environment."
40-
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
45+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
46+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
4147
else
42-
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
48+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
4349
fi
4450

4551
fi
4652

4753
git pull origin master
4854

4955
# Pushes (Forces) the changes in the local repository up to the remote repository
50-
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
56+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
5157
git push origin master 2>&1 | grep -v 'To https'
5258

modules/openapi-generator/src/main/resources/Javascript/git_push.sh.mustache

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/bin/sh
22
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
33
#
4-
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
4+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
55

66
git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
9+
git_host=$4
10+
11+
if [ "$git_host" = "" ]; then
12+
git_host="{{{gitHost}}}"
13+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14+
fi
915

1016
if [ "$git_user_id" = "" ]; then
1117
git_user_id="{{{gitUserId}}}"
@@ -28,25 +34,25 @@ git init
2834
# Adds the files in the local repository and stages them for commit.
2935
git add .
3036

31-
# Commits the tracked changes and prepares them to be pushed to a remote repository.
37+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
3238
git commit -m "$release_note"
3339

3440
# Sets the new remote
3541
git_remote=`git remote`
3642
if [ "$git_remote" = "" ]; then # git remote not defined
3743

3844
if [ "$GIT_TOKEN" = "" ]; then
39-
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the Git credential in your environment."
40-
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
45+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
46+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
4147
else
42-
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
48+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
4349
fi
4450

4551
fi
4652

4753
git pull origin master
4854

4955
# Pushes (Forces) the changes in the local repository up to the remote repository
50-
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
56+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
5157
git push origin master 2>&1 | grep -v 'To https'
5258

modules/openapi-generator/src/main/resources/android/git_push.sh.mustache

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/bin/sh
22
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
33
#
4-
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
4+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
55

66
git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
9+
git_host=$4
10+
11+
if [ "$git_host" = "" ]; then
12+
git_host="{{{gitHost}}}"
13+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14+
fi
915

1016
if [ "$git_user_id" = "" ]; then
1117
git_user_id="{{{gitUserId}}}"
@@ -37,16 +43,16 @@ if [ "$git_remote" = "" ]; then # git remote not defined
3743

3844
if [ "$GIT_TOKEN" = "" ]; then
3945
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
40-
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
46+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
4147
else
42-
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
48+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
4349
fi
4450

4551
fi
4652

4753
git pull origin master
4854

4955
# Pushes (Forces) the changes in the local repository up to the remote repository
50-
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
56+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
5157
git push origin master 2>&1 | grep -v 'To https'
5258

modules/openapi-generator/src/main/resources/android/libraries/volley/git_push.sh.mustache

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/bin/sh
22
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
33
#
4-
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
4+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
55

66
git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
9+
git_host=$4
10+
11+
if [ "$git_host" = "" ]; then
12+
git_host="{{{gitHost}}}"
13+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14+
fi
915

1016
if [ "$git_user_id" = "" ]; then
1117
git_user_id="{{{gitUserId}}}"
@@ -37,15 +43,16 @@ if [ "$git_remote" = "" ]; then # git remote not defined
3743

3844
if [ "$GIT_TOKEN" = "" ]; then
3945
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
40-
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
46+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
4147
else
42-
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
48+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
4349
fi
4450

4551
fi
4652

4753
git pull origin master
4854

4955
# Pushes (Forces) the changes in the local repository up to the remote repository
50-
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
56+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
5157
git push origin master 2>&1 | grep -v 'To https'
58+

modules/openapi-generator/src/main/resources/apex/git_push.sh.mustache

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/bin/sh
22
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
33
#
4-
# Usage example: /bin/sh ./git_push.sh wing328 OAS-petstore-perl "minor update"
4+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
55

66
git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
9+
git_host=$4
10+
11+
if [ "$git_host" = "" ]; then
12+
git_host="{{{gitHost}}}"
13+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14+
fi
915

1016
if [ "$git_user_id" = "" ]; then
1117
git_user_id="{{{gitUserId}}}"
@@ -28,25 +34,25 @@ git init
2834
# Adds the files in the local repository and stages them for commit.
2935
git add .
3036

31-
# Commits the tracked changes and prepares them to be pushed to a remote repository.
37+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
3238
git commit -m "$release_note"
3339

3440
# Sets the new remote
3541
git_remote=`git remote`
3642
if [ "$git_remote" = "" ]; then # git remote not defined
3743

3844
if [ "$GIT_TOKEN" = "" ]; then
39-
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
40-
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
45+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
46+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
4147
else
42-
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
48+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
4349
fi
4450

4551
fi
4652

4753
git pull origin master
4854

4955
# Pushes (Forces) the changes in the local repository up to the remote repository
50-
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
56+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
5157
git push origin master 2>&1 | grep -v 'To https'
5258

modules/openapi-generator/src/main/resources/clojure/git_push.sh.mustache

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/bin/sh
22
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
33
#
4-
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
4+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
55

66
git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
9+
git_host=$4
10+
11+
if [ "$git_host" = "" ]; then
12+
git_host="{{{gitHost}}}"
13+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14+
fi
915

1016
if [ "$git_user_id" = "" ]; then
1117
git_user_id="{{{gitUserId}}}"
@@ -28,7 +34,7 @@ git init
2834
# Adds the files in the local repository and stages them for commit.
2935
git add .
3036

31-
# Commits the tracked changes and prepares them to be pushed to a remote repository.
37+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
3238
git commit -m "$release_note"
3339

3440
# Sets the new remote
@@ -37,16 +43,16 @@ if [ "$git_remote" = "" ]; then # git remote not defined
3743

3844
if [ "$GIT_TOKEN" = "" ]; then
3945
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
40-
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
46+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
4147
else
42-
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
48+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
4349
fi
4450

4551
fi
4652

4753
git pull origin master
4854

4955
# Pushes (Forces) the changes in the local repository up to the remote repository
50-
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
56+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
5157
git push origin master 2>&1 | grep -v 'To https'
5258

modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/git_push.sh.mustache

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/bin/sh
22
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
33
#
4-
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-cpprest "minor update"
4+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
55

66
git_user_id=$1
77
git_repo_id=$2
88
release_note=$3
9+
git_host=$4
10+
11+
if [ "$git_host" = "" ]; then
12+
git_host="{{{gitHost}}}"
13+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14+
fi
915

1016
if [ "$git_user_id" = "" ]; then
1117
git_user_id="{{{gitUserId}}}"
@@ -37,15 +43,16 @@ if [ "$git_remote" = "" ]; then # git remote not defined
3743

3844
if [ "$GIT_TOKEN" = "" ]; then
3945
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
40-
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
46+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
4147
else
42-
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
48+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
4349
fi
4450

4551
fi
4652

4753
git pull origin master
4854

4955
# Pushes (Forces) the changes in the local repository up to the remote repository
50-
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
56+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
5157
git push origin master 2>&1 | grep -v 'To https'
58+

0 commit comments

Comments
 (0)