<commit_before>Getting started with Jenkins
============================

[Jenkins](http://jenkins-ci.org) is a popular, open source [continuous integration](http://en.wikipedia.org/wiki/Continuous_Integration) server. In these pages we provide an introduction to Jenkins and how it can be used to automate the building and testing of software. We also show how Jenkins build-and-test jobs can be triggered by changes to code held in popular source code repositories including Git, Mercurial, Subversion and CVS.

This is not intended to be a complete introduction to everything that Jenkins offers. Rather, it is hoped that it will serve to get you started, helping you through your first 20 minutes of using Jenkins, to give an idea as to its potential and usefulness.

Install and deploy Jenkins
--------------------------

* [Installing Jenkins](./Install.md)

Use Jenkins to run a shell script
---------------------------------

* [Create a Jenkins shell script job](./Shell.md)

Use Jenkins to run build-and-test jobs for various languages
------------------------------------------------------------

* [Create a Jenkins Python job](./Python.md)
* [Create a Jenkins C job](./C.md)
* [Create a Jenkins C++ job](./Cpp.md)
* [Create a Jenkins Fortran job](./Fortran.md)
* [Create a Jenkins Java job](./Java.md)

Use Jenkins to run jobs periodically
------------------------------------

* [Configure a job to run periodically](./Periodic.md)

Use Jenkins to run build-and-test jobs when source code changes
---------------------------------------------------------------

Jenkins can be configured to detect and respond to changes made to code or files held under version control. If the code is changed, then the server can automatically spawn a new build-and-test job. This means that the software is rebuilt and tested every time the code is changed. Since the server can be remote from your own machine, it means you can continue working while the tests are under way.

* [Configure a job to run when updates are committed to Git](./Git.md)
* [Configure a job to run when updates are committed to Mercurial](./Hg.md)
* [Configure a job to run when updates are committed to Subversion](./SVN.md)
* [Configure a job to run when updates are committed to CVS](./CVS.md)

Use Jenkins to run experiments
------------------------------

Jenkins can not only trigger builds for very complex software but also trigger and provide a summary of the success or failure of experiment runs. As [Create a Jenkins shell script job](./Shell.md) shows, Jenkins can run any shell script and report on the success or failure depending on whether the script exits with 0, for success, or non-zero, for failure. Jenkins imposes no restriction as to what this shell script does.

Jenkins can provide a summary of the console output on the build results page. It also, on a project page, allows us, via the Workspace link, to browse the project's workspace. Typically this is the directory where the scripts are invoked. If output files are placed here by the scripts, then they can be viewed via Jenkins too.

Further information
-------------------

This has just touched upon the myriad configuration options, build steps, test steps, notification mechanisms and publishing options that Jenkins supports. 

For more information check out:

* Jenkins' [Meet Jenkins](https://wiki.jenkins-ci.org/display/JENKINS/Meet+Jenkins)
* Jenkins' [Use Jenkins](https://wiki.jenkins-ci.org/display/JENKINS/Use+Jenkins)<commit_msg>Added Import section and link to examples/<commit_after>Getting started with Jenkins
============================

[Jenkins](http://jenkins-ci.org) is a popular, open source [continuous integration](http://en.wikipedia.org/wiki/Continuous_Integration) server. In these pages we provide an introduction to Jenkins and how it can be used to automate the building and testing of software. We also show how Jenkins build-and-test jobs can be triggered by changes to code held in popular source code repositories including Git, Mercurial, Subversion and CVS.

This is not intended to be a complete introduction to everything that Jenkins offers. Rather, it is hoped that it will serve to get you started, helping you through your first 20 minutes of using Jenkins, to give an idea as to its potential and usefulness.

Install and deploy Jenkins
--------------------------

* [Installing Jenkins](./Install.md)

Use Jenkins to run a shell script
---------------------------------

* [Create a Jenkins shell script job](./Shell.md)

Use Jenkins to run build-and-test jobs for various languages
------------------------------------------------------------

* [Create a Jenkins Python job](./Python.md)
* [Create a Jenkins C job](./C.md)
* [Create a Jenkins C++ job](./Cpp.md)
* [Create a Jenkins Fortran job](./Fortran.md)
* [Create a Jenkins Java job](./Java.md)

Use Jenkins to run jobs periodically
------------------------------------

* [Configure a job to run periodically](./Periodic.md)

Use Jenkins to run build-and-test jobs when source code changes
---------------------------------------------------------------

Jenkins can be configured to detect and respond to changes made to code or files held under version control. If the code is changed, then the server can automatically spawn a new build-and-test job. This means that the software is rebuilt and tested every time the code is changed. Since the server can be remote from your own machine, it means you can continue working while the tests are under way.

* [Configure a job to run when updates are committed to Git](./Git.md)
* [Configure a job to run when updates are committed to Mercurial](./Hg.md)
* [Configure a job to run when updates are committed to Subversion](./SVN.md)
* [Configure a job to run when updates are committed to CVS](./CVS.md)

Use Jenkins to run experiments
------------------------------

Jenkins can not only trigger builds for very complex software but also trigger and provide a summary of the success or failure of experiment runs. As [Create a Jenkins shell script job](./Shell.md) shows, Jenkins can run any shell script and report on the success or failure depending on whether the script exits with 0, for success, or non-zero, for failure. Jenkins imposes no restriction as to what this shell script does.

Jenkins can provide a summary of the console output on the build results page. It also, on a project page, allows us, via the Workspace link, to browse the project's workspace. Typically this is the directory where the scripts are invoked. If output files are placed here by the scripts, then they can be viewed via Jenkins too.

Importing Jenkins jobs
----------------------

The [examples/](./examples) directories contains examples of Jenkins job configuration files for each of the jobs written following the above instructions. These are plain-text XML files which can be imported into Jenkins. They assume `build_and_test_examples` is located in your `$HOME` directory.

To import any of these jobs into Jenkins:

```
$ cp -r jenkins/JOB_NAME $HOME/.jenkins/jobs/
```

On the Jenkins dashboard:

* Click Manage Jenkins.
* Click Reload configuration from disk.
* You should see JOB_NAME.
* Click green "run" icon.

Further information
-------------------

This has just touched upon the myriad configuration options, build steps, test steps, notification mechanisms and publishing options that Jenkins supports. 

For more information check out:

* Jenkins' [Meet Jenkins](https://wiki.jenkins-ci.org/display/JENKINS/Meet+Jenkins)
* Jenkins' [Use Jenkins](https://wiki.jenkins-ci.org/display/JENKINS/Use+Jenkins)
{'fraction_non_alphanumeric': 0.14042218434508982, 'fraction_numerical': 0.0007866789038940606, 'mean_word_length': 3.0835117773019274, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3466322', 'n_tokens_mistral': 1910, 'n_tokens_neox': 1775, 'n_words': 1012}