This topic provides the steps for integrating Spring Application Advisor with your CI/CD pipelines in Jenkins.

First of all, before integrating Spring Application Advisor, you should check if Jenkins is configured to use the Spring commercial repository in a shared Maven settings.xml file.

We recommend to follow the CloudBees official guide in case you want to know the details about how to provide a shared Maven settings file.

We also recommend to check Running commercial recipes using OpenRewrite tools if you want to see a working Maven settings.xml file to connect to the Spring commercial repository

Using Pipeline Templates

In Jenkins, Pipeline Templates help ensure that pipeline builds conform to organizational standards. Central or platform teams can create their own standard using a Pipeline Template. For information about how pipeline templates work, refer to the CloudBees documentation.

  • If you are already using CloudBees Pipeline Templates, you can adapt the existing template to include the Spring Application Advisor CLI commands. For example:

    pipeline {
        agent any
    
        environment {
        ADVISOR_SERVER = 'http://advisor.acme.com'
        GIT_TOKEN_FOR_PRS = credentials('advisor_git_token_for_prs')
        }
        stages {
            stage(my-stage) {
                steps {
                    …
                }
            }
            …
            stage('spring-app-advisor') {
                steps {
                    sh 'advisor build-config get'
                    sh 'advisor build-config publish --url=$ADVISOR_SERVER'
                    sh 'advisor upgrade-plan apply --push --from-yml –-url=$ADVISOR_SERVER' --token=$GIT_TOKEN_FOR_PRS
                }
            }
    }
    }
    
  • If you are not using a CloudBees Pipeline Template, create a new Template, and then create a new job for each of the repositories.

check-circle-line exclamation-circle-line close-line
Scroll to top icon