The following is how to use jenkins CI/CD pipeline to build and release a gradle application via docker.
The repo contains Jenkinsfile, ansible playbook, Java application, gradle configurations, shell scripts and etc.
Checkout source code ==> Functional test ==> Build and release image ==> Initialize test env ==> Deploy test env via ansible ==> Health Check in test env ==> Initialize prod env ==> Deploy prod env via ansible ==> Health Check in prod env
Remember to proactive the prerequisite before rollout the pipeline.
Github ===> Git repo
Jenkins ===> CI/CD system
Docker ===> Docker container
Java ===> Java programming language
Gradle ===> Java Build tool
Nexus ===> Binary Package Repo
Python ===> Ansible dependency
Ansible ===> Deployment tool
-
Build all prerequisites in an instance or more instances depend on your budget
-
Create an ansible docker in Jenkins node.
-
Create a jenkins pipeline item
-
Setup github(webhook) and AnsiColor jenkins plugin
-
Provision current repo in pipeline setting with proper credential
-
Rock and roll