A repository of usefull scripts to use along with JSCPD tool
- Install Jenkins NodeJS plugin a. Login as Admin b. Navigate to 'Manage Jenkins' -> 'Manage Plugins' c. Navigate to 'Available' Section d. Search for NodeJS plugin e. Click on 'Install without restart'
- Once Installed Navigate back to 'Manage Jenkins' -> 'Global tool Configuration'
- Scroll down to NodeJS installations, specify the version of NodeJS ( select latest )
- In the name textbox enter 'Install and setup NodeJS'
- In the textbox 'Global npm packages to install' enter 'jscpd JSON.sh'
Now that you are done setting up jscpd tool in your CI environment, Next we have to run it as part of our build
- Navigate to your Task/Project in Jenkins
- Click on configure in the left vertical menu
- Select build tab
- Click on the dropdown 'Add Build step'
- Select 'Install and setup NodeJS'
- Just leave rest of the textboxes and textareas as default .
- Now add another build step by clicking on the dropdown 'Add Build step'
- Select 'Execute Shell'
- Place the code in the script jenkins_build.sh in the text area