From 0292688c776894cb2eeee1940c5a36e622baafe9 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Tue, 22 Nov 2022 20:48:57 +0100 Subject: [PATCH] Generate a tarball of the website Sourcehut has a way to setup a static website by uploading a tarball of the content[1]. Even if we don't end up using Sourcehut, generating a tarball of the website enables more easy deployments. Note that we didn't touch to the website code yet, so it still uses the old URLs, the old image locations, etc. After creating a token (documentation[1]), the website can then be uploaded with the following command: curl \ --oauth2-bearer "" \ -Fcontent=@website.tar.gz \ https://pages.sr.ht/publish/gnutoo.srht.site [1]https://srht.site/quickstart Signed-off-by: Denis 'GNUtoo' Carikli --- .gitignore | 1 + Makefile | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 041b601..9e4266f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /untitled/ +/website.tar.gz diff --git a/Makefile b/Makefile index a72561b..18b26b6 100644 --- a/Makefile +++ b/Makefile @@ -12,9 +12,11 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -.PHONY: all +.PHONY: all build website.tar.gz -all: +all: website.tar.gz + +build: guix shell \ --container \ --network \ @@ -29,3 +31,15 @@ all: sed \ -- \ ./build.sh + +# See https://reproducible-builds.org/docs/archives/ for more details +website.tar.gz: build + tar \ + --format=gnu \ + --mtime='1970-01-01 00:00Z' \ + --owner=0 --group=0 --numeric-owner \ + --sort=name \ + -czf \ + website.tar.gz \ + untitled/www/lbwww/site/ \ + --transform="s#untitled/www/lbwww/site/##" \