k8s.io/test-infra@v0.0.0-20240520184403-27c6b4c223d8/hack/cluster-migration/update_todo.sh (about)

     1  #!/usr/bin/env sh
     2  # Copyright 2024 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  set -x -e
    17  
    18  # Cd to the root of the repository
    19  cd "$(git rev-parse --show-toplevel)"
    20  
    21  # Run the cluster-migration script to generate the todo report
    22  go run hack/cluster-migration/main.go --config config/prow/config.yaml --job-config config/jobs --todo-report
    23  
    24  # Move the report to the docs folder
    25  mv job-migration-todo.md docs/job-migration-todo.md
    26  
    27  # Commit the changes and open a PR
    28  git config user.name "k8s-infra-ci-robot"
    29  git config user.email "k8s-infra-ci-robot@email.com"
    30  
    31  branch=migration-report-$(date +'%m-%d-%Y')
    32  git checkout -b $branch
    33  
    34  git add docs/job-migration-todo.md
    35  git commit -m "Update job migration todo report $(date +'%m-%d-%Y')"
    36  git remote add k8s-infra-ci-robot git@github.com:k8s-infra-ci-robot/test-infra.git
    37  git push -f k8s-infra-ci-robot ${branch}
    38  
    39  gh pr create --fill --base master --head k8s-infra-ci-robot:${branch}