Code Monkey home page Code Monkey logo

cicd-pipeline-train-schedule-cd's Introduction

cicd-pipeline-train-schedule-cd

This is a simple train schedule app written using nodejs. It is intended to be used as a sample application for a series of hands-on learning activities.

Running the app

You need a Java JDK 7 or later to run the build. You can run the build like this:

./gradlew build

You can run the app with:

./gradlew npm_start

Once it is running, you can access it in a browser at http://localhost:3000.

Instructions

Your team is working on the train-schedule app. A Jenkins Pipeline has already been created for the app, but all it does right now is run a continuous integration build. The team has asked you to add automated deployments to a staging server, and to add a production server to the pipeline. The team has decided to use the master branch of the git repository to control deployments, so only changes to the master branch should be deployed. Whenever there is a change to the master branch, the Pipeline needs to do the following after the CI build is completed:

Deploy the application to a Staging server. Wait for approval before deploying to Production. Once approval is provided, deploy to Production. Begin by creating a fork of the source code at: https://github.com/linuxacademy/cicd-pipeline-train-schedule-cd

You can find a sample solution Jenkinsfile under the example-solution branch.

In order to complete this learning activity, you will need to:

Deploy the app to the staging server via the Jenkins pipeline.

Configure the staging and production servers for the Publish Over SSH plugin.

Add a credential to Jenkins called webserver_login to allow Jenkins to authenticate with the web servers. The user has already been created on the web servers with the username deploy and the password jenkins.

Create a multibranch pipeline project called train-schedule and set it up to build from your GitHub fork.

Create a stage in the Jenkinsfile to deploy the app to the staging server.

Run the build to deploy to the staging server.

Deploy the app to the production server via the Jenkins pipeline:

Create a stage to deploy to production after awaiting user input.

Run the build.

Approve the deployment to production.

A few notes about the lab server setup:

A systemd service called train-schedule has already been created on both web servers. The train-schedule app can be controlled with systemd using commands like systemctl stop train-schedule and systemctl start train-schedule.

The train-schedule service expects the application code to be deployed to /opt/train-schedule.

A deployment user has already been created on both web servers. It can write to /opt/train-schedule as well as start and stop the train-schedule service. The username is deploy and the password is jenkins. Jenkins can use these credentials in order to perform the deployment.

The Publish Over SSH plugin is already installed on the Jenkins server.

The Jenkins server listens on port 8080. Train Schedule, once it is deployed, will listen on port 3000.

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.