- Downloads, from Artifactory, the ‘webservice-1.1.2.war’ file and the ‘docker-framework’ Docker image, that were created in the previous two pipelines
- Creates a ‘docker-app’ production Docker image
- Pushes it to Artifactory
- Scans it with Xray
- Promotes it to a production repository in Artifactory
Note: List of required Jenkins plugins
-
On the Jenkins front page, click on Credentials -> System -> Global credentials -> Add Credentials Add your Artifactory credentials as the type Username with password, with the ID artifactory-credentials
-
Create Following Docker repositories in Artifactory.
docker-stage-local
- Local docker repo.docker-prod-local
- Local docker repo.docker-remote
- Remote docker repo pointing to Docker hubhttps://registry-1.docker.io/
.bintray-docker-remote
- Remote docker repo pointing to Bintray:https://docker.bintray.io
.docker
- Virtual docker repo aggregating all above created repo withdocker-stage-local
as default repo for deployment. -
Create Generic local repository with name
tomcat-local
and deploy Java and Tomcat binaries in it. -
Create new Jenkins Pipeline Job.
-
Add String Parameters:
- ARTDOCKER_REGISTRY (String Parameter) : Domain of Artifactory docker registry
e.g
ARTDOCKER_REGISTRY : docker.artifactory
- REPO (String Parameter) -> Artifactory virtual docker registry
e.g.REPO -> docker
- PROMOTE_REPO (String Parameter) : Artifactory production docker registry
e.g.PROMOTE_REPO -> docker-prod-local
- SOURCE_REPO (String Parameter) : Artifactory staging docker registry
e.g.SOURCE_REPO -> docker-stage-local
- 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 -> YES
- SERVER_URL (String Parameter) : Artifactory Server URL
e.g.SERVER_URL -> http://35.225.27.231/artifactory
- CREDENTIALS (Credentials Parameter) : Artifactory Credential
e.g.CREDENTIALS -> artifactory-credentials
- ARTDOCKER_REGISTRY (String Parameter) : Domain of Artifactory docker registry
e.g
-
Copy Jenkinsfile to Pipeline Script.
-
To build it, press Build Now.
-
Check your newly published build in build browser of Artifactory.