refactor(build-system): rework build system to include latex build
This commit is contained in:
parent
e99be7fc23
commit
6d76ed6575
3 changed files with 49 additions and 28 deletions
|
@ -3,31 +3,8 @@ set: [errexit, pipefail, nounset]
|
||||||
shopt: [globstar]
|
shopt: [globstar]
|
||||||
dotenv:
|
dotenv:
|
||||||
- .env
|
- .env
|
||||||
vars:
|
includes:
|
||||||
HUGO_BIN: hugo
|
site:
|
||||||
BUILD_OPTS: --gc --cleanDestinationDir
|
taskfile: ./taskfiles/site.yaml
|
||||||
BUILD_DEST: public
|
latex:
|
||||||
SERVE_OPTS: -D --disableFastRender
|
taskfile: ./taskfiles/latex.yaml
|
||||||
DEPLOY_BIN: rsync
|
|
||||||
DEPLOY_OPTS: -avz --delete
|
|
||||||
tasks:
|
|
||||||
test:
|
|
||||||
cmds:
|
|
||||||
- echo "$DEPLOY_SRV"
|
|
||||||
build:
|
|
||||||
cmds:
|
|
||||||
- |
|
|
||||||
{{.HUGO_BIN}} {{.BUILD_OPTS}} -d {{.BUILD_DEST}}
|
|
||||||
serve:
|
|
||||||
cmds:
|
|
||||||
- |
|
|
||||||
{{.HUGO_BIN}} {{.SERVE_OPTS}}
|
|
||||||
deploy:
|
|
||||||
deps: [build]
|
|
||||||
cmds:
|
|
||||||
- |
|
|
||||||
{{.DEPLOY_BIN}} {{.DEPLOY_OPTS}} {{.BUILD_DEST}} {{.DEPLOY_SRV}}:{{.DEPLOY_DEST}}
|
|
||||||
requires:
|
|
||||||
vars:
|
|
||||||
- DEPLOY_SRV
|
|
||||||
- DEPLOY_DEST
|
|
||||||
|
|
15
taskfiles/latex.yaml
Normal file
15
taskfiles/latex.yaml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
version: "3"
|
||||||
|
vars:
|
||||||
|
LATEX_BUILD_DIR: build
|
||||||
|
LATEX_BIN: lualatex
|
||||||
|
LATEX_OPTS: --interaction=nonstopmode
|
||||||
|
tasks:
|
||||||
|
build:
|
||||||
|
desc: Build PDF from LaTeX source
|
||||||
|
cmds:
|
||||||
|
- |
|
||||||
|
mkdir {{.LATEX_BUILD_DIR}} -p
|
||||||
|
{{.LATEX_BIN}} {{.LATEX_OPTS}} --output-directory {{.LATEX_BUILD_DIR}} {{.CLI_ARGS}}
|
||||||
|
preconditions:
|
||||||
|
- sh: 'test -f {{.CLI_ARGS}}'
|
||||||
|
msg: file `{{.CLI_ARGS}}` does not exists
|
29
taskfiles/site.yaml
Normal file
29
taskfiles/site.yaml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
version: "3"
|
||||||
|
vars:
|
||||||
|
HUGO_BIN: hugo
|
||||||
|
BUILD_OPTS: --gc --cleanDestinationDir
|
||||||
|
BUILD_DEST: public
|
||||||
|
SERVE_OPTS: -D --disableFastRender
|
||||||
|
DEPLOY_BIN: rsync
|
||||||
|
DEPLOY_OPTS: -avz --delete
|
||||||
|
tasks:
|
||||||
|
test:
|
||||||
|
cmds:
|
||||||
|
- echo "$DEPLOY_SRV"
|
||||||
|
build:
|
||||||
|
cmds:
|
||||||
|
- |
|
||||||
|
{{.HUGO_BIN}} {{.BUILD_OPTS}} -d {{.BUILD_DEST}}
|
||||||
|
serve:
|
||||||
|
cmds:
|
||||||
|
- |
|
||||||
|
{{.HUGO_BIN}} {{.SERVE_OPTS}}
|
||||||
|
deploy:
|
||||||
|
deps: [build]
|
||||||
|
cmds:
|
||||||
|
- |
|
||||||
|
{{.DEPLOY_BIN}} {{.DEPLOY_OPTS}} {{.BUILD_DEST}} {{.DEPLOY_SRV}}:{{.DEPLOY_DEST}}
|
||||||
|
requires:
|
||||||
|
vars:
|
||||||
|
- DEPLOY_SRV
|
||||||
|
- DEPLOY_DEST
|
Loading…
Add table
Add a link
Reference in a new issue