Restructure project
We previously didn't really had any structure in our project apart from creating a new folder for each package in our project root. Now that we have accumulated some packages, we use the well-known Golang project layout in order to clearly communicate our intent with packages. See https://github.com/golang-standards/project-layout
This commit is contained in:
14
deploy/nomad-run-env-job.sh
Executable file
14
deploy/nomad-run-env-job.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script substitutes environment variables in the given Nomad job and runs it afterwards.
|
||||
|
||||
if [[ "$#" -ne 2 ]]; then
|
||||
echo "Usage: $0 path/to/infile path/to/outfile"
|
||||
fi
|
||||
|
||||
envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < $1 > $2
|
||||
nomad validate $2
|
||||
# nomad plan returns 1 if allocations are created or destroyed which is what we want here
|
||||
# https://www.nomadproject.io/docs/commands/job/plan#usage
|
||||
nomad plan $2 || [ $? == 1 ]
|
||||
nomad run $2
|
Reference in New Issue
Block a user