Skip to content

Commit

Permalink
[change] args to env
Browse files Browse the repository at this point in the history
  • Loading branch information
qazz92 committed Nov 2, 2020
1 parent 938f53e commit f42cb01
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ RUN chmod +x /usr/bin/levant
WORKDIR /nomad-deploy
COPY deploy /nomad-deploy/deploy

RUN chmod +x /nomad-deploy/deploy

ENTRYPOINT ["/nomad-deploy/deploy"]
10 changes: 5 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ inputs:
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.token }}
- ${{ inputs.address }}
- ${{ inputs.job }}
- ${{ inputs.config }}
env:
NOMAD_TOKEN: ${{ inputs.token }}
NOMAD_ADDRESS: ${{ inputs.address }}
NOMAD_JOB: ${{ inputs.job }}
LEVANT_CONFIG: ${{ inputs.config }}
branding:
icon: 'upload-cloud'
color: 'green'
12 changes: 4 additions & 8 deletions deploy
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
#! /usr/bin/env bash

nomad_token=$1
nomad_address=$2
nomad_job_file_path=$3
config_file_path=$4
export NOMAD_ADDR="${NOMAD_ADDRESS}"
export NOMAD_TOKEN="${NOMAD_TOKEN}"

if [ -f "$nomad_job_file_path" ]; then
export NOMAD_ADDR="$nomad_address"
export NOMAD_TOKEN="$nomad_token"
levant deploy -var-file "$config_file_path" "$nomad_job_file_path"
levant deploy -var-file "${LEVANT_CONFIG}" "${NOMAD_JOB}"
else
echo "$nomad_job_file_path does not exist"
echo "${NOMAD_JOB} does not exist"
exit 1
fi

0 comments on commit f42cb01

Please sign in to comment.