parent
3fb11dc4c1
commit
fb3853c72d
2 changed files with 10 additions and 4 deletions
|
@ -1,3 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
nix build
|
nix build
|
||||||
nix develop --command "executor --force --destination dxflrs/albatros:${COMMIT} --context dir://`pwd` --verbosity=debug"
|
if [[ $BRANCH == "main" && -f $SECRET_PATH ]]; then
|
||||||
|
mkdir -p /kaniko/.docker ; cp $SECRET_PATH /kaniko/docker/.config.json
|
||||||
|
export HOME=/kaniko
|
||||||
|
nix develop --command sh -c "executor --force --destination dxflrs/albatros:${COMMIT} --context dir://`pwd` --verbosity=debug"
|
||||||
|
fi
|
||||||
|
|
|
@ -23,12 +23,12 @@ job "builder" {
|
||||||
volumes = [
|
volumes = [
|
||||||
"local/builder.sh:/tmp/builder.sh",
|
"local/builder.sh:/tmp/builder.sh",
|
||||||
"local/nix.conf:/etc/nix/nix.conf",
|
"local/nix.conf:/etc/nix/nix.conf",
|
||||||
"local/secret.txt:/var/run/secrets/albatros/secret.txt",
|
"local/secrets:/var/run/secrets/albatros",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch_payload {
|
dispatch_payload {
|
||||||
file = "secret.txt"
|
file = "secrets/secret.txt"
|
||||||
}
|
}
|
||||||
|
|
||||||
template {
|
template {
|
||||||
|
@ -46,7 +46,9 @@ export COMMIT=${NOMAD_META_COMMIT}
|
||||||
export BRANCH=${NOMAD_META_BRANCH}
|
export BRANCH=${NOMAD_META_BRANCH}
|
||||||
export REPO_URL=${NOMAD_META_REPO_URL}
|
export REPO_URL=${NOMAD_META_REPO_URL}
|
||||||
export FLAVOR=${NOMAD_META_FLAVOR}
|
export FLAVOR=${NOMAD_META_FLAVOR}
|
||||||
|
if [[ -f /var/run/secrets/albatros/secret.txt ]]; then
|
||||||
export SECRET_PATH=/var/run/secrets/albatros/secret.txt
|
export SECRET_PATH=/var/run/secrets/albatros/secret.txt
|
||||||
|
fi
|
||||||
./.albatros
|
./.albatros
|
||||||
|
|
||||||
EOH
|
EOH
|
||||||
|
|
Loading…
Reference in a new issue