GithubHelp home page GithubHelp logo

cassie2022 / building-a-multibranch-pipeline-project Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dex-z/building-a-multibranch-pipeline-project

0.0 0.0 0.0 579 KB

For an advanced tutorial on how to use Jenkins to build a multibranch Pipeline project with selectively executed stages.

Shell 35.88% JavaScript 45.34% CSS 3.98% HTML 14.40% Dockerfile 0.40%

building-a-multibranch-pipeline-project's Introduction

building-a-multibranch-pipeline-project

This repository is for Build a multibranch Pipeline project tutorial in the Jenkins User Documentation.

This tutorial uses the same application that the Build a Node.js and React app with npm tutorial. Therefore, you'll build and test the same application but this time, the delivery will be different depending on the Git branch that Jenkins pipeline builds from. That is, the built branches determines which delivery stage of the pipeline.

The jenkins directory contains an example of the Jenkinsfile (i.e. Pipeline) you'll be creating yourself during the tutorial and the scripts subdirectory contains shell scripts with commands that are executed when Jenkins processes either the "Deliver for development" or "Deploy for production" stages of your Pipeline (depending on the branch that Jenkins builds from).

Modify the docker working directory

To fix npm ERR! Please try running this command again as root/Administrator. we can add HOME= '.' under environment to run under current directory rather than build as root

The finished code looks like this:

'pipeline {
    agent {
        docker {
            image 'node:6-alpine'
            args '-p 3000:3000 -p 5000:5000'
        }
    }
    environment {
        HOME = '.'
        CI = 'true'
    }

Following this guide to run docker locally

Click on proceed to and visit http://localhost:3000 to view the page

Running Jenkins on EC2 / Azure VM

Modify the security group of the Jenkins instance to allow inbound traffic on Port 3000 from your IP address (DO NOT allow traffic from 0.0.0.0/0 for best security practices)

Optional - Deploy a highly available master node via Cloudformation

  1. Login to AWS console
  2. navigate to cfn-template-for-jenkins-master-node
  3. Installation guide
    • This template depends on one of our vpc-*azs.yaml templates. Launch Stack vpc-2azs.yaml
    • Launch Stack via jenkins2-ha.yaml
    • Click Next to proceed with the next step of the wizard.
    • Specify a name and all parameters for the stack.
    • Click Next to proceed with the next step of the wizard.
    • Click Next to skip the Options step of the wizard.
    • Check the I acknowledge that this template might cause AWS CloudFormation to create IAM resources. checkbox.
    • Click Create to start the creation of the stack.
    • Wait until the stack reaches the state CREATE_COMPLETE
    • Grab the URL of the Jenkins master from the Outputs tab of your stack.

Reference

  1. https://templates.cloudonaut.io/en/stable/jenkins/

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.