Changeset - 2cdebf131674
[Not reviewed]
0 1 0
Ben Sturmfels (bsturmfels) - 8 months ago 2023-10-25 11:56:44
ben@sturm.com.au
Apply directory changes to update script
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
systemd/conservancy-www-update.sh
Show inline comments
...
 
@@ -10,29 +10,29 @@ git_rev_name() {
 
    git rev-parse --abbrev-ref --symbolic-full-name "$@"
 
}
 

	
 
# If the checkout is not on the production branch,
 
# assume maintenance is happening and stop.
 
if [ "$(git_rev_name HEAD)" != "$PRODUCTION_BRANCH" ]; then
 
    exit 0
 
fi
 

	
 
# Abort if the production branch isn't tracking a remote branch.
 
if ! git_upstream="$(git_rev_name '@{upstream}' 2>/dev/null)"; then
 
    exit 3
 
fi
 

	
 
IFS=/ read git_remote git_refspec <<EOF
 
$git_upstream
 
EOF
 
git fetch --quiet --no-tags "$git_remote" "$git_refspec"
 
if [ "$(git rev-parse "$PRODUCTION_BRANCH")" = "$(git rev-parse "$git_upstream")" ]; then
 
    exit 0
 
fi
 

	
 
exitcode=0
 
git merge --quiet --ff-only "${git_remote}/${git_refspec}"
 
python3 -m compileall -q -x - www || exitcode=$?
 
chgrp -R www-data www || exitcode=$?
 
chmod -R g+rX-w,o+X-w www || exitcode=$?
 
chmod -R o+r www/conservancy/static || exitcode=$?
 
python3 -m compileall -q -x - conservancy || exitcode=$?
 
chgrp -R www-data conservancy || exitcode=$?
 
chmod -R g+rX-w,o+X-w conservancy || exitcode=$?
 
chmod -R o+r conservancy/static || exitcode=$?
 
exit "$exitcode"
0 comments (0 inline, 0 general)