<commit_before>---
groups:
- name: main
  jobs:
  - build
  - test-cf-cli-v6
  - test-cf-cli-v7
  - test-cf-cli-v8
  - scan-image
  - shipit
  - bump-patch
- name: manage
  jobs:
  - bump-*
  - setup
  - cleanup-failed-tests
- name: all
  jobs:
  - build
  - test-*
  - scan-image
  - shipit
  - bump-*
  - setup
  - cleanup-failed-tests

jobs:
- name: build
  serial: true
  public: true
  plan:
  - get: cf-cli-resource
    trigger: true
  - task: build
    privileged: true
    file: cf-cli-resource/ci/tasks/build-image.yml
    input_mapping:
      project: cf-cli-resource
  - put: resource-image-dev
    params:
      image: image/image.tar
    get_params: {skip_download: true}

- name: test-cf-cli-v6
  serial: true
  public: true
  plan:
  - in_parallel:
    - get: cf-cli-resource
      passed: [build]
      trigger: true
    - get: resource-image-dev
      passed: [build]
      trigger: true
  - task: test
    image: resource-image-dev
    file: cf-cli-resource/ci/tasks/run-shellspec.yml
    vars:
      ccr-test-jobs: 5
      ccr-cf-cli-version: 6

- name: test-cf-cli-v7
  serial: true
  public: true
  plan:
  - in_parallel:
    - get: cf-cli-resource
      passed: [build]
      trigger: true
    - get: resource-image-dev
      passed: [build]
      trigger: true
  - task: test
    image: resource-image-dev
    file: cf-cli-resource/ci/tasks/run-shellspec.yml
    vars:
      ccr-test-jobs: 5
      ccr-cf-cli-version: 7

- name: test-cf-cli-v8
  serial: true
  public: true
  plan:
  - in_parallel:
    - get: cf-cli-resource
      passed: [build]
      trigger: true
    - get: resource-image-dev
      passed: [build]
      trigger: true
  - task: test
    image: resource-image-dev
    file: cf-cli-resource/ci/tasks/run-shellspec.yml
    vars:
      ccr-test-jobs: 5
      ccr-cf-cli-version: 8

- name: scan-image
  plan:
  - in_parallel:
    - get: cf-cli-resource
      passed: [test-cf-cli-v6, test-cf-cli-v7, test-cf-cli-v8]
    - get: resource-image-dev
      resource: resource-image-dev
      passed: [test-cf-cli-v6, test-cf-cli-v7, test-cf-cli-v8]
      params: {format: oci}
      trigger: true
    - get: trivy
      trigger: true
    - get: trivy-db
      trigger: true
      params:
        globs:
        - trivy-offline.db.tgz
  - task: scan
    image: trivy
    config:
      platform: linux
      inputs:
      - name: cf-cli-resource
      - name: resource-image-dev
        path: image
      - name: trivy-db
      run:
        path: sh
        args:
        - -c
        - |
          mkdir db
          tar -xzf trivy-db/trivy-offline.db.tgz -C ./db

          trivy \
            --cache-dir $(pwd) \
            image \
            --severity "HIGH,CRITICAL" \
            --ignore-unfixed \
            --exit-code 1 \
            --input image/image.tar \
            --skip-files opt/cf-cli-7.4.0/cf7

- name: shipit
  public: true
  serial_groups: [version]
  plan:
  - in_parallel:
    - get: cf-cli-resource
      passed: [scan-image]
    - get: resource-image-dev
      passed: [scan-image]
      params: {format: oci}
    - get: version
      params: {bump: final}
  - load_var: version-number
    file: version/version
  - task: prepare-github-release
    file: cf-cli-resource/ci/tasks/prepare-github-release.yml
  - put: github-release
    params:
      name: release-output/release-name
      tag: release-output/release-tag
      commitish: release-output/commitish
      body: release-output/RELEASE_NOTES.md
  - put: version
    params: {file: version/version}
  - put: resource-image-final
    inputs: [resource-image-dev, version]<commit_msg>skip image scan of cf8 binary<commit_after>---
groups:
- name: main
  jobs:
  - build
  - test-cf-cli-v6
  - test-cf-cli-v7
  - test-cf-cli-v8
  - scan-image
  - shipit
  - bump-patch
- name: manage
  jobs:
  - bump-*
  - setup
  - cleanup-failed-tests
- name: all
  jobs:
  - build
  - test-*
  - scan-image
  - shipit
  - bump-*
  - setup
  - cleanup-failed-tests

jobs:
- name: build
  serial: true
  public: true
  plan:
  - get: cf-cli-resource
    trigger: true
  - task: build
    privileged: true
    file: cf-cli-resource/ci/tasks/build-image.yml
    input_mapping:
      project: cf-cli-resource
  - put: resource-image-dev
    params:
      image: image/image.tar
    get_params: {skip_download: true}

- name: test-cf-cli-v6
  serial: true
  public: true
  plan:
  - in_parallel:
    - get: cf-cli-resource
      passed: [build]
      trigger: true
    - get: resource-image-dev
      passed: [build]
      trigger: true
  - task: test
    image: resource-image-dev
    file: cf-cli-resource/ci/tasks/run-shellspec.yml
    vars:
      ccr-test-jobs: 5
      ccr-cf-cli-version: 6

- name: test-cf-cli-v7
  serial: true
  public: true
  plan:
  - in_parallel:
    - get: cf-cli-resource
      passed: [build]
      trigger: true
    - get: resource-image-dev
      passed: [build]
      trigger: true
  - task: test
    image: resource-image-dev
    file: cf-cli-resource/ci/tasks/run-shellspec.yml
    vars:
      ccr-test-jobs: 5
      ccr-cf-cli-version: 7

- name: test-cf-cli-v8
  serial: true
  public: true
  plan:
  - in_parallel:
    - get: cf-cli-resource
      passed: [build]
      trigger: true
    - get: resource-image-dev
      passed: [build]
      trigger: true
  - task: test
    image: resource-image-dev
    file: cf-cli-resource/ci/tasks/run-shellspec.yml
    vars:
      ccr-test-jobs: 5
      ccr-cf-cli-version: 8

- name: scan-image
  plan:
  - in_parallel:
    - get: cf-cli-resource
      passed: [test-cf-cli-v6, test-cf-cli-v7, test-cf-cli-v8]
    - get: resource-image-dev
      resource: resource-image-dev
      passed: [test-cf-cli-v6, test-cf-cli-v7, test-cf-cli-v8]
      params: {format: oci}
      trigger: true
    - get: trivy
      trigger: true
    - get: trivy-db
      trigger: true
      params:
        globs:
        - trivy-offline.db.tgz
  - task: scan
    image: trivy
    config:
      platform: linux
      inputs:
      - name: cf-cli-resource
      - name: resource-image-dev
        path: image
      - name: trivy-db
      run:
        path: sh
        args:
        - -c
        - |
          mkdir db
          tar -xzf trivy-db/trivy-offline.db.tgz -C ./db

          trivy \
            --cache-dir $(pwd) \
            image \
            --severity "HIGH,CRITICAL" \
            --ignore-unfixed \
            --exit-code 1 \
            --input image/image.tar \
            --skip-files opt/cf-cli-7.4.0/cf7 \
            --skip-files opt/cf-cli-8.3.0/cf8

- name: shipit
  public: true
  serial_groups: [version]
  plan:
  - in_parallel:
    - get: cf-cli-resource
      passed: [scan-image]
    - get: resource-image-dev
      passed: [scan-image]
      params: {format: oci}
    - get: version
      params: {bump: final}
  - load_var: version-number
    file: version/version
  - task: prepare-github-release
    file: cf-cli-resource/ci/tasks/prepare-github-release.yml
  - put: github-release
    params:
      name: release-output/release-name
      tag: release-output/release-tag
      commitish: release-output/commitish
      body: release-output/RELEASE_NOTES.md
  - put: version
    params: {file: version/version}
  - put: resource-image-final
    inputs: [resource-image-dev, version]
{'fraction_non_alphanumeric': 0.12685337726523888, 'fraction_numerical': 0.00700164744645799, 'mean_word_length': 1.7815960290187094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1142987', 'n_tokens_mistral': 2677, 'n_tokens_neox': 2610, 'n_words': 562}