commit ddb29f0f5572c4206f51ebc64cd798aed89c7155 parent 2f495b3bf042eb81b0bcb7c11e56ed191764e8db Author: hrryt <harry@mayesfield.uk> Date: Wed, 16 Sep 2026 18:02:47 +0100 Deduplicate server scripts Diffstat:
| M | publish.sh | | | 8 | +------- |
| M | push.sh | | | 6 | ++---- |
| A | serve.sh | | | 10 | ++++++++++ |
3 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/publish.sh b/publish.sh @@ -1,10 +1,4 @@ #!/bin/sh npm run build -cd dist -tar -c -f ../dist.tar * -cd .. - -. ./.env -curl http://ttmaths.uk/ -X PUT -H "Authorization: Pages $GIT_PAGES_PASSWORD" -H "Content-Type: application/x-tar" --data-binary @dist.tar -rm dist.tar +./serve.sh dist ttmaths.uk diff --git a/push.sh b/push.sh @@ -10,10 +10,8 @@ cp ../stagit.css style.css cp ../stagit.png logo.png cp ../stagit.png favicon.png cp -r ../../website.git website.git -tar -c -f ../stagit.tar * cd .. -. ./.env -curl http://git.ttmaths.uk/ -X PUT -H "Authorization: Pages $GIT_PAGES_PASSWORD" -H "Content-Type: application/x-tar" --data-binary @stagit.tar -rm stagit.tar +./serve.sh stagit git.ttmaths.uk + rm -rf stagit diff --git a/serve.sh b/serve.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +cd "$1" +tar -c -f ../archive.tar * +cd .. + +. ./.env +curl "http://$2" -X PUT -H "Authorization: Pages $GIT_PAGES_PASSWORD" -H "Content-Type: application/x-tar" --data-binary @archive.tar + +rm archive.tar