diff --git a/doc/trim.sh b/doc/trim.sh new file mode 100755 index 00000000..4ae53682 --- /dev/null +++ b/doc/trim.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# Trims the jungle repository by moving the website to its own repository and +# removing it from jungle. It also removes big pdf files and kernel +# configurations so the jungle repository is small. + +set -e + +if [ -e oldjungle -o -e newjungle -o -e website ]; then + echo "remove oldjungle/, newjungle/ and website/ first" + exit 1 +fi + +# Clone the old jungle repo +git clone gitea@tent:rarias/jungle.git oldjungle + +# First split the website into a new repository +mkdir website && git -C website init -b master +git-filter-repo \ + --path web \ + --subdirectory-filter web \ + --source oldjungle \ + --target website + +# Then remove the website, pdf files and big kernel configs +mkdir newjungle && git -C newjungle init -b master +git-filter-repo \ + --invert-paths \ + --path web \ + --path-glob 'doc*.pdf' \ + --path-glob '**/kernel/configs/lockdep' \ + --path-glob '**/kernel/configs/defconfig' \ + --source oldjungle \ + --target newjungle + +set -x + +du -sh oldjungle newjungle website +# 57M oldjungle +# 2,3M newjungle +# 6,4M website + +du -sh --exclude=.git oldjungle newjungle website +# 30M oldjungle +# 700K newjungle +# 3,5M website diff --git a/m/hut/nginx.nix b/m/hut/nginx.nix index 97afc3a6..f38d587f 100644 --- a/m/hut/nginx.nix +++ b/m/hut/nginx.nix @@ -2,10 +2,13 @@ let website = pkgs.stdenv.mkDerivation { name = "jungle-web"; - src = theFlake; + src = pkgs.fetchgit { + url = "https://jungle.bsc.es/git/rarias/jungle-website.git"; + rev = "739bf0175a7f05380fe7ad7023ff1d60db1710e1"; + hash = "sha256-ea5DzhYTzZ9TmqD+x95rdNdLbxPnBluqlYH2NmBYmc4="; + }; buildInputs = [ pkgs.hugo ]; buildPhase = '' - cd web rm -rf public/ hugo ''; diff --git a/m/tent/nginx.nix b/m/tent/nginx.nix index 731b011f..45686905 100644 --- a/m/tent/nginx.nix +++ b/m/tent/nginx.nix @@ -2,10 +2,13 @@ let website = pkgs.stdenv.mkDerivation { name = "jungle-web"; - src = theFlake; + src = pkgs.fetchgit { + url = "https://jungle.bsc.es/git/rarias/jungle-website.git"; + rev = "739bf0175a7f05380fe7ad7023ff1d60db1710e1"; + hash = "sha256-ea5DzhYTzZ9TmqD+x95rdNdLbxPnBluqlYH2NmBYmc4="; + }; buildInputs = [ pkgs.hugo ]; buildPhase = '' - cd web rm -rf public/ hugo '';