k8s.io/test-infra@v0.0.0-20240520184403-27c6b4c223d8/config/jobs/kubernetes/sig-k8s-infra/trusted/sig-k8s-infra-apps.sh (about)

     1  #!/usr/bin/env bash
     2  # Copyright 2021 The Kubernetes Authors.
     3  #
     4  # Licensed under the Apache License, Version 2.0 (the "License");
     5  # you may not use this file except in compliance with the License.
     6  # You may obtain a copy of the License at
     7  #
     8  #     http://www.apache.org/licenses/LICENSE-2.0
     9  #
    10  # Unless required by applicable law or agreed to in writing, software
    11  # distributed under the License is distributed on an "AS IS" BASIS,
    12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  # See the License for the specific language governing permissions and
    14  # limitations under the License.
    15  
    16  # generates sig-k8s-infra app deployment job configs
    17  
    18  set -o errexit
    19  set -o nounset
    20  set -o pipefail
    21  
    22  SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
    23  
    24  readonly OUTPUT="${SCRIPT_DIR}/sig-k8s-infra-apps.yaml"
    25  # list of subdirs in kubernetes/k8s.io/apps
    26  readonly APPS=(
    27      codesearch
    28      elekto
    29      gcsweb
    30      kettle
    31      k8s-io
    32      kubernetes-external-secrets
    33      perfdash
    34      prow
    35      publishing-bot
    36      slack-infra
    37  )
    38  
    39  cat >"${OUTPUT}" <<EOF
    40  # DO NOT EDIT. Automatically generated by $0
    41  
    42  postsubmits:
    43    kubernetes/k8s.io:
    44  EOF
    45  
    46  for app in "${APPS[@]}"; do
    47      cat >>"${OUTPUT}" <<EOF
    48      - name: post-k8sio-deploy-app-${app}
    49        cluster: k8s-infra-prow-build-trusted
    50        decorate: true
    51        max_concurrency: 1
    52        # intended for ignoring changes to README.md or OWNERS
    53        run_if_changed: '^apps\/${app}\/(.*.yaml|deploy.sh)$'
    54        branches:
    55        - ^main$
    56        reporter_config:
    57          slack:
    58            channel: "k8s-infra-alerts"
    59            job_states_to_report:
    60            - success
    61            - failure
    62            - aborted
    63            - error
    64            report_template: 'Deploying ${app}: {{.Status.State}}. Commit: <{{.Spec.Refs.BaseLink}}|{{printf "%.7s" .Spec.Refs.BaseSHA}}> | <{{.Status.URL}}|Spyglass> | <https://testgrid.k8s.io/sig-k8s-infra-apps#deploy-${app}|Testgrid> | <https://prow.k8s.io/?job={{.Spec.Job}}|Deck>'
    65        annotations:
    66          testgrid-create-test-group: 'true'
    67          testgrid-dashboards: sig-k8s-infra-apps
    68          testgrid-tab-name: deploy-${app}
    69          testgrid-description: 'runs https://git.k8s.io/k8s.io/apps/${app}/deploy.sh if files change in kubernetes/k8s.io/apps/${app}'
    70          testgrid-alert-email: k8s-infra-rbac-${app}@kubernetes.io, k8s-infra-alerts@kubernetes.io
    71          testgrid-num-failures-to-alert: '1'
    72        rerun_auth_config:
    73          github_team_slugs:
    74          # proxy for sig-k8s-infra-oncall
    75          - org: kubernetes
    76            slug: sig-k8s-infra-leads
    77          # proxy for test-infra-oncall
    78          - org: kubernetes
    79            slug: test-infra-admins
    80          # TODO: sig-specific team in charge of this app
    81          # - org: kubernetes
    82          #   slug: sig-foo-bar
    83        spec:
    84          serviceAccountName: prow-deployer
    85          containers:
    86          - image: gcr.io/k8s-staging-infra-tools/k8s-infra:latest
    87            command:
    88            - ./apps/${app}/deploy.sh
    89  EOF
    90  done