Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "OM2M/testpage123"

(Configure Normal jobs)
(Configure Gerrit jobs)
Line 27: Line 27:
 
# Click on "New Item" in the sidebar menu.
 
# Click on "New Item" in the sidebar menu.
 
# Enter an "Item name", select "Freestyle project", then click Ok.
 
# Enter an "Item name", select "Freestyle project", then click Ok.
# In the first section:
+
# Enter a job name (e.g. project-name_gerrit) and enter your a description.
## Enter a job name (e.g. project-name_gerrit)
+
## Enter your job description.
+
 
# In "Source Code Management" section:
 
# In "Source Code Management" section:
 
## select "Git", then enter your git cloning URL in the "Repository URL" field. If your repository is not public, then enter your username and password in the "Credentials" field.  
 
## select "Git", then enter your git cloning URL in the "Repository URL" field. If your repository is not public, then enter your username and password in the "Credentials" field.  
 
## In "Branches to build" field, enter the variable $GERRIT_BRANCH.
 
## In "Branches to build" field, enter the variable $GERRIT_BRANCH.
 
## In "Additional Behaviours" field, click on add then select "Strategy for choosing what to build", then set "Gerrit Trigger" as "Choosing strategy".
 
## In "Additional Behaviours" field, click on add then select "Strategy for choosing what to build", then set "Gerrit Trigger" as "Choosing strategy".
# In "Build Triggers" section:
+
# In "Build Triggers" section, select "Gerrit Event".
 
+
# In "Gerrit Trigger" section:
to build your project periodically chose "Build periodically", then enter a schedule in the "Schedule" field using the Cron syntax (e.g "H 22 * * * " to build every night between 10h00 PM and 11h00PM"). It is recommended to not chose a strict date to avoid performance loss.
+
## In the "choose a server" field select "gerrit-server" (this server instance is already configured).
 +
## In the "Gerrit Project" box:
 +
### In the first column, as "Type" select "Plain" and as "Pattern" select your project name from the list.
 +
### In the second column (related to branches), as "Type" select "Path" and as "Pattern" enter "**"
 
# In "Build" section, select "Add Build step", chose "Execute Shell script",Then enter you command in the "Command field". You can define several build steps depending to your need.
 
# In "Build" section, select "Add Build step", chose "Execute Shell script",Then enter you command in the "Command field". You can define several build steps depending to your need.
 
# In "Post-build Actions", you can configure some actions to execute after the build, if needed, such as executing other building other project, perform a particular scan, or send an email notification.
 
# In "Post-build Actions", you can configure some actions to execute after the build, if needed, such as executing other building other project, perform a particular scan, or send an email notification.
 
# Click on the "Save" button. Your job is now created and configured. You can find it in the jobs lists.
 
# Click on the "Save" button. Your job is now created and configured. You can find it in the jobs lists.
# To test your job, it is recommended that you launch it manually. In the Jenkins main page, select your job by clicking on its name, then click on "Build now". You should see your job scheduled and executed in the "Build History" box. If you want to see the console output, select the build, then click on "Console Output" in the sidebar menu.
+
# To test your job, it is recommended that you send a contribution to Gerrit and check the execution of your job. You should see your job scheduled and executed automatically in the "Build History" box. If you want to see the console output, select the build, then click on "Console Output" in the sidebar menu.

Revision as of 07:17, 3 April 2016

Configure Jenkins

  • In this tutorial, you will learn how to:
    • Configure normal jobs using Jenkins to build your project manually or periodically.
    • Configure jobs linked with Gerrit to automatically build received contributions before merging them to mainstream.

Configure Normal jobs

  1. Log in to the portal, click on "Tools" on the menu bar, then select "Jenkins".
  2. Click on "New Item" in the sidebar menu.
  3. Enter an "Item name" (e.g. job-test), select "Freestyle project", then click Ok.
  4. Enter a job name (e.g. project-name_gerrit) and a description.
  5. In "Source Code Management" section:
    1. select "Git", then enter your git cloning URL in the "Repository URL" field.
    2. If your repository is not public, then enter your username and password in the "Credentials" field.
    3. You can also enter your branches to build in "Branches to build" field (default is */master).
  6. In "Build Triggers" section, to build your project periodically chose "Build periodically", then enter a schedule in the "Schedule" field using the Cron syntax (e.g "H 22 * * * " to build every night between 10h00 PM and 11h00PM"). It is recommended to not chose a strict date to avoid performance loss.
  7. In "Build" section, select "Add Build step", chose "Execute Shell script", Then enter you command in the "Command field". You can define several build steps depending to your need.
  8. In "Post-build Actions", you can configure some actions to execute after the build, if needed, such as executing other building other project, perform a particular scan, or send an email notification.
  9. Click on the "Save" button. Your job is now created and configured. You can find it in the jobs lists.
  10. To test your job, it is recommended that you launch it manually:
    1. In the Jenkins main page, select your job by clicking on its name, then click on "Build now". You should see your job scheduled and executed in the "Build History" box.
    2. If you want to see the console output, select the build, then click on "Console Output" in the sidebar menu.

Configure Gerrit jobs

  1. Log in to the portal, click on "Tools" on the menu bar, then select "Jenkins".
  2. Click on "New Item" in the sidebar menu.
  3. Enter an "Item name", select "Freestyle project", then click Ok.
  4. Enter a job name (e.g. project-name_gerrit) and enter your a description.
  5. In "Source Code Management" section:
    1. select "Git", then enter your git cloning URL in the "Repository URL" field. If your repository is not public, then enter your username and password in the "Credentials" field.
    2. In "Branches to build" field, enter the variable $GERRIT_BRANCH.
    3. In "Additional Behaviours" field, click on add then select "Strategy for choosing what to build", then set "Gerrit Trigger" as "Choosing strategy".
  6. In "Build Triggers" section, select "Gerrit Event".
  7. In "Gerrit Trigger" section:
    1. In the "choose a server" field select "gerrit-server" (this server instance is already configured).
    2. In the "Gerrit Project" box:
      1. In the first column, as "Type" select "Plain" and as "Pattern" select your project name from the list.
      2. In the second column (related to branches), as "Type" select "Path" and as "Pattern" enter "**"
  8. In "Build" section, select "Add Build step", chose "Execute Shell script",Then enter you command in the "Command field". You can define several build steps depending to your need.
  9. In "Post-build Actions", you can configure some actions to execute after the build, if needed, such as executing other building other project, perform a particular scan, or send an email notification.
  10. Click on the "Save" button. Your job is now created and configured. You can find it in the jobs lists.
  11. To test your job, it is recommended that you send a contribution to Gerrit and check the execution of your job. You should see your job scheduled and executed automatically in the "Build History" box. If you want to see the console output, select the build, then click on "Console Output" in the sidebar menu.

Back to the top