GithubHelp home page GithubHelp logo

sofianeogalaxy / nginx-cicd Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 1.0 27 KB

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

Shell 0.74% Dockerfile 1.98% HTML 1.19% CSS 1.45% HCL 88.67% Smarty 5.97%
ansible docker nginx openssl terraform

nginx-cicd's Introduction

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

nginx-cicd's People

Contributors

sofianeogalaxy avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

aruntheja-2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.