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
c9e4553d
Commit
c9e4553d
authored
3 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
#111
Update post-checkout hook
parent
d2dc26ed
No related branches found
Branches containing commit
Tags
v2.4.1
v2.4.2
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
start.sh
+10
-3
10 additions, 3 deletions
start.sh
with
10 additions
and
3 deletions
start.sh
+
10
−
3
View file @
c9e4553d
...
...
@@ -247,9 +247,16 @@ if [[ -d .git ]]; then
echo
"#!/bin/sh"
>
.git/hooks/post-checkout
chmod
+x .git/hooks/post-checkout
fi
HOOK_DEFINED
=
$(
grep
/usr/local/bin/update-env .git/hooks/post-checkout
)
if
[[
"
$HOOK_DEFINED
"
=
""
]]
;
then
echo
"docker exec
${
COMPOSE_PROJECT_NAME
}
_l3d /usr/local/bin/update-env"
>>
.git/hooks/post-checkout
OLDCOMMAND
=
'docker exec '
${
COMPOSE_PROJECT_NAME
}
'_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'
OLD_HOOK_DEFINED
=
$(
grep
"
$OLDCOMMAND
"
.git/hooks/post-checkout
)
NEW_HOOK_DEFINED
=
$(
grep
"
$NEWCOMMAND
"
.git/hooks/post-checkout
)
if
[[
"x
$OLD_HOOK_DEFINED
"
=
"x"
]]
;
then
echo
"
$NEWCOMMAND
"
>>
.git/hooks/post-checkout
elif
[[
"x
$NEW_HOOK_DEFINED
"
=
"x"
]]
;
then
OLDCOMMAND
=
"
${
OLDCOMMAND
//\//\\/
}
"
sed
-i
-e
"/
${
OLDCOMMAND
}
/d"
.git/hooks/post-checkout
echo
"
$NEWCOMMAND
"
>>
.git/hooks/post-checkout
fi
fi
/usr/local/bin/update-env
...
...
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