Skip to content

Commit

Permalink
feat: make it easier for others to re-run gitops scripts
Browse files Browse the repository at this point in the history
This should make it much easier for others to re-run the scripts by
making the paths relative.
  • Loading branch information
cardoe committed May 6, 2024
1 parent 2b6c1a1 commit 1515519
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 1 addition & 2 deletions docs/gitops-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ To avoid defining many environment variables we'll simplify by creating an
place it where we've cloned understack. A complete file would like like

```bash title="/path/to/uc-deploy/my-k3s.env"
UC_REPO="$HOME/devel/understack"
UC_DEPLOY="$HOME/devel/uc-deploy"
UC_DEPLOY="$(pwd)/$(dirname ${BASH_SOURCE[0]})"
DEPLOY_NAME="my-k3s"
[email protected]:myorg/uc-deploy.git
UC_DEPLOY_SSH_FILE="$HOME/devel/uc-deploy-key"
Expand Down
2 changes: 2 additions & 0 deletions scripts/gitops-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ fi

. "$1"

export UC_REPO="$(git rev-parse --show-toplevel)"

if [ ! -d "${UC_REPO}" ]; then
echo "UC_REPO not set to a path." >&2
usage
Expand Down
4 changes: 3 additions & 1 deletion scripts/gitops-secrets-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ if [ ! -f "$1" ]; then
usage
fi

source "$1"
. "$1"

export UC_REPO="$(git rev-parse --show-toplevel)"

if [ ! -d "${UC_DEPLOY}" ]; then
echo "UC_DEPLOY not set to a path." >&2
Expand Down

0 comments on commit 1515519

Please sign in to comment.