---
- scm:
    name: govuk-taxonomy-supervised-learning
    scm:
        - git:
            url: git@github.com:alphagov/govuk-taxonomy-supervised-learning.git
            branches:
              - master

- job:
    name: govuk_taxonomy_supervised_learning
    display-name: Taxonomy Supervised Learning Pipeline
    project-type: freestyle
    description: |
      This job runs the taxonomy supervised learning pipeline
    logrotate:
      numToKeep: 20
    scm:
      - govuk-taxonomy-supervised-learning
    triggers:
        - timed: 'H 2 * * 1-5'
    builders:
      - shell: |
          #!/bin/bash
          git checkout -B ${GIT_BRANCH} origin/${GIT_BRANCH}

          rm -rf ./venv
          virtualenv --python=python3 --no-site-packages ./venv
          export VIRTUAL_ENV="$PWD/venv"
          export PATH="$PWD/venv/bin:$PATH"
          pip3 install --upgrade pip

          make pip_install

          export PLEK_SERVICE_RUMMAGER_URI=https://<%= @rummager_api %>
          export PLEK_SERVICE_DRAFT_CONTENT_STORE_URI=https://<%= @draft_content_store_api %>

          make clean
          make data/taxons.json.gz
          make data/content.json.gz
          make measure_average_taxons
    parameters:
        - string:
            name: GIT_BRANCH
            description: The Git branch of the govuk-taxonomy-supervised-learning repository to use.
            default: master

---
- scm:
    name: govuk-taxonomy-supervised-learning
    scm:
        - git:
            url: git@github.com:alphagov/govuk-taxonomy-supervised-learning.git
            branches:
              - master

- job:
    name: govuk_taxonomy_supervised_learning
    display-name: Taxonomy Supervised Learning Pipeline
    project-type: freestyle
    description: |
      This job runs the taxonomy supervised learning pipeline
    logrotate:
      numToKeep: 20
    scm:
      - govuk-taxonomy-supervised-learning
    triggers:
        - timed: 'H 2 * * 1-5'
    builders:
      - shell: |
          #!/bin/bash
          git checkout -B ${GIT_BRANCH} origin/${GIT_BRANCH}

          export PLEK_SERVICE_RUMMAGER_URI=https://<%= @rummager_api %>
          export PLEK_SERVICE_DRAFT_CONTENT_STORE_URI=https://<%= @draft_content_store_api %>

          source bin/govuk_taxonomy_supervised_learning_jenkins_script
    parameters:
        - string:
            name: GIT_BRANCH
            description: The Git branch of the govuk-taxonomy-supervised-learning repository to use.
            default: master

Simplify the govuk_taxonomy_supervised_learning Jenkins job
Simplify the govuk_taxonomy_supervised_learning Jenkins job

Most of the stuff is worth keeping in the
govuk-taxonomy-supervised-learning repository, so that it's easier to change.
