<commit_before>Installation
------------

In the following Jenkins also means Hudson, unless otherwise stated, python means python 2.7 or python3.4
or later and pip means python 2 pip or python 3 pip, unless differences are mentioned.

1. The easy way:
   python setup.py install

   To uninstall:
   pip uninstall jenkinsflow

   Read the file demo/demo_security.py if you have security enabled your Jenkins.

Jenkinsflow uses it's own specialized 'jenkins_api' python module to access Jenkins, using the Jenkins rest api.

2. Manually:
2.1. Install dependencies:
   pip2 install requests enum34 subprocess32 click atomicfile

   or

   pip3 install requests click atomicfile

   optional: pip install tenjin (if you want to use the template based job loader)

   Note: if you use Hudson (3.x): You need to configure Hudson to install the REST API plugin and enable REST API.

2.2. Install dependencies for experimental features:
   To use the experimental script api:
     pip install psutil setproctitle

   To use the experimental visualisation feature:
     pip install bottle

2.3. To use propagation=Propagation.FAILURE_TO_UNSTABLE feature, Jenkins URL must be set in Jenkins configuration.
   Note that this feature uses the 'cli' which has problems working over a proxy.
   This requires java to run the cli
   # NOTE: Some versions of Jenkins, e.g. 1.651.2, come with a broken cli, missing the main manifest attribute!

2.4. Read the file demo/demo_security.py for notes about security, if you have enabled security on your Jenkins

2.5. All set! You can now create jobs that have a shell execution step, which will a use this library to control the running of other jobs.
   See the demo directory for example flows. The demo jobs can be loaded by running tests, see below.


Note: I think jenkinsflow should work on Windows, but it has not been tested.
   I'm SURE the test/run.py script will fail on Windows. There are a few Linux/Unix bits in the test setup. Check test/framework/config.py and
   test/tmp_install.sh. Patches are welcome:)


Test
----

# NOTE: Some versions of Jenkins, e.g. 1.651.2, come with a broken cli, missing the main manifest attribute, making some tests fail!

0. The mocked and script_api test can be run using 'tox'
   pip install tox

1. The tests which actually run Jenkins jobs currently do not run under tox.

   Install python-devel
   E.g on fedora:
   sudo dnf install python-devel
   or
   sudo dnf install python3-devel

   Install pytest and tenjin template engine:
   pip install -U 'pytest>=2.7.2' 'pytest-cov>=2.1.0' 'pytest-cache>=1.0' 'pytest-instafail>=0.3.0' 'pytest-xdist>=1.12' tenjin click bottle

   pip2 install -U proxytypes
   or
   pip3 install -U objproxies

   # The test will also test the generation of documentation, for this you need:
   pip install -U 'sphinx>=1.6' sphinxcontrib-programoutput


2. Important Jenkins/Hudson setup and test preparation:
   Configure security -
      Some of the tests requires security to be enabled.
      You need to create two users in Jenkins:
      Read the file demo/demo_security.py and create the user specified.
      Create a user called 'jenkinsflow_authtest1', password '<PASSWORD>'. ( u'\u00e6\u00f8\u00e5\u00c6\u00d8\u00c5' )

   Set the number of executers -<commit_msg>Minor INSTALL doc improvement<commit_after>Installation
------------

In the following Jenkins also means Hudson, unless otherwise stated, python means python 2.7 or python3.4
or later and pip means python 2 pip or python 3 pip, unless differences are mentioned.

1. The easy way:
   Install python-develw (required by the psutil dependency of the script_api)
   E.g on fedora:
   sudo dnf install python-devel
   or
   sudo dnf install python3-devel

   python setup.py install

   To uninstall:
   pip uninstall jenkinsflow

   Read the file demo/demo_security.py if you have security enabled your Jenkins.

Jenkinsflow uses it's own specialized 'jenkins_api' python module to access Jenkins, using the Jenkins rest api.

2. Manually:
2.1. Install dependencies:
   pip2 install requests enum34 subprocess32 click atomicfile

   or

   pip3 install requests click atomicfile

   optional: pip install tenjin (if you want to use the template based job loader)

   Note: if you use Hudson (3.x): You need to configure Hudson to install the REST API plugin and enable REST API.

2.2. Install dependencies for experimental features:
   To use the experimental script api:
     Install python-devel (see above)
     pip install psutil setproctitle

   To use the experimental visualisation feature:
     pip install bottle

2.3. To use propagation=Propagation.FAILURE_TO_UNSTABLE feature, Jenkins URL must be set in Jenkins configuration.
   Note that this feature uses the 'cli' which has problems working over a proxy.
   This requires java to run the cli
   # NOTE: Some versions of Jenkins, e.g. 1.651.2, come with a broken cli, missing the main manifest attribute!

2.4. Read the file demo/demo_security.py for notes about security, if you have enabled security on your Jenkins

2.5. All set! You can now create jobs that have a shell execution step, which will a use this library to control the running of other jobs.
   See the demo directory for example flows. The demo jobs can be loaded by running tests, see below.


Note: I think jenkinsflow should work on Windows, but it has not been tested.
   I'm SURE the test/run.py script will fail on Windows. There are a few Linux/Unix bits in the test setup. Check test/framework/config.py and
   test/tmp_install.sh. Patches are welcome:)


Test
----

# NOTE: Some versions of Jenkins, e.g. 1.651.2, come with a broken cli, missing the main manifest attribute, making some tests fail!

0. The mocked and script_api test can be run using 'tox'
   pip install tox

1. The tests which actually run Jenkins jobs currently do not run under tox.

   Install pytest and tenjin template engine:
   pip install -U 'pytest>=2.7.2' 'pytest-cov>=2.1.0' 'pytest-cache>=1.0' 'pytest-instafail>=0.3.0' 'pytest-xdist>=1.12' tenjin click bottle

   pip2 install -U proxytypes
   or
   pip3 install -U objproxies

   # The test will also test the generation of documentation, for this you need:
   pip install -U 'sphinx>=1.6' sphinxcontrib-programoutput


2. Important Jenkins/Hudson setup and test preparation:
   Configure security -
      Some of the tests requires security to be enabled.
      You need to create two users in Jenkins:
      Read the file demo/demo_security.py and create the user specified.
      Create a user called 'jenkinsflow_authtest1', password '<PASSWORD>'. ( u'\u00e6\u00f8\u00e5\u00c6\u00d8\u00c5' )

   Set the number of executers -
{'fraction_non_alphanumeric': 0.0605290688985204, 'fraction_numerical': 0.02271708264833358, 'mean_word_length': 3.503364737550471, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, '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': '5025036', 'n_tokens_mistral': 1996, 'n_tokens_neox': 1878, 'n_words': 933}