Browse Source

update jenkins pipeline

pull/50/head
Nicolas Massé 7 years ago
parent
commit
aa47dfbb6a
  1. 20
      support/jenkins/Jenkinsfile

20
support/jenkins/Jenkinsfile

@ -7,22 +7,21 @@
*/ */
pipeline { pipeline {
agent any agent { label 'ansible' }
parameters { parameters {
credentials(name: 'THREESCALE_CICD_ACCESS_TOKEN', description: 'The 3scale Access Token', credentialType: "Secret text", required: true) credentials(name: 'THREESCALE_CICD_ACCESS_TOKEN', description: 'The 3scale Access Token', credentialType: "Secret text", required: true)
credentials(name: 'THREESCALE_CICD_SSO_ISSUER_ENDPOINT', description: 'The SSO Issuer Endpoint when deploying an API with OpenID Connect', credentialType: "Secret text", required: false) credentials(name: 'THREESCALE_CICD_SSO_ISSUER_ENDPOINT', description: 'The SSO Issuer Endpoint when deploying an API with OpenID Connect', credentialType: "Secret text", required: false)
stringParam(name: 'THREESCALE_PORTAL_HOSTNAME', description: 'The 3scale Admin Portal hostname', required: true) string(name: 'THREESCALE_PORTAL_HOSTNAME', description: 'The 3scale Admin Portal hostname')
stringParam(name: 'GIT_REPOSITORY', description: 'The GIT repository to checkout, containing the OpenAPI Specifications', required: true) string(name: 'GIT_REPOSITORY', description: 'The GIT repository to checkout, containing the OpenAPI Specifications')
stringParam(name: 'GIT_BRANCH', description: 'The GIT branch or tag to checkout, containing the OpenAPI Specifications', defaultValue: 'master', required: true) string(name: 'GIT_BRANCH', description: 'The GIT branch or tag to checkout, containing the OpenAPI Specifications', defaultValue: 'master')
stringParam(name: 'OPENAPI_FILE', description: 'The path to the OpenAPI Specification within the GIT Repository', required: true) string(name: 'OPENAPI_FILE', description: 'The path to the OpenAPI Specification within the GIT Repository')
stringParam(name: 'THREESCALE_CICD_PRIVATE_BASE_URL', description: 'The 3scale private base URL', required: false) string(name: 'THREESCALE_CICD_PRIVATE_BASE_URL', description: 'The 3scale private base URL')
} }
node("ansible") { stages {
sh 'ansible --version'
stage("GIT Checkout") { stage("GIT Checkout") {
steps {
// Checkout the GIT repository containing the Ansible Playbook // Checkout the GIT repository containing the Ansible Playbook
checkout scm checkout scm
@ -34,8 +33,10 @@ pipeline {
submoduleCfg: [], submoduleCfg: [],
userRemoteConfigs: [[url: params.GIT_REPOSITORY]]]) userRemoteConfigs: [[url: params.GIT_REPOSITORY]]])
} }
}
stage("Deploy an API to 3scale") { stage("Deploy an API to 3scale") {
steps {
ansiColor('xterm') { ansiColor('xterm') {
withCredentials([ string(credentialsId: params.THREESCALE_CICD_ACCESS_TOKEN, variable: 'THREESCALE_CICD_ACCESS_TOKEN'), withCredentials([ string(credentialsId: params.THREESCALE_CICD_ACCESS_TOKEN, variable: 'THREESCALE_CICD_ACCESS_TOKEN'),
string(credentialsId: params.THREESCALE_CICD_SSO_ISSUER_ENDPOINT, variable: 'THREESCALE_CICD_SSO_ISSUER_ENDPOINT')]) { string(credentialsId: params.THREESCALE_CICD_SSO_ISSUER_ENDPOINT, variable: 'THREESCALE_CICD_SSO_ISSUER_ENDPOINT')]) {
@ -48,4 +49,5 @@ pipeline {
} }
} }
} }
}
} }
Loading…
Cancel
Save