Name: ascent-jenkins-lib
Owner: Department of Veterans Affairs
Description: null
Created: 2017-10-16 15:24:46.0
Updated: 2018-05-16 16:39:12.0
Pushed: 2018-05-16 16:39:10.0
Homepage: null
Size: 1527
Language: Groovy
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Shared Library for Jenkins Pipelines
On your Sonar server you will need to install the following plugins:
On your Master Jenkins server you will need to install the following plugins:
The following credentials will need to be setup in Jenkins:
| Credential ID | Credential Type | Notes | ————- | ————- | ————– | | nexus | username/password | | | docker-repository | username/password | | | aws | username/password | The username should be your ACCESS_ID and the password is the SECRET_KEY value |
Open the /configure
url for your Jenkins Master server and add the following Global Properties:
DOCKER_HOST
Value: URL for your Docker Host (ex. tcp://docker.test.com:2375)
DOCKER_REPOSITORY_URL
Value: URL for your Docker Repository (ex. https://index.docker.io/v1/)
CI_DOCKER_SWARM_MANAGER
Value: URL for a Docker Swarm manager in the CI environment (ex. tcp://manager.test.com:2375)
VAULT_ADDR
Value: URL for the Vault server
As are prequiste for configuring Sonar integration, you will need to create an access token that Jenkins can use to authenticate with Sonar. To do this following these steps:
Setup a Webhook to call back Jenkins when the scan is complete. See SonarQube Plugin for more information.
Open the /configure
url for your Jenkins Master server and in the SonarQube section:
CI
Your Sonar server URL
In order to use this library you will need to configure it as a Global Library within Jenkins.
To use this shared library you will need to reference it from the Jenkinsfile in your source code repository. This can be done by adding the following line to the beginning of your Jenkinsfile. In this example the name given to the shared library is ascent
, change this value to match the name you gave the shared library.
rary('ascent') _
This library supports pipelines for the following project types:
This code can be run through the Jenkins Script console to modify the repository scan interval for multi-branch jobs since there is currently no way to do this any other way.
(f in Jenkins.instance.getAllItems(jenkins.branch.MultiBranchProject.class)) {
println("Updating " + f.name)
f.addTrigger(new com.cloudbees.hudson.plugins.folder.computed.PeriodicFolderTrigger("5m"));