aboutsummaryrefslogtreecommitdiff
path: root/nixops/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'nixops/scripts')
-rwxr-xr-xnixops/scripts/nixops_wrap11
-rwxr-xr-xnixops/scripts/pull_deployment5
-rwxr-xr-xnixops/scripts/push_deployment6
3 files changed, 10 insertions, 12 deletions
diff --git a/nixops/scripts/nixops_wrap b/nixops/scripts/nixops_wrap
index e50b246..12f661a 100755
--- a/nixops/scripts/nixops_wrap
+++ b/nixops/scripts/nixops_wrap
@@ -5,16 +5,18 @@ if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then
5 echo "Please set NIXOPS_CONFIG_PASS_SUBTREE_PATH to the password-store subtree path" 5 echo "Please set NIXOPS_CONFIG_PASS_SUBTREE_PATH to the password-store subtree path"
6 exit 1; 6 exit 1;
7fi 7fi
8DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
9export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
10export NIXOPS_DEPLOYMENT="$DeploymentUuid"
11source $(dirname $(dirname $DIR))/nix_path_env
12nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops"
8 13
9TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) 14TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files)
10chmod go-rwx $TEMP 15chmod go-rwx $TEMP
11 16
12DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
13source $(dirname $(dirname $DIR))/nix_path_env
14# __noChroot: ssh-config-file requires relaxed 17# __noChroot: ssh-config-file requires relaxed
15export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:$NIX_PATH" 18export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:$NIX_PATH"
16 19
17nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops"
18 20
19finish() { 21finish() {
20 rm -rf "$TEMP" 22 rm -rf "$TEMP"
@@ -23,9 +25,6 @@ finish() {
23 25
24trap finish EXIT 26trap finish EXIT
25 27
26export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
27export NIXOPS_DEPLOYMENT="$DeploymentUuid"
28
29# pass cannot "just" list files in a directory without showing a tree :( 28# pass cannot "just" list files in a directory without showing a tree :(
30files=$(pass ls $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files | sed -e '1d' -e 's/^.* //') 29files=$(pass ls $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files | sed -e '1d' -e 's/^.* //')
31 30
diff --git a/nixops/scripts/pull_deployment b/nixops/scripts/pull_deployment
index 2fc07bc..bc4a999 100755
--- a/nixops/scripts/pull_deployment
+++ b/nixops/scripts/pull_deployment
@@ -1,15 +1,16 @@
1#!/bin/bash 1#!/bin/bash
2 2
3DeploymentUuid="cef694f3-081d-11e9-b31f-0242ec186adf" 3DeploymentUuid="cef694f3-081d-11e9-b31f-0242ec186adf"
4
5if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then 4if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then
6 echo "Please set NIXOPS_CONFIG_PASS_SUBTREE_PATH to the password-store subtree path" 5 echo "Please set NIXOPS_CONFIG_PASS_SUBTREE_PATH to the password-store subtree path"
7 exit 1; 6 exit 1;
8fi 7fi
9
10DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 8DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
9export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
10export NIXOPS_DEPLOYMENT="$DeploymentUuid"
11source $(dirname $(dirname $DIR))/nix_path_env 11source $(dirname $(dirname $DIR))/nix_path_env
12nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" 12nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops"
13
13export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" 14export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
14 15
15if $nixops info -d $DeploymentUuid 2>/dev/null >/dev/null; then 16if $nixops info -d $DeploymentUuid 2>/dev/null >/dev/null; then
diff --git a/nixops/scripts/push_deployment b/nixops/scripts/push_deployment
index c8c34ee..067b665 100755
--- a/nixops/scripts/push_deployment
+++ b/nixops/scripts/push_deployment
@@ -1,16 +1,14 @@
1#!/bin/bash 1#!/bin/bash
2 2
3DeploymentUuid="cef694f3-081d-11e9-b31f-0242ec186adf" 3DeploymentUuid="cef694f3-081d-11e9-b31f-0242ec186adf"
4
5if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then 4if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then
6 echo "Please set NIXOPS_CONFIG_PASS_SUBTREE_PATH to the password-store subtree path" 5 echo "Please set NIXOPS_CONFIG_PASS_SUBTREE_PATH to the password-store subtree path"
7 exit 1; 6 exit 1;
8fi 7fi
9
10DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 8DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
11source $(dirname $(dirname $DIR))/nix_path_env
12nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops"
13export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" 9export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
14export NIXOPS_DEPLOYMENT="$DeploymentUuid" 10export NIXOPS_DEPLOYMENT="$DeploymentUuid"
11source $(dirname $(dirname $DIR))/nix_path_env
12nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops"
15 13
16$nixops export | pass insert -m $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/Deployment 14$nixops export | pass insert -m $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/Deployment