Backend Node (be-node-express)
What files / architecture is generated?
The files are generated using a yeoman generator for node-express-typescript. Generated files include a minimal express server with dummy routes.
├── Jenkinsfile - Contains Jenkins build configuration ├── LICENSE ├── README.md ├── docker - Contains Dockerfile for the build │ └── Dockerfile ├── package-lock.json - Commit this file as well when you update your dependencies ├── package.json - This file contains all the npm dependencies and build commands for the project. ├── sonar-project.properties - SonarQube Configuration ├── src │ ├── greeter.ts │ ├── index.ts - Entrypoint, This runs first │ └── routes │ └── weather.ts ├── test │ ├── greeter-spec.ts │ └── index-spec.ts ├── tsconfig.json - TypeScript Configuration file └── tslint.json - TypeScript Linter Configuration 4 directories, 14 files
Usage - how do you start after you provisioned this quickstarter
-
Do a
npm install
form the project root to install all the dependencies. -
npm run serve
will transpile the code and start the server -
Execute
npm run test
for unit testing
How this quickstarter is built thru jenkins
The build pipeline is defined in the Jenkinsfile
in the project root. The mains stages of the pipeline are,
-
Build :
npm run build
command will be executed to build the application and then the build (including the node_modules) will be copied to thedocker/dist
folder. -
Unit Testing :
npm test -- --progress false
&npm run coverage
commands will be executed for running unit tests and to generate coverage report. The results can be seen form the Jenkins console output.
Builder Slave used
This quickstarter uses Nodejs10-Angular builder slave Jenkins builder slave.