From 51de5fbd643836c9bba626116f9df6d88ccb4ea6 Mon Sep 17 00:00:00 2001 From: Mason Packard Date: Fri, 2 Sep 2016 14:59:25 -0400 Subject: [PATCH] Add more resilent AWS credentials for jenkins pipline creds setup, using our levvel creds. --- Jenkinsfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index eb6a9ca..6de2506 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,6 +16,20 @@ if (BRANCH_TEST=="shibboleth-production"){ sh 'rm -rf builds' sh 'mkdir -p builds' + withCredentials([[$class: 'FileBinding', credentialsId: 'our-aws-config', variable: 'FILE']]) { + ws { + sh 'mkdir -p ~/.aws' + sh 'cp $FILE ~/.aws/config' + } + } + + withCredentials([[$class: 'FileBinding', credentialsId: 'our-aws-credentials', variable: 'FILE']]) { + ws { + sh 'mkdir -p ~/.aws' + sh 'cp $FILE ~/.aws/credentials' + } + } + stage 'Checkout' checkout scm @@ -63,6 +77,20 @@ if (BRANCH_TEST=="shibboleth-production"){ sh 'rm -rf builds' sh 'mkdir -p builds' + withCredentials([[$class: 'FileBinding', credentialsId: 'our-aws-config', variable: 'FILE']]) { + ws { + sh 'mkdir -p ~/.aws' + sh 'cp $FILE ~/.aws/config' + } + } + + withCredentials([[$class: 'FileBinding', credentialsId: 'our-aws-credentials', variable: 'FILE']]) { + ws { + sh 'mkdir -p ~/.aws' + sh 'cp $FILE ~/.aws/credentials' + } + } + stage 'Checkout' checkout scm