How to setup Jenkins?

BQ Platform provides a feature of running tests from the CI/CD tools. Jenkins is one such tool.

Instructions to Setup Jenkins using Docker

Docker is a nifty tool to run and try pre-configured software images. We will use Docker to guide you through the process. Process to setup Jenkins on non-docker environment remains the same after installation.

  1. Download and install Docker.

  2. Pull Jenkins from the public repo by running the following command
                     Mac cmd : docker pull Jenkins/Jenkins
    Windows cmd : docker pull jenkins/jenkins

  3. Start Jenkins using the following command
                      Mac cmd : docker run -p 8080:8080 –name=my_jenkins Jenkins/Jenkins
    Windows cmd : docker run -p 8080:8080 Jenkins/Jenkins

  4. Once it is started, open http://localhost:8080 in browser.
    You will see the following screen. It will prompt for password.

  5. You can find the password from terminal (at the time of server start)

  6. Install all suggested plugins or select the required plugins


    It will take a some time to finish the installation.

     

  7. Create an admin user for accessing the Jenkins account & click on Save and Continue button.

     

  8. Once the process is complete, it will open the Jenkins dashboard.

     

  9. Click on Manage Jenkins and then Manage Plugins

  10. Check for HTTP Request under the Installed tab.
    If it is not installed, click on Available Tab and search for HTTP Request and click on install button.
    This plugin enables you to make HTTP calls from Jenkins tasks. After installing the plugin, restart the Jenkins server

  11. Then go to Jenkins Dashboard and click on Create a job.
    Then enter some name in item name field and then click on Freestyle project

  12. For Scheduling the job, you need to check the Build periodically in Build Triggers group

    1. By setting the schedule period to 15 13 * * * you tell Jenkins to schedule the build every day of every month of every year at the 15th minute of the 13th hour of the day.
      Jenkins used a cron expression, and the different fields are:

      1. MINUTES Minutes in one hour (0-59)

      2. HOURS Hours in one day (0-23)

      3. DAYMONTH Day in a month (1-31)

      4. MONTH Month in a year (1-12)

      5. DAYWEEK Day of the week (0-7) where 0 and 7 are sunday

  13. Please ensure a Plan is created and saved in BQ. See https://bqurious.atlassian.net/wiki/spaces/BSD/pages/591986689 for details.

  14. Click on Build tab and enter Bqurious ci/cd url i.e. https://app.bqurious.com/api2/ci/executeFromCi

  15. Select POST in HTTP mode

  16. Click on Advanced.. button. Then, change the Accept and Content-Type to APPLICTION_JSON

  17. Copy the run token of saved plan form bqurious and use it in Request body as {“runToken”: “COPIED TOKEN“} and save the job.

  18. Go to dashboard and click the created job from list. Here it is Regression Test With Bq

  19. Click on Build Now from left side menu.

This will initiate the execution of selected Plan on BQ.

 

 

https://bqurious.atlassian.net/wiki/spaces/BSD/pages/591986689

https://bqurious.atlassian.net/wiki/spaces/BSD/pages/447250439