---
- scm:
    name: smokey_Smokey
    scm:
      - git:
          url: git@github.com:alphagov/smokey.git
          branches: [main]

- job:
    name: Smokey
    description: Task to run the smoke tests after each deploy.
    display-name: Smokey
    project-type: freestyle
    scm:
      - smokey_Smokey
    properties:
      - build-discarder:
          days-to-keep: 30
          artifact-num-to-keep: 5
    publishers:
      - trigger-parameterized-builds:
          - project: Success_Passive_Check
            condition: SUCCESS
            predefined-parameters: |
                NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                NSCA_OUTPUT=<%= @service_description %> success
          - project: Failure_Passive_Check
            condition: FAILED
            predefined-parameters: |
                NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                NSCA_OUTPUT=<%= @service_description %> failed
    parameters:
      - string:
          name: TARGET_APPLICATION
          description: Application to target (optional).
    builders:
      - shell: |
          set +x
          export TARGET_PLATFORM=<%= @environment %>
          set -x
          ./jenkins.sh
    wrappers:
      - ansicolor:
          colormap: xterm

---
- scm:
    name: smokey_Smokey
    scm:
      - git:
          url: git@github.com:alphagov/smokey.git
          branches: [main]

- job:
    name: Smokey
    description: Task to run the smoke tests after each deploy.
    display-name: Smokey
    project-type: freestyle
    scm:
      - smokey_Smokey
    properties:
      - build-discarder:
          days-to-keep: 30
          artifact-num-to-keep: 5
    publishers:
      - trigger-parameterized-builds:
          - project: Success_Passive_Check
            condition: SUCCESS
            predefined-parameters: |
                NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                NSCA_OUTPUT=<%= @service_description %> success
          - project: Failure_Passive_Check
            condition: FAILED
            predefined-parameters: |
                NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                NSCA_OUTPUT=<%= @service_description %> failed
    parameters:
      - string:
          name: TARGET_APPLICATION
          description: Application to target (optional).
    builders:
      - shell: |
          set +x
          export TARGET_PLATFORM=<%= @environment %>
          set -x
          ./jenkins.sh
    wrappers:
      - ansicolor:
          colormap: xterm
      - build-name:
          name: '#${BUILD_NUMBER}: ${ENV,var="TARGET_APPLICATION"}'

Make Smokey job names more descriptive
Make Smokey job names more descriptive

Following on from the success of #11455, we can make a similar
change to our Smokey builds, so that it is easy to see whether
a build was for the entire test suite or for a particular app.

When TARGET_APPLICATION is set, it displays in the job name,
otherwise we have an empty string. I couldn't figure out how to
set it to a default, e.g. 'All'.
