Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8392763
watch-vagrant-conf
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
watch-vagrant-conf
View Options
#!/bin/bash
set
-e
TMPDIR
=
${
1
-/var/tmp/puppet
}
PUPPET_ENV
=
$(
readlink
-f
$(
dirname
$0
)
/..
)
RSYNC_PARAMS
=
"-a --progress"
EXCLUDES
=
".git .vagrant"
EXCLUDES_PARAMS
=
""
ENVIRONMENTS
=
"production staging"
for
ex
in
${
EXCLUDES
}
;
do
EXCLUDES_PARAMS
=
"
${
EXCLUDES_PARAMS
}
--exclude
$ex
"
done
function
sync_puppet_conf
{
branch
=
$1
rsync
$RSYNC_PARAMS
$EXCLUDES_PARAMS
swh-site/manifests/
$TMPDIR
/environments/
${
branch
}
/manifests/
rsync
$RSYNC_PARAMS
$EXCLUDES_PARAMS
swh-site/data/
$TMPDIR
/environments/
${
branch
}
/data
rsync
$RSYNC_PARAMS
$EXCLUDES_PARAMS
swh-site/site-modules/
$TMPDIR
/environments/
${
branch
}
/site-modules/
rsync
$RSYNC_PARAMS
$EXCLUDES_PARAMS
private/swh-private-data-censored/
$TMPDIR
/environments/
${
branch
}
/data/private
}
# Initial sync
sync_puppet_conf
while
true
;
do
inotifywait
-q
-r
-e
modify
-e
moved_to
-e
moved_from
-e
move
-e
create
$EXCLUDES_PARAMS
${
PUPPET_ENV
}
echo
Update
detected,
synchronizing....
sleep
.5
for
environment
in
${
ENVIRONMENTS
}
;
do
echo
"** Syncing
${
environment
}
environmemt"
sync_puppet_conf
${
environment
}
done
CMD
=
"vagrant rsync pergamon"
$CMD
&&
echo
$CMD
&&
notify-send
--expire-time
=
10000
"
$CMD
done!"
done
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Jun 4 2025, 7:02 PM (10 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3343499
Attached To
rSENV Puppet Environment
Event Timeline
Log In to Comment