GithubHelp home page GithubHelp logo

jenkins-docs / building-a-multibranch-pipeline-project Goto Github PK

View Code? Open in Web Editor NEW
102.0 13.0 3.5K 1.42 MB

Advanced tutorial building a multibranch Pipeline project with selectively executed stages

Home Page: https://jenkins.io/doc/tutorials/build-a-multibranch-pipeline-project/

Shell 46.64% HTML 20.13% CSS 10.88% JavaScript 22.36%

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

Building a multibranch Pipeline project

This repository is for the 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 is based on. Therefore, you'll be building and testing the same application but this time, its delivery will be different depending on the Git branch that Jenkins builds from. That is, the branch being built determines which delivery stage of your Pipeline is executed.

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).

Getting Started with Create React App (npx create-react-app tutorial)

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.

The page will reload when you make changes.
You may also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

npm run eject

Note: this is a one-way operation. Once you eject, you can't go back!

If you aren't satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

npm run build fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

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

Contributors

dependabot[bot] avatar gilesgas avatar gounthar avatar markewaite avatar notmyfault avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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

Jenkinsfile Build stage npm install not working

Jenkinsfile


pipeline {
    agent {
        docker {
            image 'node:6-alpine'
            args '-p 3000:3000 -p 5000:5000'
        }
    }
    environment {
        CI = 'true'
    }
    stages {
        stage('Build') {
            steps {
                sh 'npm install'
            }
        }
        stage('Test') {
            steps {
                sh './jenkins/scripts/test.sh'
            }
        }
    }
}

Fails at build stage with error -

+ npm install

npm ERR! Linux 4.15.0-1050-gcp

npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"

npm ERR! node v6.17.1

npm ERR! npm  v3.10.10

npm ERR! path /.npm

npm ERR! code EACCES

npm ERR! errno -13

npm ERR! syscall mkdir



npm ERR! Error: EACCES: permission denied, mkdir '/.npm'

npm ERR!     at Error (native)

npm ERR!  { Error: EACCES: permission denied, mkdir '/.npm'

npm ERR!     at Error (native)

npm ERR!   errno: -13,

npm ERR!   code: 'EACCES',

npm ERR!   syscall: 'mkdir',

npm ERR!   path: '/.npm',

npm ERR!   parent: 'my-app' }

npm ERR! 

npm ERR! Please try running this command again as root/Administrator.



npm ERR! Please include the following file with any support request:

npm ERR!     /var/lib/jenkins/workspace/branch-pipeline-project_master_2/npm-debug.log

script returned exit code 243

Incorrect port in deploy-for-production.sh, formatting issues in README.md

In jenkins/scripts/deploy-for-production.sh, Line 32, the script is serving the application at the wrong port. In the tutorial Build a Multibranch Pipeline Project, it is stated that the web application is available at http://localhost:5000. However, the script serves the application at port 3000.

Proposed change:

Before

./node_modules/serve/build/main.js -s build -l 3000 &

After

./node_modules/serve/build/main.js -s build -l 5000 &

In addition, there is a hyperlink formatting issue in README.md, Line 21. (unless it is intentional.)

Not making a pull-request as it seems to not be accepted in this repository.

SyntaxError: Unexpected token in serve.js command

Hi, I've been following the tutorial.
When doing the command ./node_modules/serve/bin/serve.js -c 0 -s build & inside deploy-for-production.sh, I get the error:

const updateCheck = async (isDebugging) => {
                          ^

SyntaxError: Unexpected token (
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.runMain (module.js:611:10)
    at run (bootstrap_node.js:394:7)

Any idea how to fix ?
Thanks !

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.