-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#147541559] Allow setting Git username and email address in all publ…
…ic tasks Signed-off-by: Chunyi Lyu <[email protected]>
- Loading branch information
Showing
9 changed files
with
58 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
#!/bin/bash -xeu | ||
|
||
# shellcheck disable=SC1091 | ||
source cf-deployment-concourse-tasks/shared-functions | ||
|
||
function commit_bbl_state_file { | ||
local root_dir | ||
root_dir="${1}" | ||
|
||
pushd "${root_dir}/bbl-state/${BBL_STATE_DIR}" | ||
if [[ -n $(git status --porcelain) ]]; then | ||
git config user.name "CI Bot" | ||
git config user.email "[email protected]" | ||
set_git_config | ||
git add --all bbl-state.json | ||
git commit -m "Remove bbl-state.json" | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,9 @@ params: | |
# - Path to the directory containing the `bbl-state.json` file | ||
# - The path is relative to root of the `bbl-state` input | ||
# - If unspecified, uses the root of the `bbl-state` input | ||
|
||
GIT_COMMIT_EMAIL: | ||
GIT_COMMIT_USERNAME: | ||
# - Optional | ||
# - You may choose the git committer username and email address by setting these | ||
# - If you leave them blank, they are set to 'CI Bot' and '[email protected]', respectively |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
#!/bin/bash -xeu | ||
|
||
# shellcheck disable=SC1091 | ||
source cf-deployment-concourse-tasks/shared-functions | ||
|
||
function check_fast_fails() { | ||
set +x | ||
if [ -z "${LB_DOMAIN}" -a "${BBL_IAAS}" == "gcp" ]; then | ||
|
@@ -29,8 +32,7 @@ function commit_bbl_state_file { | |
|
||
pushd "${root_dir}/bbl-state/${BBL_STATE_DIR}" | ||
if [[ -n $(git status --porcelain) ]]; then | ||
git config user.name "CI Bot" | ||
git config user.email "[email protected]" | ||
set_git_config | ||
git add bbl-state.json | ||
git commit -m "Update bbl-state.json" | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,3 +71,9 @@ params: | |
# - Optional | ||
# - A label to apply to the bbl environment | ||
# - Label will appear in the IaaS metadata/interface | ||
|
||
GIT_COMMIT_EMAIL: | ||
GIT_COMMIT_USERNAME: | ||
# - Optional | ||
# - You may choose the git committer username and email address by setting these | ||
# - If you leave them blank, they are set to 'CI Bot' and '[email protected]', respectively |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,3 +70,9 @@ params: | |
# - This is helpful for testing changes around variable generation | ||
# - Works well with fresh deployments | ||
# - Upgrade deployments are not expected to work with total cred rotation | ||
|
||
GIT_COMMIT_EMAIL: | ||
GIT_COMMIT_USERNAME: | ||
# - Optional | ||
# - You may choose the git committer username and email address by setting these | ||
# - If you leave them blank, they are set to 'CI Bot' and '[email protected]', respectively |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,3 +67,9 @@ params: | |
# - This is helpful for testing changes around variable generation | ||
# - Works well with fresh deployments | ||
# - Upgrade deployments are not expected to work with total cred rotation | ||
|
||
GIT_COMMIT_EMAIL: | ||
GIT_COMMIT_USERNAME: | ||
# - Optional | ||
# - You may choose the git committer username and email address by setting these | ||
# - If you leave them blank, they are set to 'CI Bot' and '[email protected]', respectively |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,11 +19,23 @@ function check_input_params() { | |
set -x | ||
} | ||
|
||
function commit_vars_store { | ||
function set_git_config() { | ||
if [ -z "${GIT_COMMIT_USERNAME}" ]; then | ||
GIT_COMMIT_USERNAME="CI Bot" | ||
fi | ||
|
||
if [ -z "${GIT_COMMIT_EMAIL}" ]; then | ||
GIT_COMMIT_EMAIL="[email protected]" | ||
fi | ||
|
||
git config user.name "${GIT_COMMIT_USERNAME}" | ||
git config user.email "${GIT_COMMIT_EMAIL}" | ||
} | ||
|
||
function commit_vars_store() { | ||
pushd vars-store | ||
if [[ -n $(git status --porcelain) ]]; then | ||
git config user.name "CI Bot" | ||
git config user.email "[email protected]" | ||
set_git_config | ||
git add "${VARS_STORE_FILE}" | ||
git commit -m "Update vars-store after deploy" | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
#!/bin/bash -eu | ||
set -o pipefail | ||
|
||
# shellcheck disable=SC1091 | ||
source cf-deployment-concourse-tasks/shared-functions | ||
|
||
function check_fast_fails() { | ||
if [ -z "$VARS_STORE_FILE" ]; then | ||
echo "VARS_STORE_FILE has not been set" | ||
|
@@ -18,8 +21,7 @@ function commit_integration_configs { | |
set -x | ||
pushd integration-configs | ||
if [[ -n $(git status --porcelain) ]]; then | ||
git config user.name "CI Bot" | ||
git config user.email "[email protected]" | ||
set_git_config | ||
|
||
if [ -f "${CATS_INTEGRATION_CONFIG_FILE}" ]; then | ||
git add "${CATS_INTEGRATION_CONFIG_FILE}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,10 @@ params: | |
# - Optional | ||
# - CF system base domain e.g. `my-cf.com` | ||
# - Should match the value passed to `bosh-deploy` | ||
|
||
GIT_COMMIT_EMAIL: | ||
GIT_COMMIT_USERNAME: | ||
# - Optional | ||
# - You may choose the git committer username and email address by setting these | ||
# - If you leave them blank, they are set to 'CI Bot' and '[email protected]', respectively | ||
|