ci render-script improve local handling
@@ -11,7 +11,7 @@ install_kubectl
install_tkn
# retrieve and configure kubeconfig (sets KUBECONFIG env var)
-if [ ! -z ${SECRETS_SERVER_ENDPOINT:-} ]; then
+if [ -z ${KUBECONFIG:-} ] && [ -n ${SECRETS_SERVER_ENDPOINT:-} ]; then
kubecfg
fi
@@ -67,7 +67,14 @@ fi
cleanup_pipelineruns
+# for local dev rendering use latest remote commit and no local one.
+if [ ! -z "${CC_CONFIG_DIR:-}" ]; then
+ # does not work on MacOS:
+ # git ls-remote origin refs/heads/${BRANCH_NAME} | { read head_commit dummy_rest_of_line ; }
+ read head_commit dummy_rest_of_line <<< $(git ls-remote origin refs/heads/${BRANCH_NAME})
+else
head_commit="$(git rev-parse @)"
+fi
echo "head-commit: ${head_commit}"
pipeline_run="$PWD/pipeline_run.yaml"
