Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LakeDropsDrupalDev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
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
Docker
LakeDropsDrupalDev
Commits
4e71bddc
Commit
4e71bddc
authored
1 year ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
gitlab-drupal-ci#48
Make L3D container names user specific
parent
2390e2f2
No related branches found
Branches containing commit
Tags
test3
Tags containing commit
1 merge request
!39
Merging develop into main
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
run/scripts/dir
+1
-1
1 addition, 1 deletion
run/scripts/dir
run/scripts/start
+5
-5
5 additions, 5 deletions
run/scripts/start
setup/scripts/l3d
+1
-1
1 addition, 1 deletion
setup/scripts/l3d
start.sh
+3
-3
3 additions, 3 deletions
start.sh
with
10 additions
and
10 deletions
run/scripts/dir
+
1
−
1
View file @
4e71bddc
#!/bin/bash
#!/bin/bash
if
[[
-n
$1
]]
;
then
if
[[
-n
$1
]]
;
then
docker inspect
${
1
}
_l3d | jq
-r
.[0].Config.Env |
grep
L3DHOSTDIR |
cut
-d
'='
-f
2 |
cut
-d
'"'
-f
1
docker inspect
${
1
}
_
${
USERNAME
}
_
l3d | jq
-r
.[0].Config.Env |
grep
L3DHOSTDIR |
cut
-d
'='
-f
2 |
cut
-d
'"'
-f
1
fi
fi
This diff is collapsed.
Click to expand it.
run/scripts/start
+
5
−
5
View file @
4e71bddc
...
@@ -51,9 +51,9 @@ function startContainer() {
...
@@ -51,9 +51,9 @@ function startContainer() {
if
[[
$COMPOSE_PROJECT_NAME
==
"."
]]
;
then
if
[[
$COMPOSE_PROJECT_NAME
==
"."
]]
;
then
mode
=
NONPRESISTENT
mode
=
NONPRESISTENT
else
else
ID
=
$(
docker container
ls
--all
-q
-f
name
=
^
${
COMPOSE_PROJECT_NAME
}
_l3d
$)
ID
=
$(
docker container
ls
--all
-q
-f
name
=
^
${
COMPOSE_PROJECT_NAME
}
_
${
USERNAME
}
_
l3d
$)
if
[[
-n
${
ID
}
]]
;
then
if
[[
-n
${
ID
}
]]
;
then
docker start
${
COMPOSE_PROJECT_NAME
}
_l3d
docker start
${
COMPOSE_PROJECT_NAME
}
_
${
USERNAME
}
_
l3d
mode
=
REGULAR
mode
=
REGULAR
fi
fi
fi
fi
...
@@ -98,7 +98,7 @@ function startContainer() {
...
@@ -98,7 +98,7 @@ function startContainer() {
start_params+
=(
start_params+
=(
--hostname
${
COMPOSE_PROJECT_NAME
}
-l3d
--hostname
${
COMPOSE_PROJECT_NAME
}
-l3d
)
)
docker run
--name
${
COMPOSE_PROJECT_NAME
}
_l3d
-dt
\
docker run
--name
${
COMPOSE_PROJECT_NAME
}
_
${
USERNAME
}
_
l3d
-dt
\
"
${
start_params
[@]
}
"
\
"
${
start_params
[@]
}
"
\
--restart
unless-stopped
\
--restart
unless-stopped
\
registry.lakedrops.com/docker/l3d/php-
${
PHP_VERSION
}
:
${
L3DVERSION
}
registry.lakedrops.com/docker/l3d/php-
${
PHP_VERSION
}
:
${
L3DVERSION
}
...
@@ -137,7 +137,7 @@ function startContainer() {
...
@@ -137,7 +137,7 @@ function startContainer() {
fi
fi
docker
exec
-it
\
docker
exec
-it
\
"
${
start_params
[@]
}
"
\
"
${
start_params
[@]
}
"
\
${
COMPOSE_PROJECT_NAME
}
_l3d
\
${
COMPOSE_PROJECT_NAME
}
_
${
USERNAME
}
_
l3d
\
/usr/local/bin/.start
/usr/local/bin/.start
exitContainer
exitContainer
fi
fi
...
@@ -147,7 +147,7 @@ if [[ -n $1 ]]; then
...
@@ -147,7 +147,7 @@ if [[ -n $1 ]]; then
if
[[
"
$1
"
==
"."
]]
;
then
if
[[
"
$1
"
==
"."
]]
;
then
COMPOSE_PROJECT_NAME
=
.
COMPOSE_PROJECT_NAME
=
.
else
else
ID
=
$(
docker container
ls
--all
-q
-f
name
=
^
$1_l3d$)
ID
=
$(
docker container
ls
--all
-q
-f
name
=
^
$1_
${
USERNAME
}
_
l3d
$)
if
[[
-n
${
ID
}
]]
;
then
if
[[
-n
${
ID
}
]]
;
then
PHP_VERSION
=
unknown
PHP_VERSION
=
unknown
COMPOSE_PROJECT_NAME
=
$1
COMPOSE_PROJECT_NAME
=
$1
...
...
This diff is collapsed.
Click to expand it.
setup/scripts/l3d
+
1
−
1
View file @
4e71bddc
...
@@ -81,7 +81,7 @@ fi
...
@@ -81,7 +81,7 @@ fi
# Chenge directory to the existing project root, if available.
# Chenge directory to the existing project root, if available.
if
[[
-n
$1
]]
;
then
if
[[
-n
$1
]]
;
then
ID
=
$(
docker container
ls
--all
-q
-f
name
=
^
$1_l3d$)
ID
=
$(
docker container
ls
--all
-q
-f
name
=
^
$1_
${
USERNAME
}
_
l3d
$)
if
[[
-n
${
ID
}
]]
;
then
if
[[
-n
${
ID
}
]]
;
then
cd
$(
docker
exec
${
ID
}
php /usr/local/bin/volume.php
--none
)
cd
$(
docker
exec
${
ID
}
php /usr/local/bin/volume.php
--none
)
fi
fi
...
...
This diff is collapsed.
Click to expand it.
start.sh
+
3
−
3
View file @
4e71bddc
...
@@ -250,7 +250,7 @@ if [[ "$INSTALLED_PHP_VERSION" != "$PHP_VERSION" ]]; then
...
@@ -250,7 +250,7 @@ if [[ "$INSTALLED_PHP_VERSION" != "$PHP_VERSION" ]]; then
if
[[
"
${
COMPOSE_PROJECT_NAME
}
"
!=
"."
]]
;
then
if
[[
"
${
COMPOSE_PROJECT_NAME
}
"
!=
"."
]]
;
then
echo
-e
"
\\
033[31m Killed the outdated container, please start again !!!
\\
033[0m"
echo
-e
"
\\
033[31m Killed the outdated container, please start again !!!
\\
033[0m"
echo
-e
"
\\
033[31m =====================================================
\\
033[0m"
echo
-e
"
\\
033[31m =====================================================
\\
033[0m"
docker
rm
-f
${
COMPOSE_PROJECT_NAME
}
_l3d
docker
rm
-f
${
COMPOSE_PROJECT_NAME
}
_
${
USERNAME
}
_
l3d
fi
fi
fi
fi
if
[[
"
$COMPOSER_DOWNGRADE
"
==
"1"
]]
;
then
if
[[
"
$COMPOSER_DOWNGRADE
"
==
"1"
]]
;
then
...
@@ -286,8 +286,8 @@ if [[ "${COMPOSE_PROJECT_NAME}" != "." ]]; then
...
@@ -286,8 +286,8 @@ if [[ "${COMPOSE_PROJECT_NAME}" != "." ]]; then
echo
"#!/bin/sh"
>
.git/hooks/post-checkout
echo
"#!/bin/sh"
>
.git/hooks/post-checkout
chmod
+x .git/hooks/post-checkout
chmod
+x .git/hooks/post-checkout
fi
fi
OLDCOMMAND
=
'docker exec '
${
COMPOSE_PROJECT_NAME
}
'_l3d /usr/local/bin/update-env'
OLDCOMMAND
=
'docker exec '
${
COMPOSE_PROJECT_NAME
}
'_
'
${
USERNAME
}
'_
l3d /usr/local/bin/update-env'
NEWCOMMAND
=
'RUNNING=$(docker container ls --all -q -f name='
${
COMPOSE_PROJECT_NAME
}
'_l3d);if [ "x$RUNNING" != "x" ];then docker exec '
${
COMPOSE_PROJECT_NAME
}
'_l3d /usr/local/bin/update-env;fi'
NEWCOMMAND
=
'RUNNING=$(docker container ls --all -q -f name='
${
COMPOSE_PROJECT_NAME
}
'_
'
${
USERNAME
}
_
'
l3d);if [ "x$RUNNING" != "x" ];then docker exec '
${
COMPOSE_PROJECT_NAME
}
'_l3d /usr/local/bin/update-env;fi'
OLD_HOOK_DEFINED
=
$(
grep
"
$OLDCOMMAND
"
.git/hooks/post-checkout
)
OLD_HOOK_DEFINED
=
$(
grep
"
$OLDCOMMAND
"
.git/hooks/post-checkout
)
NEW_HOOK_DEFINED
=
$(
grep
"
$NEWCOMMAND
"
.git/hooks/post-checkout
)
NEW_HOOK_DEFINED
=
$(
grep
"
$NEWCOMMAND
"
.git/hooks/post-checkout
)
if
[[
"x
$OLD_HOOK_DEFINED
"
=
"x"
]]
;
then
if
[[
"x
$OLD_HOOK_DEFINED
"
=
"x"
]]
;
then
...
...
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