-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace cron job with systemd timer so that all relevant events are logged in the same format and rotated accordingly.
- Loading branch information
1 parent
40d50f6
commit 29f875e
Showing
4 changed files
with
39 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
cd /root/web-platform-tests/ | ||
|
||
function parse_git_hash() { | ||
git rev-parse --short HEAD 2> /dev/null | ||
} | ||
|
||
GIT_HEAD=$(parse_git_hash) | ||
|
||
git pull origin master | ||
git pull --quiet origin master | ||
|
||
GIT_NEW_HEAD=$(parse_git_hash) | ||
|
||
|
||
if [ "$GIT_HEAD" != "$GIT_NEW_HEAD" ] | ||
then | ||
echo "web-platform-tests HEAD is now ${GIT_NEW_HEAD} restarting wpt service" | ||
echo "HEAD changed (${GIT_HEAD} -> ${GIT_NEW_HEAD}). Restarting service." | ||
systemctl restart wpt | ||
else | ||
echo "HEAD unchanged (${GIT_HEAD}). Taking no action." | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=Web Platform Test Synchronization Service | ||
After=network.target auditd.service wpt.service | ||
|
||
[Service] | ||
WorkingDirectory=/root/web-platform-tests/ | ||
ExecStart=/root/sync-wpt.sh | ||
KillMode=control-group | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Unit] | ||
Description=Synchronize WPT every 60 seconds | ||
|
||
[Timer] | ||
OnBootSec=0 seconds | ||
OnUnitActiveSec=1 minute | ||
|
||
[Install] | ||
WantedBy=timers.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters