prometheus xai cli tool setup WIP

This commit is contained in:
2021-04-02 07:31:03 -04:00
parent 6fcc1866d4
commit 5b0746fcd6
15 changed files with 413 additions and 31 deletions

View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
# see jenkinsfile for version to build
PROM_VERSION=${PROM_VERSION:-v2.25.0}
LOCAL_IMAGE=xaicorp/prometheus
TAG=${PROM_VERSION}-${BUILD_NUMBER:-dev}
REMOTE_IMAGE=dkregistry.xai-corp.net:5000/${LOCAL_IMAGE}:${TAG}
LOG=$(mktemp)
export LOCAL_IMAGE
export REMOTE_IMAGE
export TAG
function trap_exit() {
code=$?
if [ $code -gt 0 ]; then
echo
cat "$LOG"
rm "$LOG"
dc logs --tail=10
dc down
echo -e "\033[31mFailed to build functional image\033[39m"
exit $code
fi
dc down
rm "$LOG"
echo -e "\033[32mSuccess:\033[39m ${LOCAL_IMAGE}:${TAG} successfully built"
}
trap trap_exit EXIT