GithubHelp home page GithubHelp logo

manikandandevops / aws-community-day-talk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yashvardhan-kukreja/aws-community-day-talk

0.0 0.0 0.0 68 KB

This is the sample code for aiding in the presentation of my talk at AWS Community Day

Dockerfile 8.42% JavaScript 66.37% Shell 25.21%

aws-community-day-talk's Introduction

AWS Community Day - ANZ

Here's a quick walkthrough of all the required resources, links and explanations associated with the sample project/code which is being dealth with in the talk


About the project/code:

Here is the explanation of the siginificance of the files in the project:

  • app.js - Consists of the main code associated with the app. The base route GET / is defined and coded there
  • tests.js - Consists of the unit tests associated with the app. This file is executed when tests are performed.
  • deployment.yaml - The main recipe/yaml file behind the kubernetes deployment. This is the file which is actually executed on the EKS Cluster (Master node) so as to setup the deployment.
  • cleanup.sh - This is the shell script which is executed for the sake of performing Stage 2 in CICD pipeline i.e. the cleanup stage.
  • deploy.sh - This is the shell script used by provisioning server in stage 7 to get what it needs for ordering a deployment to the Amazon EKS Cluster in Stage 7.
  • Dockerfile - The Dockerfile for building the docker image for the main application
  • Dockerfile.dev - The Dockerfile for building the docker image for performing testing.

Pipeline script:

node {
    stage("Cloning the repository") {
        git credentialsId: 'aws-community-day-key', url: '[email protected]:yashvardhan-kukreja/aws-community-day-talk.git'
    }
    stage ("Performing cleanup") {
        sh label: 'Cleaning up the existing containers, images and code', script: 'bash cleanup.sh'
    }
    stage("Building the test dockerfile") {
        sh label: 'Building the Dockerfile.dev file', script: "docker build -t yashvardhankukreja/aws-community-day:test -f Dockerfile.dev ."
    }
    stage("Running the tests") {
        sh label: 'Running the Dockerfile.dev for testing', script: "docker run -t yashvardhankukreja/aws-community-day:test"
    }
    stage("Building the main docker image") {
        sh label: 'Building the docker image where tag is the build number', script: "docker build -t yashvardhankukreja/aws-community-day:${BUILD_NUMBER} -f Dockerfile ."
        sh label: 'Building the docker image where tag is latest', script: "docker build -t yashvardhankukreja/aws-community-day:latest -f Dockerfile ."
    }
    stage("Pushing the built image to docker hub") {
        withCredentials([string(credentialsId: 'docker-hub-pwd', variable: 'dockerHubPwd')]) {
            sh label: 'Logging in to docker hub', script: "docker login -u yashvardhankukreja -p ${dockerHubPwd}"
            sh label: 'Pushing the latest docker image to docker hub where tag is the build number', script: "docker push yashvardhankukreja/aws-community-day:${BUILD_NUMBER}"
            sh label: 'Pushing the latest docker image to docker hub where tag is latest', script: "docker push yashvardhankukreja/aws-community-day:latest"
        }
    }
    stage("Deployment on the Provisiong Server") {
        sshagent(['provisioning-server-key']) {
            sh "ssh -o StrictHostKeyChecking=no [email protected] < deploy.sh"
            sh "ssh -o StrictHostKeyChecking=no [email protected] kubectl set image deployment/aws-community-day-deployment aws-community-day-container=yashvardhankukreja/aws-community-day:${BUILD_NUMBER}"
        }
    }
}

Some useful links for you:


aws-community-day-talk's People

Contributors

manikandandevops avatar yashvardhan-kukreja avatar

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.