Browse Source

Add option to build for staging

This uses a different base url and adds uses an all-blocking robots.txt.
master
Simon Bruder 10 months ago
parent
commit
281157346e
Signed by: simon
GPG Key ID: 8D3C82F9F309F8EC
  1. 20
      build.sh
  2. 7
      flake.nix
  3. 0
      static/robots.txt.staging

20
build.sh

@ -1,8 +1,22 @@
#!/bin/sh
#!/usr/bin/env bash
set -e
declare -a zola_options
SCHABERNACK_ENV=${SCHABERNACK_ENV:-production}
if [ "${SCHABERNACK_ENV}" = "staging" ]; then
echo "Building staging version" >&2
zola_options+=(-u https://staging.schulischer-schabernack.de)
fi
./metadata.py
zola build
zola build ${zola_options[@]}
echo "Encoding…"
./encode.py
./metadata.py
zola build
zola build ${zola_options[@]}
if [ "${SCHABERNACK_ENV}" = "staging" ]; then
cp static/robots.txt.staging public/robots.txt
fi

7
flake.nix

@ -10,7 +10,7 @@
pkgs = import nixpkgs { inherit system; config.allowUnfree = true; };
in
rec {
packages = {
packages = rec {
bulma = pkgs.fetchzip {
url = "https://github.com/jgthms/bulma/releases/download/0.9.0/bulma-0.9.0.zip";
sha256 = "sha256-FKWdkq6pRukCzR2IQ88OHlPkIJbeeEz7NdIWv44k8TM=";
@ -32,6 +32,7 @@
, ffmpeg-full
, python3
, zola
, staging ? false
}:
let
linkVendor = ''
@ -56,6 +57,8 @@
zola
];
SCHABERNACK_ENV = if staging then "staging" else "production";
postPatch = ''
patchShebangs .
'';
@ -85,6 +88,8 @@
'';
})
{ };
schulischer-schabernack-staging = schulischer-schabernack.override { staging = true; };
};
defaultPackage = packages.schulischer-schabernack;

0
static/robots.txt → static/robots.txt.staging

Loading…
Cancel
Save