chore(docker): versioning
This commit is contained in:
parent
fa54517d15
commit
b7b5a24be6
@ -101,7 +101,7 @@
|
||||
pushUniworxDemoDocker = pkgs.writeScriptBin "push-uniworx-demo-docker" ''
|
||||
#!${pkgs.zsh}/bin/zsh -xe
|
||||
|
||||
target=''${1-docker://registry.gitlab.com/fradrive/fradrive/uniworx-demo}
|
||||
target=''${1-docker://registry.gitlab.com/fradrive/fradrive/uniworx-demo:${pkgs.uniworxDemoDocker.imageTag}}
|
||||
[[ -n "''${1}" ]] && shift
|
||||
${pkgs.skopeo}/bin/skopeo ''${@} --insecure-policy copy docker-archive://${pkgs.uniworxDemoDocker} ''${target}
|
||||
'';
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
{ self }: final: prev: {
|
||||
uniworxDemoDocker = prev.dockerTools.buildImage {
|
||||
name = "uniworx-demo";
|
||||
tag = self.rev or null;
|
||||
tag =
|
||||
let
|
||||
inherit (builtins.fromTOML (prev.lib.readFile ./version.toml)) semver;
|
||||
hash = prev.lib.substring 0 8 (self.rev or prev.lib.removePrefix "sha256-" self.narHash);
|
||||
in "${semver}+${hash}";
|
||||
created =
|
||||
let
|
||||
fromDate = builtins.readFile (prev.runCommand "date" { nativeBuildInputs = with final; [ coreutils ]; } ''
|
||||
@ -72,7 +76,16 @@
|
||||
export SESSION_MEMCACHED_PORT=11212
|
||||
|
||||
export LOGDEST=/var/log/uniworx/''${cTime}.log
|
||||
exec -- su uniworx -c "cd /var/lib/uniworx; uniworx ${uniworxConfig}"
|
||||
typeset -a configs
|
||||
configs=()
|
||||
configDir=''${CONFIG_DIR-/cfg}
|
||||
if [[ -d "''${configDir}" ]]; then
|
||||
while IFS= read -d $'\0' cfg; do
|
||||
configs+=("''${(q)cfg}")
|
||||
done < <(find "''${configDir}" \( -name '*.yml' -o -name '*.yaml' \) -print0 | sort -rz)
|
||||
fi
|
||||
configs+=('${uniworxConfig}')
|
||||
exec -- su uniworx -c "cd /var/lib/uniworx; uniworx ''${configs}"
|
||||
'';
|
||||
postgresSchema = prev.writeText "schema.sql" ''
|
||||
CREATE USER uniworx WITH SUPERUSER;
|
||||
|
||||
3
nix/docker-demo/version.toml
Normal file
3
nix/docker-demo/version.toml
Normal file
@ -0,0 +1,3 @@
|
||||
# TODO: Bump version (https://semver.org) on every semantic change
|
||||
# docker-demo should always use major version zero
|
||||
semver = "0.2.0"
|
||||
Loading…
Reference in New Issue
Block a user