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,65 @@
#!/usr/bin/env bash
set -e
set -x
# include common parts
source ./cli/_bootstrap.sh
dc() {
export PROM_VERSION=${PROM_VERSION}
# shellcheck disable=SC2068
docker-compose \
-f docker-compose.yml \
-f docker-compose.build.yml \
$@
}
####
build() {
echo -e "\e[33m building the image\e[39m"
dc build
}
build_test() {
echo -e "\e[33m testing the image\e[39m"
dc run --rm --entrypoint prometheus prometheus --version | grep ${PROM_VERSION}
#test for smbclient installed
# dc run --rm --user www-data app which smbclient
}
build_save() {
echo -e "\e[33m saving the image\e[39m"
docker tag "$LOCAL_IMAGE:$TAG" "$REMOTE_IMAGE"
docker push "$REMOTE_IMAGE"
}
print_usage() {
printf "Usage: %s: [-b] [-t] [-s] \n" "$0"
echo -b build
echo -t test
echo -s push to registry
echo -h help
exit 0
}
######
if [ -z "$1" ]; then
build && build_test && build_save
exit
fi
while getopts btdhs name
do
case $name in
b) build;;
t) build_test;;
s) build_save;;
*) print_usage;;
esac
done