A Jenkins plugin that invokes a cloudify custom command with parameters related to the build
The example depend on other plugins:
- archive plugin help archiving WAR
- S3 plugin to publish WAR file to external storage.
The recipes
directory include a simple application artifact.zip
, this application include custom command named downloadFromS3
. extract the artifact.zip
application to <cloudify install dir>/recipes/apps
then install install artifact
application install-application artifact
- clone plugin source
git clone https://github.com/CloudifySource/jenkins-plugin.git
- from command line navigate to the
<workspace>/jenkins-plugin/cloudify-jenkins
- run
mvn
will generate package<workspace>/jenkins-plugin/cloudify-jenkins/target/cloudify-jenkins.hpi
- open jenkins management in browser
http://<your server address>/jenkins
- click
Manage Jenkins
link at the left pane - click
Manage Plugins
link - click on
Advanced
tab - under "Upload Plugin" section click
Choose file
button then clickUpload
button - wait while an installation is done
- verify that the plugin is presented in the
Installed
tab
Note: for this sample we will use S3 as extenal storage to keep the generated war so, to install S3
- click the
Available
tab at the Plugin manager- type at the filter form
S3
- check
S3 plugin
and clickinstall without restart
button
-
Go to the jenkins start page and create
new job
of typeBuild a maven2/3 project
- after installing S3 plugin successfully will add configuration section at
Manage Jenkins > Configure System
- fill profile fields under the Amazon S3 profiles
- click the job name link and then click
Configure
at the left pane - scroll to
Post-build Actions
section add the following actions by selecting from theAdd post-build action
Note: important to select actions at the following order:
- select
Archive the artifacts
- select
Publish artifacts to S3 Bucket
- select
Cloudify custom command invoker