Manage configuration files with Build Configs
https://www.oliverdavies.dev/build-configs
This commit is contained in:
parent
143009ab60
commit
eb3273a53b
7
.gitignore
vendored
7
.gitignore
vendored
|
@ -1,3 +1,8 @@
|
|||
/flake.lock
|
||||
# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs.
|
||||
|
||||
/output_*/
|
||||
/vendor/
|
||||
|
||||
/.direnv/
|
||||
|
||||
/flake.lock
|
||||
|
|
13
build.yaml
Normal file
13
build.yaml
Normal file
|
@ -0,0 +1,13 @@
|
|||
name: sculpin-skeleton
|
||||
type: sculpin
|
||||
language: php
|
||||
|
||||
flake:
|
||||
devshell:
|
||||
packages:
|
||||
- php81
|
||||
- php81Packages.composer
|
||||
|
||||
git:
|
||||
ignore:
|
||||
- /flake.lock
|
11
flake.nix
11
flake.nix
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
description = "oliverdavies.uk-sculpin";
|
||||
# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs.
|
||||
|
||||
{
|
||||
inputs = {
|
||||
devshell.url = "github:numtide/devshell";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs = inputs@{ flake-parts, ... }:
|
||||
|
@ -14,7 +14,10 @@
|
|||
|
||||
perSystem = { config, self', inputs', pkgs, system, ... }: {
|
||||
devshells.default = {
|
||||
packages = with pkgs; [ "php81" "php81Packages.composer" ];
|
||||
packages = with pkgs; [
|
||||
"php81"
|
||||
"php81Packages.composer"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
41
run
Executable file
41
run
Executable file
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
PATH="${PATH}:./vendor/bin"
|
||||
|
||||
# Generate the site.
|
||||
function generate {
|
||||
local args=()
|
||||
|
||||
if [[ "${APP_ENV:-}" == "production" ]]; then
|
||||
args=(--env="prod")
|
||||
else
|
||||
args=(--server --watch)
|
||||
fi
|
||||
|
||||
sculpin generate "${args[@]}"
|
||||
}
|
||||
|
||||
function help {
|
||||
printf "%s <task> [args]\n\nTasks:\n" "${0}"
|
||||
|
||||
compgen -A function | grep -v "^_" | cat -n
|
||||
|
||||
printf "\nExtended help:\n Each task has comments for general usage\n"
|
||||
}
|
||||
|
||||
# Start the project.
|
||||
function start {
|
||||
sculpin generate --server --watch "${@}"
|
||||
}
|
||||
|
||||
# Include any local tasks.
|
||||
[[ -e run.local ]] && source run.local
|
||||
|
||||
TIMEFORMAT="Task completed in %3lR"
|
||||
time "${@:-help}"
|
||||
|
||||
# vim: ft=bash
|
Loading…
Reference in a new issue