Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Denz
opsgenie_heartbeat
Commits
0d3e5065
Commit
0d3e5065
authored
Oct 22, 2019
by
Sebastian Denz
Browse files
inital commit
parent
bed214c1
Pipeline
#8484
passed with stage
in 49 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
0 → 100644
View file @
0d3e5065
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
Dockerfile
0 → 100644
View file @
0d3e5065
FROM
alpine:latest
MAINTAINER
Sebastian Denz
COPY
heartbeat.sh .
CMD
["./heartbeat.sh"]
heartbeat.sh
0 → 100755
View file @
0d3e5065
#!/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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment