Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nginx-proxy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hebotek
nginx-proxy
Commits
f78c49dd
Commit
f78c49dd
authored
Nov 25, 2021
by
Florian Heder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEATURE] Add Running Test
parent
54ea6d74
Pipeline
#1351
passed with stages
in 14 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
0 deletions
+60
-0
.gitlab-ci.yml
.gitlab-ci.yml
+16
-0
testIfRunning.sh
testIfRunning.sh
+44
-0
No files found.
.gitlab-ci.yml
View file @
f78c49dd
...
...
@@ -2,6 +2,7 @@ stages:
-
clone
-
pull
-
restart
-
test
cloneTest
:
...
...
@@ -37,6 +38,20 @@ restartTest:
-
cd ~/$CI_PROJECT_NAME
script
:
-
docker-compose restart
-
docker-compose up -d
only
:
-
develop
tags
:
-
play4-runner
testTest
:
stage
:
test
before_script
:
-
cd ~/$CI_PROJECT_NAME
script
:
-
sleep 1
-
/bin/bash testIfRunning.sh play4.hebotek.at
only
:
-
develop
tags
:
...
...
@@ -100,6 +115,7 @@ restartProduction:
-
cd ~/$CI_PROJECT_NAME
script
:
-
docker-compose restart
-
docker-compose up -d
only
:
-
master
tags
:
...
...
testIfRunning.sh
0 → 100755
View file @
f78c49dd
#!/bin/bash
# add website with protocol
#monitorWebsites=(
# https://play4.hebotek.at/
# https://staging.jeunesse.at/
# https://www.oevs.or.at/
#)
monitorWebsites
=(
"
$@
"
)
# add email addresses
email_to
=
"florian.heder@hebotek.at,alexander.bohn@hebotek.at"
##
tempCheckFile
=
/tmp/checkOnlineFile.log
monitor
()
{
/usr/bin/curl
-sI
$1
&>
$tempCheckFile
return
$(
head
-n
1
$tempCheckFile
|
grep
200 |
wc
-l
)
}
mailto
()
{
email_subject
=
"Fatal Error reaching
$f
"
mailInfo+
=
"[!]
$f
is not reachable any more"
mailInfo+
=
"[!] Fatal Error occurred on
$(
date
)
!"
# echo -e "$mailInfo" | mail -s "$email_subject" "$email_to"
echo
$mailInfo
exit
1
}
for
f
in
${
monitorWebsites
[*]
}
;
do
monitor
$f
if
[
$?
-eq
0
]
;
then
mailto
;
else
echo
$f
works!
fi
done
Write
Preview
Markdown
is supported
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