Getting Started with the Jenkins Plugin
It is recommended that you use the FlexDeploy and Jenkins plugins together to make your projects efficient. This way you can continue to build projects using Jenkins, and also use all of the features provided by FlexDeploy. Here we'll walk through a basic example of how to use these plugins to build a project with Jenkins, and then kick off a FlexDeploy workflow that will get the finished artifact and put it in the FlexDeploy Artifact Repository.
Jenkins Configuration
Installing the Plugin
To upload the plugin, connect to your Jenkins server and click "Manage Jenkins." Then choose "Manage Plugins."
From here, you can either go to the "Available" tab, and search for FlexDeploy. Be sure to select FlexDeploy plugin version 3.135. Select it with the check box next to it, and chose to either install now without restart, or wait until next server restart.
Â
If you don't see the FlexDeploy Plugin in the update center, you can still download it directly from here.
Â
After installing the plugin, you may need to restart the Jenkins server for the changes to take effect. Just check the box on the next screen if it says "Jenkins needs to be restarted for the update to take effect".
Configuring the Plugin to work with FlexDeploy
In your Jenkins project configuration, scroll down to the Post-Build Actions section, and click Add Post-Build Action.Â
Make sure that you place the Archive the artifacts step before the FlexDeploy plugin step so the plugin can find the proper artifacts.
Choose Trigger FlexDeploy Project from the menu.
Once you've added the Build FlexDeploy Project step, you should see a configuration page like this.
More input fields can be found under the Advanced...
dropdown button.
Full list of input fields can be found here: Jenkins
FlexDeploy Configuration
After uploading the FlexDeploy Jenkins Plugin to FlexDeploy, go to your Target configuration for the Environment and Target Group you plan to run this plugin in. You should see a page like this:
Jenkins URLÂ - The URL of the Jenkins server to connect to.
Jenkins Username - The username to connect to Jenkins as.
Jenkins Password - The password for the Jenkins User
Once your Target is configured, you're ready to use the Jenkins Plugin in a workflow. Create a new workflow for your project to use, and add the retrieveArtifacts
 step from the Jenkins Plugin.
Create a workflow input called inpBuildNumber.
Drag in the plugin step, change the input type to script, and enter the name of the input we just created.
Now, create the FlexDeploy project that Jenkins will execute. Once you choose the build workflow we just created, you should be able to see a project property called Jenkins Job Name. Enter the name of your Jenkins job/project here.
It's best practice to give the project in FlexDeploy the same name as the project in Jenkins. This way, we can simply use the FD_PROJECT_NAME
variable to minimize the potential for project misconfiguration.
Once you've configured the workflow and the project property, you should be set up to use a Jenkins artifact in FlexDeploy!
If you want to use FlexDeploy to deploy an artifact built in Jenkins, configure a deploy workflow to deploy an artifact from the FlexDeploy Artifact Repository. Then you can set up a Post Build Trigger on your FlexDeploy project, and choose the Environment and Branch Name that you're using from Jenkins.
Project Execution
Go to your Jenkins server where you configured a project using the FlexDeploy plugin.
Click Build Now and you should see the project start to execute.
Now go back to your FlexDeploy server and navigate to the project you set up to get an artifact from Jenkins. Once the Jenkins build is finished, you should see FlexDeploy start building the project.
From there you can use any of FlexDeploy's many plugins to deploy the artifacts.Â
- style