Skip to content

Commit

Permalink
tweak the start-nomad script for different platforms [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi18av authored and jagedn committed Jul 25, 2024
1 parent 9a76a7e commit dd47cde
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions validation/start-nomad.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@
set -ue

NOMAD_VERSION="1.8.1"
NOMAD_PLATFORM="linux_amd64"
NOMAD_PLATFORM=${NOMAD_PLATFORM:-linux_amd64}

## Available platforms
#- "linux_amd64"
#- "linux_arm64"
#- "darwin_amd64"
#- "darwin_arm64"
#- "windows_amd64"

SECURE=0
[[ "$@" =~ '--secure' ]] && SECURE=1

if [ ! -f ./nomad ]; then
curl -O "https://releases.hashicorp.com/nomad/${NOMAD_VERSION}/nomad_${NOMAD_VERSION}_${NOMAD_PLATFORM}.zip"
unzip nomad_${NOMAD_VERSION}_${NOMAD_PLATFORM}.zip
rm -f nomad_${NOMAD_VERSION}_${NOMAD_PLATFORM}.zip
rm -f nomad_${NOMAD_VERSION}_${NOMAD_PLATFORM}.zip LICENSE.txt
chmod +x ./nomad
fi

mkdir -p nomad_temp
Expand Down Expand Up @@ -53,7 +61,7 @@ if [ "$SECURE" == 0 ]; then
# basic nomad cluter
../nomad agent -config server.conf -config client.conf -config server-custom.conf -config client-custom.conf
else
# secured nomad cluster
# secured nomad cluster
../nomad agent -config server.conf -config client.conf -config server-custom.conf -config client-custom.conf &
cd ..
./wait-nomad.sh
Expand All @@ -62,4 +70,4 @@ NOMAD_TOKEN=$(nomad acl bootstrap | awk '/^Secret ID/ {print $4}')
export NOMAD_TOKEN
echo New super token generated.
echo export NOMAD_TOKEN=$NOMAD_TOKEN
fi
fi

0 comments on commit dd47cde

Please sign in to comment.