diff --git a/Jenkinsfile b/Jenkinsfile index 60b82ae..75f0eeb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -75,10 +75,12 @@ stage('Checkout Branch') { steps{ - sh ''' - cd /opt/workspace/coco_terraform_config/ - git checkout -b automatedSLOGeneration - ''' + def now = new Date() + def timestamp = now.format("yyMMdd.HHmm", TimeZone.getTimeZone('UTC')) + def branch = timestamp+"-automatedSLOGeneration" + dir("/opt/workspace/coco_terraform_config/") { + sh 'git checkout -b "${branch}"' + } } } @@ -117,13 +119,10 @@ stage('Create Pull Request') { steps { script { - def now = new Date() - timestamp = now.format("yyMMdd.HHmm", TimeZone.getTimeZone('UTC')) - dir("/opt/workspace/coco_terraform_config/") { sh 'git add .' - sh ('git commit -m "123"') - sh 'git push origin automatedSLOGeneration' + sh 'git commit -m "${timestamp}"' + sh 'git push origin ${branch}' } } }