Skip to content

Automated CICD Pipeline for Web App Deployment using Nginx, OpenSSL, Ansible, Jenkins, Terraform, Docker, and Amazon EKS

Notifications You must be signed in to change notification settings

SofiaNeogalaxy/nginx-cicd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nginx-CICD

Fully automated CICD pipeline to deliver a web-app to staging and production environments using nginx, opensssl, ansible, jenkins, terraform, docker and Amazon EKS

Additional instructions

Assumptions to complete this tutorial:

  1. You have an AWS account set up and have an IAM profile with admin permissions setup locally for the AWS CLI.
  2. Jenkins setup and basically know how to use it.
  3. GitHub's account and Git setup locally with ssh keys.
  4. Terraform installed and Terraform Cloud setup.
  5. Docker Installed and connected to Docker Hub.
  6. Basic knowledge of VPC networking.
  7. A key pair generated from the AWS Console.
  8. Python3 and pip installed.

Initial setup

Create a remote repo on GitHub with the same directory name you choose for the cloned repo, then connect to it either using HTTPs or SSH.

  • git clone https://github.com/0xsudo/nginx-devops-project.git
  • cd nginx-devops-project
  • git init
  • git remote add origin https://github.com/<USER>/<REPO>.git #change accordingly

We will be using the Jenkins user, so we'll need to set up a few things:

  1. Add the Jenkins user and set a password, then login as the user.
  • sudo useradd jenkins
  • sudo passwd jenkins
  • su jenkins
  1. Create an ssh key pair for our Jenkins user, to be used on GitHub and for connecting to our ec2 instance.
  • ssh-keygen -t rsa
  1. Change ownership to the Jenkins user and group for both .ssh and .aws directories.
  • sudo chown -R jenkins:jenkins ~/.ssh/ ~/.aws/
  1. Move the key pair downloaded from the AWS console into the ssh directory.
  • cp $WORKDIR/<key-pair-name.pem> ~/.ssh/
  1. Create an IAM role in the AWS console and attach it with admin permissions, then use the AWS CLI to it configure locally using the access and secret keys.
  • aws configure
  1. Add our Jenkins user to Docker group and update Docker daemon permissions to allow us to access the socket.
  • sudo usermod -aG docker jenkins
  • sudo chmod 660 /var/run/docker.sock

About

Automated CICD Pipeline for Web App Deployment using Nginx, OpenSSL, Ansible, Jenkins, Terraform, Docker, and Amazon EKS

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published