Commit b816459a authored by doshitan's avatar doshitan

Move some things to scripts/

parent 6c098eb3
build_and_deploy:
script:
- nix run -f . ciInputs -c make metadata-gen
- nix-build -A content
- DEST_DIR=result nix run -f . ciInputs -c make sync-ci
script: ./scripts/ci-build-deploy.sh
environment:
name: $CI_COMMIT_REF_NAME
......
......@@ -110,16 +110,18 @@ rec {
merriweather = pkgs.stdenv.mkDerivation rec {
name = "doshitan-merriweather-${version}";
version = "0.0.0";
src = ./merriweather.sh;
src = ./scripts/merriweather.sh;
phases = [ "unpackPhase" "buildPhase" ];
unpackPhase = ''
cp $src ./merriweather.sh
'';
phases = [ "unpackPhase" "buildPhase" ];
buildInputs = [
pkgs.merriweather
pkgs.python3Packages.fonttools pkgs.python3Packages.brotlipy
];
buildPhase = ''
substituteInPlace merriweather.sh --replace "/usr/bin/env" "${pkgs.coreutils}/bin/env"
export MERRIWEATHER_SRC_DIR=${pkgs.merriweather}
export MERRIWEATHER_DEST_DIR=$out
./merriweather.sh
......@@ -130,16 +132,18 @@ rec {
firaMono = pkgs.stdenv.mkDerivation rec {
name = "doshitan-firaMono-${version}";
version = "0.0.0";
src = ./fira-mono.sh;
src = ./scripts/fira-mono.sh;
phases = [ "unpackPhase" "buildPhase" ];
unpackPhase = ''
cp $src ./fira-mono.sh
'';
phases = [ "unpackPhase" "buildPhase" ];
buildInputs = [
pkgs.fira-mono
pkgs.python3Packages.fonttools pkgs.python3Packages.brotlipy
];
buildPhase = ''
substituteInPlace fira-mono.sh --replace "/usr/bin/env" "${pkgs.coreutils}/bin/env"
export FIRA_MONO_SRC_DIR=${pkgs.fira-mono}/share/fonts/opentype/
export FIRA_MONO_DEST_DIR=$out
./fira-mono.sh
......
......@@ -51,7 +51,7 @@ drafts-unlink:
metadata-gen: SHELL:=bash
metadata-gen:
git ls-files -z $(CONTENT_DIR)/{posts,pages,projects}/ | parallel -0 -- 'git log -1 --format="%aI" {} | cat <(echo -n "modified: ") - > {}.metadata'
git ls-files -z $(CONTENT_DIR)/{posts,pages,projects}/ | parallel -0 -- ./scripts/metadata-gen.sh {}
metadata-clean: SHELL:=bash
metadata-clean:
......@@ -84,11 +84,11 @@ version-assets:
#
# updating fontello workflow:
# - run `make font-open`
# - run `make fontello-open`
# - select which icons are desired
# - click 'Save Session' in the UI
# - run `make font-save`
# - (optional) run `make font-clean`
# - run `make fontello-save`
# - (optional) run `make fontello-clean`
FONT_DIR ?= $(CONTENT_DIR)/assets/font
CSS_DIR ?= $(CONTENT_DIR)/assets/css
......@@ -132,12 +132,15 @@ merriweather-nix:
nix-build -A merriweather
merriweather-build:
./merriweather.sh
./scripts/merriweather.sh
merriweather-save:
cp -f $(MERRIWEATHER_DEST_DIR)/font/* $(FONT_DIR)/
cp -f $(MERRIWEATHER_DEST_DIR)/merriweather.css $(CSS_DIR)/
merriweather-clean:
rm -rf .merriweather
FIRA_MONO_SRC_DIR ?= $(abspath ./.fira-mono/fonts/otf)
FIRA_MONO_DEST_DIR ?= $(abspath ./.fira-mono/subset_fonts)
......@@ -145,8 +148,13 @@ fira-mono-nix:
nix-build -A firaMono
fira-mono-build:
./fira-mono.sh
./scripts/fira-mono.sh
fira-mono-save:
cp -f $(FIRA_MONO_DEST_DIR)/font/* $(FONT_DIR)/
cp -f $(FIRA_MONO_DEST_DIR)/fira-mono.css $(CSS_DIR)/
fira-mono-clean:
rm -rf .fira-mono
font-clean: fontello-clean merriweather-clean fire-mono-clean
#!/usr/bin/env sh
set -x
nix run -f . ciInputs -c make metadata-gen
nix-build -A content
DEST_DIR=result nix run -f . ciInputs -c make sync-ci
#!/usr/bin/env bash
git log -1 --format="%aI" "$1" | cat <(echo -n "modified: ") - > "$1".metadata
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment