Steps for Jenkins installation:

  1. Ssh into the virtual machine

    ssh seaidemo23@128.2.24.106

Skip step 2, 3 for the recitation demo. Already setup.

  1. Install Java Jdk

sudo apt-get install java-1.8.0-openjdk

java -version

  1. Install jenkins using a docker image

docker pull jenkins/jenkins

  1. Run the war file on port 8089

java -jar /usr/share/java/jenkins.war --httpPort=8089

  Message: Jenkins is fully up and running
  1. Open http://128.2.24.106:8081/

  2. Login

    Username: admin

    Password: seaidemo23

  3. Click on New Item on top left corner

  4. Add name, select Freestyle project and click OK

  5. Configue the project - Add a description

  6. In Source Code Management, select Git and add repository URL to link to GitHub Note: This repository is public, so it does not require credentials

  7. Under Branches to build, in Branch Specifier replace */master with */main

  8. Under Build Steps, click on Add Build Steps dropdown and select Execute shell

  9. In commands, paste the following commands to run pytest

pytest -v

coverage run -m pytest

coverage report

  1. Click Save

  2. Click Build Now from left menu

  3. In Build History, green tick shows the build is successful. Click on build for details.

  4. Click on Console Output from left menu

  5. Observe the test cases have passed

Steps for GitHub Actions:

  1. Click on Actions tab

  2. Click on New workflow and then click on set up a workflow yourself

  3. Set up yaml file

  4. Green ticks signifies successful build