---
- scm:
    name: govuk-content-api-docs
    scm:
      - git:
          url: git@github.com:alphagov/govuk-content-api-docs.git
          basedir: govuk-content-api-docs
          branches:
            - master
- job:
    name: govuk-content-api-docs
    display-name: Publish GOV.UK Content API Docs
    project-type: freestyle
    description: |
      Builds and publishes the govuk-content-api-docs.
    scm:
      - govuk-content-api-docs
    logrotate:
      numToKeep: 10
      artifactDaysToKeep: 3
    triggers:
      - timed: 'H H * * *'
    properties:
      - build-discarder:
          days-to-keep: 30
          artifact-num-to-keep: 5
    builders:
      - shell: |
          #!/bin/bash
          set -eux

          cd "${WORKSPACE}"

          rm -rf content-store

          git clone -b deployed-to-production https://github.com/alphagov/content-store.git

          cd govuk-content-api-docs

          export BUNDLE_PATH="${HOME}/bundles/${JOB_NAME}"
          mkdir -p $BUNDLE_PATH

          make publish API_SPEC=../content-store/openapi.yaml

          cd ..

          rm -rf content-store

---
- scm:
    name: govuk-content-api-docs
    scm:
      - git:
          url: git@github.com:alphagov/govuk-content-api-docs.git
          basedir: govuk-content-api-docs
          branches:
            - main
- job:
    name: govuk-content-api-docs
    display-name: Publish GOV.UK Content API Docs
    project-type: freestyle
    description: |
      Builds and publishes the govuk-content-api-docs.
    scm:
      - govuk-content-api-docs
    logrotate:
      numToKeep: 10
      artifactDaysToKeep: 3
    triggers:
      - timed: 'H H * * *'
    properties:
      - build-discarder:
          days-to-keep: 30
          artifact-num-to-keep: 5
    builders:
      - shell: |
          #!/bin/bash
          set -eux

          cd "${WORKSPACE}"

          rm -rf content-store

          git clone -b deployed-to-production https://github.com/alphagov/content-store.git

          cd govuk-content-api-docs

          export BUNDLE_PATH="${HOME}/bundles/${JOB_NAME}"
          mkdir -p $BUNDLE_PATH

          make publish API_SPEC=../content-store/openapi.yaml

          cd ..

          rm -rf content-store

Update govuk-content-api-docs job's default branch.
Update govuk-content-api-docs job's default branch.

We are updating the https://github.com/alphagov/govuk-content-api-docs
repo to use `main` as the default branch.
