/
4. Jenkins - setting up a job

4. Jenkins - setting up a job

git clone https://livingwater@bitbucket.org/living-water-js/pipeline-sample-code.git

Once you have Jenkins running

Select the option shown above

 

Give your project a name and select the option above, then select OK

At the Source Code Management section - select Git, then enter the Git URL

You will need to add your login credentials if this is the first time Jenkins is accessing your git account

Select Jenkins

Make sure the above option is set

Enter the details shown above and select Add

Your credentials should now be shown as above

Select Apply and Save (lower left of screen)

Build Steps

Select the “Add build Step” button

 

Because you are working on a Windows machine, select the option shown above.

We are going to check that your machine is setup correctly

Enter the following commands in the area that is now showing

As you can see we’ve added to commands

node -v npm -v

If the commands above successfully worked we can move onto the next section

Completing the Build

Using Windows File Explorer create the following file structure C:\temp\app

Back in Jenkins in your project follow the steps below -

Replace the above build commands with

cleanup.bat

Now add a second build step

Add these instructions

xcopy /E /-Y *.* c:\temp\app cd c:\temp\app npm i

And finally, add a third build step

Add these instructions

 

You should have three build steps that look like this

 

Apply and Save the project

Related content