/test-nodejs-app

Test nodeJS pipeline with jenkins

Primary LanguageJavaScriptApache License 2.0Apache-2.0

Build and Deploy nodejs application on EC2 instance - Freestyle

Pre-requisites

  1. A Jenkins server
  2. A EC2 instance (Application server) and deploy node.js

Setup nodejs packages on jenkins (needed for build) and application server (needed to deploy)

  1. Enable nodejs packages on Linux server

    curl -sL https://rpm.nodesource.com/setup_15.x | bash -
  2. install development tools.

    yum groupinstall 'Development Tools'
  3. Install nodejs

    yum -y install nodejs

Setup Jenkins job

Fork nodejs applicaton onto your repository

Github URL: https://github.com/ravdy/nodejs.git

Using simple "hello world" application from the nodejs.org website

On Jenkins GUI

  1. Create the new FreeStyle Project
    Git URL - https://github.com/ravdy/nodejs.git

BUILD --> Execute Shell npm install

npm install
tar czf easyio.tar-$BUILD_NUMBER.gz node_modules main.js package.json public LICENSE

To Deploy on nodejs application server