aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2020-06-15 12:46:58 +0200
committerLoïc Hoguin <[email protected]>2020-06-15 12:46:58 +0200
commitcf4767bedfdcdcd880adf976b98a85347ec996c2 (patch)
tree453ee47bd3f7861bd464503943aaae2036342fb3
parentf187f2e803f5907e3c684de27ff28b1a9867daf5 (diff)
downloadci-cf4767bedfdcdcd880adf976b98a85347ec996c2.tar.gz
ci-cf4767bedfdcdcd880adf976b98a85347ec996c2.tar.bz2
ci-cf4767bedfdcdcd880adf976b98a85347ec996c2.zip
First draft of a ranch_prometheus_example environment
-rwxr-xr-xranch_prometheus_example.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/ranch_prometheus_example.sh b/ranch_prometheus_example.sh
new file mode 100755
index 0000000..0e96667
--- /dev/null
+++ b/ranch_prometheus_example.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env sh
+
+set -e
+#set -x
+
+NAME=$1
+DIST=archlinux
+RELEASE=current
+ARCH=amd64
+PACKAGES="cronie git sudo erlang-nox make"
+
+for f in ci.d/*; do source "$f"; done
+
+lxc_destroy
+lxc_create $DIST $RELEASE $ARCH
+lxc_wait_for_ip
+pacman_upgrade
+pacman_install $PACKAGES
+archlinux_enable_cron
+
+lxc_do mkdir -p /home/ninenines
+lxc_do git clone https://github.com/juhlig/prometheus_ranch_example /home/ninenines/prometheus_ranch_example
+lxc_do make -C /home/ninenines/prometheus_ranch_example
+
+lxc_do sh -c 'echo "@reboot /home/ninenines/prometheus_ranch_example start" >> tmpcron'
+lxc_do sh -c 'crontab tmpcron'
+lxc_do sh -c 'rm tmpcron'
+
+lxc_restart
+
+lxc_do /usr/bin/env sh -c "until curl http://localhost:8080/metrics ; do sleep 1 ; done"