Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compose.libre.sh
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
ecobytes
compose.libre.sh
Commits
cb4703ee
Commit
cb4703ee
authored
10 years ago
by
Pierre Ozoux
Browse files
Options
Downloads
Patches
Plain Diff
Removes discovery unit file
parent
fe9dcb2c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
unit-files/discovery@.service
+0
-25
0 additions, 25 deletions
unit-files/discovery@.service
unit-files/web@.service
+4
-3
4 additions, 3 deletions
unit-files/web@.service
with
4 additions
and
28 deletions
unit-files/discovery@.service
deleted
100644 → 0
+
0
−
25
View file @
fe9dcb2c
[Unit]
Description
=
%p for %i etcd registration
# Requirements
Requires
=
etcd.service
# Dependency binding
BindsTo
=
web@%i.service
[Service]
ExecStart
=
/bin/bash -c '
\
sleep 30;
\
while true; do
\
ip=`docker inspect --format \'{{.NetworkSettings.IPAddress}}\' %i`;
\
curl -f $ip;
\
if [ $? -eq 0 ]; then
\
etcdctl set /services/web/%i \'{"ip":"\'$ip\'", "port":"80"}\' --ttl 60;
\
else
\
etcdctl rm /services/web/%i;
\
fi;
\
sleep 50;
\
done'
ExecStop
=
-/usr/bin/etcdctl rm /services/web/%i
This diff is collapsed.
Click to expand it.
unit-files/web@.service
+
4
−
3
View file @
cb4703ee
...
...
@@ -3,12 +3,10 @@ Description=%p-%i
# Requirements
Requires
=
docker.service
Requires
=
discovery@%i.service
Requires
=
backup@%i.timer
# Dependency ordering
After
=
docker.service
Before
=
discovery@%i.service
Before
=
backup@%i.timer
[Service]
...
...
@@ -30,6 +28,9 @@ ExecStart=/bin/bash -euxc ' \
-v /data/runtime/domains/%i/log/apache2:/var/log/apache2
\
${DOCKER_ARGUMENTS}
\
pierreozoux/${APPLICATION}'
ExecReload
=
/usr/bin/docker restart %i
ExecStartPost
=
/bin/bash -c '
\
ip=`docker inspect --format \'{{.NetworkSettings.IPAddress}}\' %i`;
\
/usr/bin/etcdctl --peers 172.17.42.1:4001 set /services/web/%i \'{"ip":"\'$ip\'", "port":"80"}\'
ExecStop
=
/usr/bin/docker stop %i
ExecStopPost
=
-/usr/bin/etcdctl --peers 172.17.42.1:4001 rm /services/web/%i
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