The purpose of building a CI/CD pipeline is to automate steps in software delivery process
The tools we would be using to build a CI/CD pipeline
Tools | ||
---|---|---|
Jenkins | Maven | Ansible |
Docker | Docker Hub | Tomcat |
Git | Github | AWS EC2 |
- Create Security Groups
- Launch AWS EC2 instances
- Allocate each AWS EC2 instance a pulblic ip address
- Change server hostname and SSH timeout for all servers
- Create users
- Add uses to necessary groups
- Grant sudo access to ansibleadm user
- Genetate SSH keys for users
- Copy SSH keys over to necessary servers
- Enable yum repositories
- Install packages
- Get jenkinsadm SSH key from Jenkins host
- Copy jenkinsadm SSH key from Jenkins host to Github
- Fork "helloworld" repo
- Create a Access Tokens
- Create a repository
- Connect Docker host to Docker Hub
- Pull Tomcat 8.5 Docker image
- Run a Docker container using Tomcat 8.5 image
- Check if Docker container is running
- Create a Docker image out of the running container
- Push created Docker image to Docker Hub
- Create a directory with appropriate permissions to store Java artifacts
- Create a diretory for Ansible
- Create an Ansible skeleton role
- Create a hosts directory
- Create a hosts file in hosts directory with contents of this file
- Create an Ansible Playbook named docker-container.yml with contents of this file
- Give ansible folder and its contents the appropriate owners
- Login to jenkins
- Configure Maven plugin
- Configuring Github plugin
- Configuring Github webhook trigger
- Configure Publish Over SSH plugin
- Copy SSH keys to /var/lib/jenkins/.ssh
- Start a new project
- Configure the project
- Run the build manually
- Trigger an automatic build