You may also use the mulitbranch pipeline plugin .
We recommend that you include ConfigMyApp into your existing Jenkins pipeline by adding a new stage, usually the last stage before the cleanup task.
We have created a Jenkinsfile
that can you easily adapt to suit your multi-stage CI/CD pipelines. The commands in the Jenkinsfile
will automatically download the latest copy of ConfigMyApp from GitHub.
Besides running the Jenkins job from your pipeline, various teams can also manage AppDynamics configurations from Jenkins UI (Using the Build with Parameters options) once deployed - as shown below:
Click “New Item” to create a new Jenkins job, and pick a “Freestyle” project from the list, and pick an appropriate name and add a description:
In job configuration, check the “This project is parameterized” checkbox in the “General” section to add environment variables as String variables:
Under “Source Code Management” tab specify the GitHub project:
In the “Build” tab, as a build step add “Execute shell” and execute the start.sh
script in a similar fashion as you would from the command line. Bear in mind that we defined environment variables in the previous step and you need to specify only additional runtime parameters that you may require:
In order to change any of the configurations, from the left-side menu inside of a project click “Configure”. To run a Jenkins job, pick “Build with Parameters”.
You are going to be prompted with environment variables defined that you can update prior to running a job. Click on the “Build”, and check the progress in build history and “Console output”.
An example of a Jenkins job definition can also be found in project source code:
integrations/Jenkins/JenkinsJobFile.xml