promotions:
  # Manual promotion for publishing a hashrelease.
  - name: Publish hashrelease
    pipeline_file: release/hashrelease.yml
    parameters:
      env_vars:
        - required: true
          options:
            - "true"
            - "false"
          default_value: "false"
          description: "Build container images. If 'true', container images will be built as part of the hashrelease process."
          name: BUILD_CONTAINER_IMAGES
        - required: true
          options:
            - "true"
            - "false"
          default_value: "false"
          description: "create tarball of images. If 'true', a tarball of images will be added to the release.tgz. Requires BUILD_CONTAINER_IMAGES to also be 'true'."
          name: ARCHIVE_IMAGES
        - required: true
          options:
            - "true"
            - "false"
          default_value: "false"
          description: "publish images. If 'true', images will be pushed to the container registry/registries as part of the hashrelease process. Requires BUILD_CONTAINER_IMAGES to also be 'true'."
          name: PUBLISH_IMAGES
  # Manual promotion for publishing a release.
  - name: Publish official release
    pipeline_file: release/release.yml
  # Cleanup after ourselves if we are stopped-short.
  - name: Cleanup
    pipeline_file: cleanup.yml
    auto_promote:
      when: "result = 'stopped'"
  # Have separate promotions for publishing images so we can re-run
  # them individually if they fail, and so we can run them in parallel.
  - name: Push apiserver images
    pipeline_file: push-images/apiserver.yml
    auto_promote:
      when: "branch =~ 'master|release-.*'"
  - name: Push ALP images
    pipeline_file: push-images/alp.yml
    auto_promote:
      when: "branch =~ 'master|release-.*'"
  - name: Push calicoctl images
    pipeline_file: push-images/calicoctl.yml
    auto_promote:
      when: "branch =~ 'master|release-.*'"
  - name: Push calico-node images
    pipeline_file: push-images/node.yml
    auto_promote:
      when: "branch =~ 'master|release-.*'"
  - name: Push mock calico-node images
    pipeline_file: push-images/mock-node.yml
    auto_promote:
      when: "branch =~ 'master|release-'"
  - name: Push cni-plugin images
    pipeline_file: push-images/cni-plugin.yml
    auto_promote:
      when: "branch =~ 'master|release-.*'"
  - name: Push key-cert-provisioner images
    pipeline_file: push-images/key-cert-provisioner.yml
    auto_promote:
      when: "branch =~ 'master|release-.*'"
  - name: Push kube-controllers images
    pipeline_file: push-images/kube-controllers.yml
    auto_promote:
      when: "branch =~ 'master|release-.*'"
  - name: Push pod2daemon images
    pipeline_file: push-images/pod2daemon.yml
    auto_promote:
      when: "branch =~ 'master|release-.*'"
  - name: Push typha images
    pipeline_file: push-images/typha.yml
    auto_promote:
      when: "branch =~ 'master|release-.*'"
  - name: Push Goldmane images
    pipeline_file: push-images/goldmane.yml
    auto_promote:
      when: "branch =~ 'master|release-.*'"
  - name: Push Whisker images
    pipeline_file: push-images/whisker.yml
    auto_promote:
      when: "branch =~ 'master|release-.*'"
  - name: Push Whisker Backend images
    pipeline_file: push-images/whisker-backend.yml
    auto_promote:
      when: "branch =~ 'master|release-.*'"
  - name: Push Guardian images
    pipeline_file: push-images/guardian.yml
    auto_promote:
      when: "branch =~ 'master|release-.*'"
  - name: Push Envoy images
    pipeline_file: push-images/envoy.yml
    auto_promote:
      when: "branch =~ 'master|release-.*'"
  - name: Publish openstack packages
    pipeline_file: push-images/packaging.yaml
    auto_promote:
      when: "branch =~ 'master'"
  - name: Run Fossa scans
    pipeline_file: license-scanning/fossa-scan.yml
    auto_promote:
      when: "branch =~ 'master|release-.*'"
  - name: Push E2E images
    pipeline_file: push-images/e2e-test.yml
    auto_promote:
      when: "branch =~ 'master|release-.*'"
