Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
remove INPUT_ from ENV VARs
Browse files Browse the repository at this point in the history
  • Loading branch information
darrylmendillo committed Dec 17, 2020
1 parent 145dd0f commit ff540e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
10 changes: 5 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ inputs:
runs:
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.nomad_addr }}
- ${{ inputs.version }}
- ${{ inputs.config }}
- ${{ inputs.deploy }}
env:
NOMAD_ADDR: ${{ inputs.nomad_addr }}
VERSION: ${{ inputs.version }}
DEPLOY_CONFIG: ${{ inputs.config }}
DEPLOY: ${{ inputs.deploy }}
23 changes: 10 additions & 13 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#!/bin/bash

INPUT_DEPLOY=${INPUT_DEPLOY:-TRUE}
DEPLOY=${DEPLOY:-TRUE}

# echo all the variabls
echo "INPUT_ADDR: $INPUT_VERSION"
echo "INPUT_CONFIG: $INPUT_CONFIG"
echo "INPUT_NOMAD_ADDR: $INPUT_NOMAD_ADDR"
echo "INPUT_DEPLOY: $INPUT_DEPLOY"

# export NOMAD_ADDR for deployment
export "NOMAD_ADDR=$INPUT_NOMAD_ADDR"
echo "VERSION: $VERSION"
echo "DEPLOY_CONFIG: $DEPLOY_CONFIG"
echo "NOMAD_ADDR: $NOMAD_ADDR"
echo "DEPLOY: $DEPLOY"

# render
for dir in */ ; do
Expand All @@ -21,16 +18,16 @@ for dir in */ ; do

# only deploy *.nomad.hcl (jobs)
if [ $matched = "true" ]; then
echo "levant render -var TAG=${INPUT_VERSION} -var DEPLOY=staging -var-file=${INPUT_CONFIG} -out=nomad/$(basename $file) ${file}"
levant render -var TAG=${INPUT_VERSION} -var DEPLOY=staging -var-file=${INPUT_CONFIG} -out=nomad/$(basename $file) ${file}
echo "levant render -var TAG=${VERSION} -var DEPLOY=staging -var-file=${DEPLOY_CONFIG} -out=nomad/$(basename $file) ${file}"
levant render -var TAG=${VERSION} -var DEPLOY=staging -var-file=${DEPLOY_CONFIG} -out=nomad/$(basename $file) ${file}
fi

done
fi
done

# deploy
if [ $INPUT_DEPLOY = "TRUE" ]; then
if [ $DEPLOY = "TRUE" ]; then
for dir in */ ; do
if [ -d "${dir}nomad" ]; then

Expand All @@ -40,8 +37,8 @@ if [ $INPUT_DEPLOY = "TRUE" ]; then

# only deploy *.nomad.hcl (jobs)
if [ $matched = "true" ]; then
echo "levant deploy -var TAG=${INPUT_VERSION} -ignore-no-changes -var DEPLOY=staging -var-file=${INPUT_CONFIG} ${file}"
levant deploy -var TAG=${INPUT_VERSION} -ignore-no-changes -var DEPLOY=staging -var-file=${INPUT_CONFIG} ${file}
echo "levant deploy -var TAG=${VERSION} -ignore-no-changes -var DEPLOY=staging -var-file=${DEPLOY_CONFIG} ${file}"
levant deploy -var TAG=${VERSION} -ignore-no-changes -var DEPLOY=staging -var-file=${DEPLOY_CONFIG} ${file}
fi

done
Expand Down

0 comments on commit ff540e1

Please sign in to comment.