The repository contains job definitions using Jenkins Job Dsl plugin.
Check out the tutorial. Provide the link to this repository in your Jenkins installation.
The seed job for Spring Cloud should scan the jobs/springcloud/*.groovy
files.
Remember to add src/main/groovy
and src/main/resources
for processing
Warning
|
Remember that views can be overridden that’s why the suggestion is to contain in one script all the logic needed to build a view
for a single project (check out that spring_cloud_views.groovy is building all the spring-cloud views).
|
If your job is a standard Spring Cloud job that:
-
can be built via
./mvnw clean install
and deployed with./mvnw clean deploy
-
has docs under
docs
and those docs can be built via./mvnw clean install -Pdocs
-
is using
spring-cloud-build
thanks to which boot version is parametrized -
the job resides under the
spring-cloud
organization
you can just go to org.springframework.jenkins.cloud.common.AllCloudJobs
and add the name
of the repo to ALL_JOBS
list. That way the default CI jobs and views will be created for
the main branch.
If your job needs to be building other branches except for main just add your proper
entries to the JOBS_WITH_BRANCHES
map in org.springframework.jenkins.cloud.common.AllCloudJobs
.
If you have some custom builds just add the entry to ALL_JOBS
and CUSTOM_BUILD_JOBS
.
Next you should just create your own implementation (check org.springframework.jenkins.cloud.ci.SpringCloudNetflixDeployBuildMaker
for an example). Remember also to call it from the seed job (e.g. springcloud/spring_cloud.groovy:29
for Netflix).
The views are automatically generated for you. They base on the name convention so check out
springcloud/spring_cloud_views.groovy
- it’s pretty straightforward.
There’s nothing that you have to do. If you’ve added the newest branch under JOBS_WITH_BRANCHES
the project automatically takes the latest branch version and reuses it as point of entry for
JOBS_WITH_BRANCHES_FOR_COMPATIBILITY_BUILD
.
Just modify the default properties file contents here AllCloudConstants.DEFAULT_RELEASER_PROPERTIES_FILE_CONTENT
Just run
docker-compose up -d
and your jenkins with plugins present in plugins.txt
will be ready at port 8080.
In order to download the latest plugins:
1) Open in your browser
http://$JENKINS_HOST/pluginManager/api/xml?depth=1&xpath=/*/*/shortName|/*/*/version&wrapper=plugins
2) Store the XML to a file
3) Pipe the contents of the file to this command:
perl -pe 's/.*?<shortName>([\w-]+).*?<version>([^<]+)()(<\/\w+>)+/\1 \2\n/g'|sed 's/ /:/'
4) Store it as plugins.txt
Wait patiently for Jenkins to start - the job will be added automatically for you.
Important
|
We’re using the JMH Jenkins plugin which is not available anywhere in the marketplace. We’re trying to automate its installation but if it fails you can download the HPI from here and upload it yourself. The tag is in the forked repo over here |
You have to provide the following values/plugin configuration for your Jenkins to make everything work:
Property Name/Plugin name | Description |
---|---|
CF_USERNAME |
The name of the Cloud Foundry user that access the Spring Cloud e2e space |
CF_PASSWORD |
The password for the Cloud Foundry user that access the Spring Cloud e2e space |
CF_SPACE |
The name of the space in Cloud Foundry that has e2e tests |
Git plugin |
You have to provide the username and email for the user that access artifactory |
Global Slack Notifier |
Provide team / integration token values to notify Slack |
Cloud plugin |
Provide values for Cloud so that jobs labeled for aws execution would work |
Cloud plugin |
The instances have to have proper values for JDK / JAVA_HOME |
Artifactory.DEFAULT_ARTIFACTORY_NAME |
The id of the Artifactory Repo is hardcoded in |
Maven Trait |
The trait Maven contains references to org.springframework.jenkins.common.job.Maven installations. You have to have your Jenkins Maven installations correspond to those entries. |
Also it’s required to have Maven settings allowing you to push to artifactory.