github.com/argoproj/argo-cd/v3@v3.2.1/hack/migrate-gitops-engine/merge.sh (about)

     1  #!/bin/bash
     2  
     3  # Script to collect GitHub handle and branch name from user
     4  
     5  echo "Please provide the following information:"
     6  echo
     7  
     8  # Prompt for GitHub handle
     9  read -r -p "Enter your GitHub handle: " github_handle
    10  
    11  # Validate that GitHub handle is not empty
    12  while [[ -z "$github_handle" ]]; do
    13      echo "GitHub handle cannot be empty."
    14      read -r -p "Enter your GitHub handle: " github_handle
    15  done
    16  
    17  # Prompt for branch name
    18  read -r -p "Enter the branch name: " branch_name
    19  
    20  # Validate that branch name is not empty
    21  while [[ -z "$branch_name" ]]; do
    22      echo "Branch name cannot be empty."
    23      read -r -p "Enter the branch name: " branch_name
    24  done
    25  
    26  echo "Merging migrated gitops-engine branch $branch_name from $github_handle/gitops-engine.git"
    27  
    28  git remote add ge-migrated git@github.com:"$github_handle"/gitops-engine.git
    29  git fetch ge-migrated
    30  
    31  if git merge --no-edit ge-migrated/"$branch_name" --allow-unrelated-histories ; then
    32      sh ./hack/migrate-gitops-engine/replace-vendor.sh
    33      sh ./hack/migrate-gitops-engine/update-dockerfile.sh
    34      echo "Merging of gitops-engine branch $branch_name from $github_handle/gitops-engine.git succeeded"
    35  else
    36      echo "Merging of gitops-engine branch $branch_name from $github_handle/gitops-engine.git failed"
    37      exit 1
    38  fi
    39  
    40