Commit 0d3e5065 authored by Sebastian Denz's avatar Sebastian Denz
Browse files

inital commit

parent bed214c1
Pipeline #8484 passed with stage
in 49 seconds
build:
image: docker:stable
services:
- docker:dind
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
# DOCKER_HOST: tcp://docker:2375
# DOCKER_DRIVER: overlay2
stage: build
script:
- export
- test -z $CI_COMMIT_TAG || DOCKER_TAG=":$CI_COMMIT_TAG"
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build --build-arg GIT_TAG=$CI_COMMIT_TAG -t $CI_REGISTRY/denzs/opsgenie_heartbeat/image:latest .
- docker tag $CI_REGISTRY/denzs/opsgenie_heartbeat/image:latest $CI_REGISTRY/denzs/opsgenie_heartbeat/image$DOCKER_TAG || true
- docker push $CI_REGISTRY/denzs/opsgenie_heartbeat/image:latest
- docker push $CI_REGISTRY/denzs/opsgenie_heartbeat/image$DOCKER_TAG
FROM alpine:latest
MAINTAINER Sebastian Denz
COPY heartbeat.sh .
CMD ["./heartbeat.sh"]
#!/bin/sh
# uses:
PROMETHEUS="http://10.10.65.38:32090/-/healthy"
ALERTMANAGER="http://10.10.65.38:32092/-/healthy"
APITOKEN="956b4bb7-5bd6-4512-aea2-338b0155b6cb"
if [ "$(curl $PROMETHEUS 2>/dev/null)" != "Prometheus is Healthy." ]
then
echo "prom down!"
exit 1
fi
if [ "$(curl $ALERTMANAGER 2>/dev/null)" != "OK" ]
then
echo "am down!"
exit 1
fi
echo "everything is fine :)"
curl -X GET 'https://api.eu.opsgenie.com/v2/heartbeats/qualis_heartbeat_prod/ping' --header "Authorization: GenieKey $APITOKEN"
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment