Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
docker-php-starterkit
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
docker-php-starterkit
Commits
d5c4e8eb
Commit
d5c4e8eb
authored
11 months ago
by
Axel Hahn
Browse files
Options
Downloads
Patches
Plain Diff
init.sh v 1.11 diff with colored output; suppress errors on port check
parent
3720642d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docker/init.sh
+18
-11
18 additions, 11 deletions
docker/init.sh
with
18 additions
and
11 deletions
docker/init.sh
+
18
−
11
View file @
d5c4e8eb
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
# 2023-11-13 v1.8 <axel.hahn@unibe.ch> UNDO "docker compose"; update infos
# 2023-11-13 v1.8 <axel.hahn@unibe.ch> UNDO "docker compose"; update infos
# 2023-11-15 v1.9 <axel.hahn@unibe.ch> add help; execute multiple actions by params; new menu item: open app
# 2023-11-15 v1.9 <axel.hahn@unibe.ch> add help; execute multiple actions by params; new menu item: open app
# 2023-12-07 v1.10 <www.axel-hahn.de> simplyfy console command; add php linter
# 2023-12-07 v1.10 <www.axel-hahn.de> simplyfy console command; add php linter
# 2024-07-01 v1.11 <www.axel-hahn.de> diff with colored output; suppress errors on port check
# ======================================================================
# ======================================================================
cd
$(
dirname
$0
)
cd
$(
dirname
$0
)
...
@@ -23,7 +24,7 @@ cd $( dirname $0 )
...
@@ -23,7 +24,7 @@ cd $( dirname $0 )
# git@git-repo.iml.unibe.ch:iml-open-source/docker-php-starterkit.git
# git@git-repo.iml.unibe.ch:iml-open-source/docker-php-starterkit.git
selfgitrepo
=
"docker-php-starterkit.git"
selfgitrepo
=
"docker-php-starterkit.git"
_version
=
"1.1
0
"
_version
=
"1.1
1
"
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# FUNCTIONS
# FUNCTIONS
...
@@ -211,7 +212,7 @@ function _generateFiles(){
...
@@ -211,7 +212,7 @@ function _generateFiles(){
_fix_no-db
$_tmpfile
_fix_no-db
$_tmpfile
# echo "changes for $target:"
# echo "changes for $target:"
diff
"../
$target
"
"
$_tmpfile
"
|
grep
-v
"
$_md5
"
|
grep
-v
"^---"
|
grep
.
diff
--color
=
always
"../
$target
"
"
$_tmpfile
"
|
grep
-v
"
$_md5
"
|
grep
-v
"^---"
|
grep
.
if
[
$?
-eq
0
-o
!
-f
"../
$target
"
]
;
then
if
[
$?
-eq
0
-o
!
-f
"../
$target
"
]
;
then
echo
-n
"
$mytpl
- changes detected - writing [
$target
] ... "
echo
-n
"
$mytpl
- changes detected - writing [
$target
] ... "
mkdir
-p
$(
dirname
"../
$target
"
)
||
exit
2
mkdir
-p
$(
dirname
"../
$target
"
)
||
exit
2
...
@@ -280,22 +281,28 @@ function _showInfos(){
...
@@ -280,22 +281,28 @@ function _showInfos(){
docker-compose top
docker-compose top
h3
"Check app port"
h3
"Check app port"
>
/dev/tcp/localhost/
${
APP_PORT
}
2>/dev/null
&&
(
if
echo
>
/dev/tcp/localhost/
${
APP_PORT
}
;
then
echo
"OK, app port
${
APP_PORT
}
is reachable"
echo
"OK, app port
${
APP_PORT
}
is reachable"
echo
echo
_showBrowserurl
_showBrowserurl
)
else
echo
"NO, app port
${
APP_PORT
}
is not available"
fi
2>/dev/null
if
[
"
$DB_ADD
"
!=
"false"
]
;
then
if
[
"
$DB_ADD
"
!=
"false"
]
;
then
h3
"Check database port"
h3
"Check database port"
>
/dev/tcp/localhost/
${
DB_PORT
}
>
/dev/null 2>&1
&&
(
if
echo
>
/dev/tcp/localhost/
${
DB_PORT
}
;
then
echo
"OK, db port
${
DB_PORT
}
is reachable"
echo
"OK, db port
${
DB_PORT
}
is reachable"
echo
echo
)
echo
"In a local DB admin tool you can connect it:"
echo
"In a local DB admin tool:"
echo
" host : localhost"
echo
" host : localhost"
echo
" port :
${
DB_PORT
}
"
echo
" port :
${
DB_PORT
}
"
echo
" user : root"
echo
" user : root"
echo
" password:
${
MYSQL_ROOT_PASS
}
"
echo
" password:
${
MYSQL_ROOT_PASS
}
"
else
echo
"NO, db port
${
DB_PORT
}
is not available"
fi
2>/dev/null
fi
fi
echo
echo
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment