Pipeline refresh

* Migrate PR pipeline definition into main repo
* Move credentials from LastPass to CredHub
* Reference docker images in tasks to allow use of `fly execute`
* Make use of var templating everywhere to make `fly execute` easier
still
* Move pipelines to `app-broker` Concourse team
* Separate CI management scripts from Concourse task scripts
* Template git-repo-staging user data
* .envrc
* Fix `InMemoryServiceInstanceBindingStateRepositoryTest` failure when
the time rolls over into a new minute during test execution :D

closes #381
This commit is contained in:
Gareth Clay
2020-06-08 14:16:28 +01:00
committed by Gareth Clay
parent 1d3ff3d371
commit 7ca3239ba6
20 changed files with 269 additions and 219 deletions

26
scripts/run-local-ci-job.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -euo pipefail
readonly PROG_DIR=$(readlink -m $(dirname $0))
readonly CI_DIR=$(dirname "${PROG_DIR}")
readonly PROJECT_ROOT=$(dirname "${CI_DIR}")
validate(){
[[ $(type circleci) ]] || (echo "circleci tool not installed" >&2 ; circle_usage ; exit 2)
}
circle_usage() {
cat <<- EOF
Install circle command line tool to run local builds:
"curl -o /usr/local/bin/circleci https://circle-downloads.s3.amazonaws.com/releases/build_agent_wrapper/circleci && \
chmod +x /usr/local/bin/circleci"
EOF
}
run_circle_command(){
cd "${PROJECT_ROOT}"
circleci build
}
validate
run_circle_command

32
scripts/set-pipelines.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -euo pipefail
set_pipeline() {
local pipeline_name pipeline_definition branch release_image_tag
pipeline_name="${1:?pipeline name must be provided}"
pipeline_definition="${2:?pipeline definition file must be provided}"
branch="${3:?branch must be provided}"
release_image_tag="${4:-$branch}"
echo "Setting $pipeline_name pipeline..."
fly --target app-broker set-pipeline \
--pipeline "$pipeline_name" \
--config "$pipeline_definition" \
--load-vars-from config-concourse.yml \
--var "branch=$branch" \
--var "release-image-tag=$release_image_tag"
}
main() {
fly -t app-broker sync
pushd "$(dirname "$0")/../ci" >/dev/null
set_pipeline app-broker-1.1.x pipeline.yml master
set_pipeline app-broker-1.1.x-pr pr-pipeline.yml master
popd >/dev/null
}
main