github.com/cloudfoundry-attic/cli-with-i18n@v6.32.1-0.20171002233121-7401370d3b85+incompatible/ci/bin/reconfigure-release-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 "release-pipeline-concourse-credentials.yml" --notes)
    23  }
    24  
    25  check_installed lpass
    26  check_installed fly
    27  
    28  # Make sure we're up to date and that we're logged in.
    29  lpass sync
    30  
    31  pipelines_path=$(cd $(dirname $0)/.. && pwd)
    32  
    33  configure_pipeline cli \
    34    $pipelines_path/cli-release/pipeline.yml