-
Notifications
You must be signed in to change notification settings - Fork 4
/
install-pipeline.sh
executable file
·41 lines (31 loc) · 1.22 KB
/
install-pipeline.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
#
# Installs Tekton Pipelines using the first argument as target version.
#
shopt -s inherit_errexit
set -eu -o pipefail
source "$(dirname ${BASH_SOURCE[0]})/common.sh"
source "$(dirname ${BASH_SOURCE[0]})/inputs.sh"
function _kubectl() {
set -x
eval "kubectl ${*}"
set +x
}
readonly url=$(get_release_artifact_url "tektoncd/pipeline" ${INPUT_PIPELINE_VERSION})
phase "Deploying Tekton Pipelines '${INPUT_PIPELINE_VERSION}'"
_kubectl apply -f ${url}
phase "Waiting for Tekton components"
rollout_status "${TEKTON_NAMESPACE}" "tekton-pipelines-controller"
rollout_status "${TEKTON_NAMESPACE}" "tekton-pipelines-webhook"
# graceful wait to give some more time for the tekton componets stabilize
sleep 30
phase "Setting up the feature-flag(s): '${INPUT_FEATURE_FLAGS}"
if [[ -n "${INPUT_FEATURE_FLAGS}" && "${INPUT_FEATURE_FLAGS}" != "{}" ]]; then
_kubectl patch configmap/feature-flags \
--namespace="${TEKTON_NAMESPACE}" \
--type=merge \
--patch="'{ \"data\": ${INPUT_FEATURE_FLAGS} }'"
# after patching the feature flags, making sure the rollout is not progressing again
rollout_status "${TEKTON_NAMESPACE}" "tekton-pipelines-controller"
rollout_status "${TEKTON_NAMESPACE}" "tekton-pipelines-webhook"
fi