Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 1.00 KB | None | 0 0
  1. Asta era inainte, si am facut split la astea
  2.  
  3.  
  4.  
  5.  
  6. def updateVersions() {
  7.     assert params.DEV_BRANCH_TAG_COMMIT?.trim() : 'Branch should not be empty'
  8.     println 'Resolving versions from AWS s3'
  9.     // Assumes that the prior step to setup the AWS credentials has completed successfully
  10.     // TODO: Remove update-versions.sh so that we dont have to checkout the dev repo every time - hybris currently still needs it.
  11.     sh """
  12.    env_name=${jenkinsEnv}
  13.    source ./terraform-helper-functions.sh
  14.    source ./update-versions.sh ${params.DEV_BRANCH_TAG_COMMIT}
  15.    resolve_versions_yml ${params.DEV_BRANCH_TAG_COMMIT}
  16.    """
  17. }
  18.  
  19. def setupAwsCredentials() {
  20.     jenkinsEnv = sh script: 'hostname | egrep -o "(qa|test|prd)"', returnStdout: true
  21.  
  22.     if (jenkinsEnv.contains("prd")) {
  23.         jenkinsEnv = 'prod-mgmt'
  24.     } else {
  25.         jenkinsEnv = jenkinsEnv.trim() + '_mgmt'
  26.     }
  27.  
  28.     sh script: "ansible-playbook aws_credentials.yml -i inventory/ec2_groups --extra-vars env_name=${jenkinsEnv}"
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement