github.com/franc20/ayesa_sap@v7.0.0-beta.28.0.20200124003224-302d4d52fa6c+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 -v bosh-lite-gcp-json-key="$(lpass show Shared-CLI/bosh-service-account-gcp-creds --notes | jq -c . )" \ 26 -v bosh-lite-storage-bucket=bosh-lites \ 27 -v bosh-lite-project-id=cf-cli \ 28 -v bosh-lite-dns-zone-name=bosh-lite-pool \ 29 -v bosh-lite-system-domain-suffix=lite.cli.fun 30 } 31 32 configure_v7_infrastructure_pipeline() { 33 local name=$1 34 local creds=$2 35 local potato=$3 36 37 printf "configuring the $name pipeline...\n" 38 39 fly -t ci set-pipeline \ 40 -p $name \ 41 -c $pipelines_path/infrastructure/v7-pipeline.yml \ 42 -l <(lpass show "Concourse Credentials" --notes) \ 43 -l <(lpass show "$creds" --notes) \ 44 -v pool-name=$potato 45 } 46 47 48 check_installed lpass 49 check_installed fly 50 51 # Make sure we're up to date and that we're logged in. 52 lpass sync 53 54 pipelines_path=$(cd $(dirname $0)/.. && pwd) 55 56 configure_pipeline V7 $pipelines_path/cli-v7/pipeline.yml 57 58 configure_v7_infrastructure_pipeline inf-delfina delfina-pipeline mashed-potato 59 configure_v7_infrastructure_pipeline inf-nopa nopa-pipeline mashed-potato 60 configure_v7_infrastructure_pipeline inf-zerozero zerozero-pipeline mashed-potato 61 configure_v7_infrastructure_pipeline inf-zuni zuni-pipeline mashed-potato