Skip to content

Commit

Permalink
ci: set git user configuration if it is not set (elastic#17782)
Browse files Browse the repository at this point in the history
* ci: set git user configuration if it is not set

* Apply suggestions from code review
  • Loading branch information
kuisathaverat authored Apr 17, 2020
1 parent 2413095 commit b3576ca
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,9 @@ def withBeatsEnv(boolean archive, Closure body) {
sh(label: "Install Go ${GO_VERSION}", script: ".ci/scripts/install-go.sh")
sh(label: "Install docker-compose ${DOCKER_COMPOSE_VERSION}", script: ".ci/scripts/install-docker-compose.sh")
sh(label: "Install Mage", script: "make mage")
// TODO (2020-04-07): This is a work-around to fix the Beat generator tests.
// See https://github.com/elastic/beats/issues/17787.
setGitConfig()
try {
if(!params.dry_run){
body()
Expand Down Expand Up @@ -955,3 +958,12 @@ def getVendorPatterns(beatName){
}
return output?.split('\n').collect{ item -> item as String }
}

def setGitConfig(){
sh(label: 'check git config', script: '''
if [ -z "$(git config --get user.email)" ]; then
git config user.email "beatsmachine@users.noreply.github.com"
git config user.name "beatsmachine"
fi
''')
}

0 comments on commit b3576ca

Please sign in to comment.