Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Imldeployment Client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
Imldeployment Client
Merge requests
!12
detect profile without logfile
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
detect profile without logfile
6877_final_status_in_log
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Hahn Axel (hahn)
requested to merge
6877_final_status_in_log
into
master
1 year ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
949c97b3
1 commit,
1 year ago
1 file
+
22
−
10
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
check_deployment.sh
+
22
−
10
Options
@@ -5,6 +5,7 @@
#
# ----------------------------------------------------------------------
# 2023-12-11 v0.1 <axel.hahn@iml.unibe.ch> first lines...
# 2023-12-14 v0.2 <axel.hahn@iml.unibe.ch> detect profile without logfile
# ======================================================================
# ----------------------------------------------------------------------
@@ -16,6 +17,7 @@ logdir=/var/log/imldeployment-client
tmpfile
=
/tmp/deploystatus.log
typeset
-i
iErrors
=
0
typeset
-i
iUnknown
=
0
typeset
-i
iCount
=
0
# ----------------------------------------------------------------------
@@ -36,25 +38,35 @@ for myprofile in $( getprofiles )
do
iCount+
=
1
logfile
=
$(
ls
-tr1
${
logdir
}
/
${
myprofile
}
__
*
|
tail
-1
)
if
grep
"^OK:
${
myprofile
}
$"
$logfile
>
/dev/null
;
then
echo
"OK:
$myprofile
-
$logfile
"
if
[
-z
"
$logfile
"
]
;
then
echo
"UNKNOWN:
$myprofile
- was created but not rolled yet."
iUnknown+
=
1
else
iErrors+
=
1
echo
"ERROR:
$myprofile
-
$logfile
"
echo
" Last lines:"
tail
-10
"
${
logfile
}
"
|
sed
"s#^# #g"
echo
if
grep
"^OK:
${
myprofile
}
$"
$logfile
>
/dev/null
;
then
echo
"OK:
$myprofile
-
$logfile
"
else
iErrors+
=
1
echo
"ERROR:
$myprofile
-
$logfile
"
echo
" Last lines:"
tail
-10
"
${
logfile
}
"
|
sed
"s#^# #g"
echo
fi
fi
done
>
"
$tmpfile
"
if
[
$iCount
-eq
0
]
;
then
echo
"Deployment No profile was created yet."
echo
"
UNKNOWN:
Deployment No profile was created yet."
else
if
[
$iErrors
-eq
0
]
;
then
echo
-n
"OK"
if
[
$iUnknown
-eq
0
]
;
then
echo
-n
"UNKNOWN"
else
echo
-n
"OK"
fi
else
echo
-n
"ERROR"
fi
echo
" Deployment ... Profiles:
$iCount
... Errors:
$iErrors
"
echo
"
:
Deployment ... Profiles:
$iCount
... Errors:
$iErrors
"
cat
"
$tmpfile
"
fi
rm
-f
"
$tmpfile
"
Loading