• Creates a sample application called ‘webservice-1.1.2.war’ • Pushes it to a local repository in Artifactory
Note: List of required Jenkins plugins
- Artifactory Plugin
- Docker Pipeline Plugin
- GitHub plugin
- Pipeline Github Plugin
- Pipeline Plugin
- Gradle Plugin
-
Configure Artifactory server in Jenkins Manage Jenkins -> Configure System -> Artifactory -> Add Artifactory Server.
-
Create Gradle repositories in Artifactory using quick setup wizard.
-
Create new Jenkins Pipeline Job.
-
Add String Parameters:
- GRADLE_TOOL (String Parameter) : Provide name of configured Gradle installation
e.g
GRADLE_TOOL : gradle-3.5.1
- DEPLOY_REPO (String Parameter) -> Artifactory Gradle Repository name
e.g.DEPLOY_REPO -> gradle-release
- SERVER_ID (String Parameter) : Artifactory Server Id
e.g.SERVER_ID -> artifactory
- XRAY_SCAN (Choice Parameter) : Xray Scan. Applicable only if you are using JFrog Xray
e.g.XRAY_SCAN -> NO
- CLEAN_REPO (Choice Parameter) : Clean gradle cache before building project
e.g.CLEAN_REPO -> YES
- GRADLE_TOOL (String Parameter) : Provide name of configured Gradle installation
e.g
-
Copy Jenkinsfile to Pipeline Script.
-
To build it, press Build Now.
-
Check your newly published build in build browser of Artifactory.