Fix
Apps/everybody-mov/pipeline/head There was a failure building this commit Details

This commit is contained in:
Amber McCloughan 2022-09-04 00:51:48 -04:00
parent 6d2169d0d4
commit 6a113699ad
1 changed files with 19 additions and 11 deletions

30
Jenkinsfile vendored
View File

@ -61,18 +61,26 @@ pipeline {
} }
} }
stage('Deploy') { stage('Deploy') {
script { agent {
withCredentials([usernamePassword( label 'main'
credentialsId: env.CREDENTIALS_ID, }
usernameVariable: 'API_TOKEN_USER', // when {
passwordVariable: 'API_TOKEN_PASS' // branch 'main'
)]) { // }
sh ''' steps {
curl -H 'Authorization: Bearer $API_TOKEN_PASS' -H 'Content-Type: application/json' \ script {
-X POST 'https://api.digitalocean.com/v2/apps/$APP_ID/deployments' withCredentials([usernamePassword(
-d '{ "force_build" : true }' credentialsId: env.CREDENTIALS_ID,
''' usernameVariable: 'API_TOKEN_USER',
passwordVariable: 'API_TOKEN_PASS'
)]) {
sh '''
curl -H 'Authorization: Bearer $API_TOKEN_PASS' -H 'Content-Type: application/json' \
-X POST 'https://api.digitalocean.com/v2/apps/$APP_ID/deployments'
-d '{ "force_build" : true }'
'''
} }
}
} }
} }
} }