Installing and using the CodePipeline Jenkins plugin

Installing a plugin in Jenkins is very simple:

  1. Open your Jenkins instance in your browser (in my case http://54.175.97.69:8080).
  2. If needed, log in and then click on Manage Jenkins.
  3. In the Manage Jenkins page, select Manage Plugins.
  4. Search for the plugin called AWS CodePipeline Plugin, select it and install it.

We can now start using the plugin:

  1. Go back to the home page of your Jenkins server.
  2. Click on New Item in the left-hand side menu.
  3. Give the new item the name HelloworldTest, select Freestyle project, and click on the OK button at the bottom of the page.
  4. On the next screen, under the Source Code Management, select AWS CodePipeline. Because we configured the permissions at the instance profile level, the only options we need to configure are the AWS Region and Category, which are for us respectively US_EAST_1 and Test.
  5. Under Build Triggers, select Poll SCM and then type * * * * * to tell Jenkins to check with CodePipeline every minute for possible code test requests.
  6. Under the Build section, click on Add build step and then Execute shell.
  7. We are going once again to run the tests we created at the beginning of the chapter. In the Command section, type the following:
npm install
./node_modules/mocha/bin/mocha     
  1. Add a post-build action and select the action called AWS CodePipline Publisher.

 

  1. In the newly generated AWS CodePipeline Publisher, click on Add, and leave the Location blank.
  2. You can optionally configure the rest of the job to your liking and then click on Save to create the new job.

Our test job in Jenkins is ready to be used. We can update our pipeline to take advantage of it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset