c3d2-web: fix deploy-c3d2-web.service

This commit is contained in:
Astro 2022-06-18 02:55:11 +02:00
parent 68800b4bb7
commit 8f5414c285
1 changed files with 8 additions and 7 deletions

View File

@ -154,7 +154,11 @@ in
# Build script
systemd.services.deploy-c3d2-web = {
wantedBy = [ "multi-user.target" ];
path = with pkgs; [ git nix curl ];
after = [ "network-online.target" ];
path = with pkgs; [
git nix curl
libxslt libxml2 wget rsync gnumake bash
];
script = ''
# Build at least once
touch ${config.users.users.c3d2-web.home}/deploy-pending
@ -166,6 +170,7 @@ in
cd c3d2-web
git fetch origin
git reset --hard origin/master
git clean -d -f -x
fi
# Loop in case the webhook was called while we were building
@ -182,9 +187,7 @@ in
-H "Content-Type: application/json" \
-d "{ \"context\": \"c3d2-web\", \"description\": \"building...\", \"state\": \"pending\", \"target_url\": \"https://c3d2-web.serv.zentralwerk.org/log/build-$REV.txt\"}"
nix-shell shell.nix \
-I nixpkgs=${nixpkgs} \
--run "make -j$(nproc) export DESTDIR=${webroot}/c3d2" \
make -j$(nproc) export DESTDIR=${webroot}/c3d2 \
2>&1 \
>${webroot}/log/build-$REV.txt
@ -207,9 +210,7 @@ in
-H "Content-Type: application/json" \
-d "{ \"context\": \"c3d2-gemini\", \"description\": \"building...\", \"state\": \"pending\", \"target_url\": \"https://c3d2-web.serv.zentralwerk.org/log/build-gemini-$REV.txt\"}"
nix-shell shell.nix \
-I nixpkgs=${nixpkgs} \
--run "make -f Makefile.gemini -j$(nproc) export DESTDIR=${geminiRoot}" \
make -f Makefile.gemini -j$(nproc) export DESTDIR=${geminiRoot} \
2>&1 \
>${webroot}/log/build-gemini-$REV.txt