This repository is a Jenkins pipeline to build docker images and push it to harbor ( docker registry ) this pipeline was wrote based docker-compose and Ansible deployments but you can use it for other deploy methods.
- Configure VMs first (networks)
- Installed Gitlab
- Installed Jenkins
- Installed Harbor or any docker registry (harbor)
- Installed Ansible
- Envs for Production stage or Development stage
Below plugins should Installed on jenkins
- Gitlab plugin
- Global Slack Notifier Plugin
- Publish over ssh
- Rebuilder
- SSH pipeline
- Timestamper
Credentials:
- harbor Credentials
- gitlab user and token
- ssh public key address for ssh to ansible server
-
create production.env qa.env (your app env) and docker-compose.yml(docker-compose file of your app) or you should change creating artifact part in pipeline.
-
create Jenkinsfile in your project like this:
@Library('shared_lib')_
builder()
We need a VM which deliver deployments, It's Necessary to add jenkins public key in ansible server and add ansible user public key in api servers.