diff --git a/Jenkinsfile b/Jenkinsfile index 15b9dec..fbc058e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,18 +61,26 @@ pipeline { } } stage('Deploy') { - script { - withCredentials([usernamePassword( - 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 }' - ''' + agent { + label 'main' + } + // when { + // branch 'main' + // } + steps { + script { + withCredentials([usernamePassword( + 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 }' + ''' } + } } } }