github.com/willmadison/cli@v6.40.1-0.20181018160101-29d5937903ff+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 "VAT Concourse Credentials" --notes)
    24  }
    25  
    26  # configure_infrastructure_pipeline() {
    27  #   local name=$1
    28  #   local creds=$2
    29  #   local potato=$3
    30  
    31  #   printf "configuring the $name pipeline...\n"
    32  
    33  #   fly -t ci set-pipeline \
    34  #     -p $name \
    35  #     -c $pipelines_path/infrastructure/pipeline.yml \
    36  #     -l <(lpass show "Concourse Credentials" --notes) \
    37  #     -l <(lpass show "$creds" --notes) \
    38  #     -v pool-name=$potato
    39  # }
    40  
    41  check_installed lpass
    42  check_installed fly
    43  
    44  # Make sure we're up to date and that we're logged in.
    45  lpass sync
    46  
    47  pipelines_path=$(cd $(dirname $0)/.. && pwd)
    48  
    49  configure_pipeline V7 $pipelines_path/cli-v7/pipeline.yml
    50  
    51  # configure_infrastructure_pipeline inf-beque beque-pipeline baked-potato