Skip to content

Instantly share code, notes, and snippets.

@dilunika
Last active August 7, 2018 11:20
Show Gist options
  • Save dilunika/4c3a10eac29039a617276f8602496e92 to your computer and use it in GitHub Desktop.
Save dilunika/4c3a10eac29039a617276f8602496e92 to your computer and use it in GitHub Desktop.
Jenkins stage issue
def sourceCodeBranch = params["SOURCE_BRANCH"]
def stage = params["DEPLOY_STAGE"]
def region = 'ap-southeast-2'
node {
stage('Checkout'){
git credentialsId: 'Github-xx',
branch: sourceCodeBranch
url: 'https://github.com/projectx/repox.git'
}
stage('Install Dependencies') {
sh 'npm install'
}
stage('Deploy') {
withCredentials([usernamePassword(credentialsId: 'DevDeployAgent', passwordVariable: 'accessKeySecret', usernameVariable: 'accessKeyId')]) {
sh "serverless config credentials --provider aws --key ${accessKeyId} --secret ${accessKeySecret}"
sh "sls deploy --stage ${stage} --region ${region}"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment