github.com/randomtask1155/cli@v6.41.1-0.20181227003417-a98eed78cbde+incompatible/ci/bin/reconfigure-v7-pipelines (about)

     1  #!/usr/bin/env bash
     2  
     3  set -e
     4  set -o pipefail
     5  
     6  check_installed() {
     7    if ! command -v $1 > /dev/null 2>&1; then
     8      printf "$1 must be installed before running this script!"
     9      exit 1
    10    fi
    11  }
    12  
    13  configure_pipeline() {
    14    local name=$1
    15    local pipeline=$2
    16  
    17    printf "configuring the $name pipeline...\n"
    18  
    19    fly -t ci set-pipeline \
    20      -p $name \
    21      -c $pipeline \
    22      -l <(lpass show "Concourse Credentials" --notes) \
    23      -l <(lpass show "Shared-CLI/Concourse/Concourse Credentials" --notes) \
    24      -l <(lpass show "VAT Concourse Credentials" --notes)
    25  }
    26  
    27  configure_v7_infrastructure_pipeline() {
    28    local name=$1
    29    local creds=$2
    30    local potato=$3
    31  
    32    printf "configuring the $name pipeline...\n"
    33  
    34    fly -t ci set-pipeline \
    35      -p $name \
    36      -c $pipelines_path/infrastructure/v7-pipeline.yml \
    37      -l <(lpass show "Concourse Credentials" --notes) \
    38      -l <(lpass show "$creds" --notes) \
    39      -v pool-name=$potato
    40  }
    41  
    42  
    43  check_installed lpass
    44  check_installed fly
    45  
    46  # Make sure we're up to date and that we're logged in.
    47  lpass sync
    48  
    49  pipelines_path=$(cd $(dirname $0)/.. && pwd)
    50  
    51  configure_pipeline V7 $pipelines_path/cli-v7/pipeline.yml
    52  
    53  configure_v7_infrastructure_pipeline inf-delfina delfina-pipeline mashed-potato
    54  configure_v7_infrastructure_pipeline inf-nopa nopa-pipeline mashed-potato