git email/name are flexible for non-starkandwayne users

This commit is contained in:
Dr Nic Williams 2017-10-24 22:17:42 +10:00
parent f97791cc6e
commit 5327fd0507
2 changed files with 10 additions and 2 deletions

View File

@ -17,6 +17,10 @@ meta:
target: (( param "Please identify the name of the target Concourse CI" ))
url: (( param "Please specify the full url of the target Concourse CI" ))
git:
email: (( param "Please provide the git email for automated commits" ))
name: (( param "Please provide the git name for automated commits" ))
image:
name: starkandwayne/concourse-go
tag: 1.9
@ -207,6 +211,8 @@ jobs:
REPO_BRANCH: (( grab meta.github.branch ))
REPO_URL: (( concat "https://github.com/" meta.github.owner "/" meta.github.repo ))
NOTIFICATION_OUT: notifications
GIT_EMAIL: (( grab meta.git.email ))
GIT_NAME: (( grab meta.git.name ))
- name: upload-git
put: git

View File

@ -15,6 +15,8 @@
: ${NOTIFICATION_OUT:?required}
: ${REPO_BRANCH:?required}
: ${REPO_URL:?required}
: ${GIT_EMAIL:?required}
: ${GIT_NAME:?required}
if [[ ! -f ${VERSION_FROM} ]]; then
echo >&2 "Version file (${VERSION_FROM}) not found. Did you misconfigure Concourse?"
@ -60,10 +62,10 @@ EOF
# GIT!
if [[ -z $(git config --global user.email) ]]; then
git config --global user.email "ci@starkandwayne.com"
git config --global user.email "${GIT_EMAIL}"
fi
if [[ -z $(git config --global user.name) ]]; then
git config --global user.name "CI Bot"
git config --global user.name "${GIT_NAME}"
fi
(cd ${REPO_OUT}