Skip to content

Commit

Permalink
docs and valdiations
Browse files Browse the repository at this point in the history
  • Loading branch information
brunocascio committed Dec 12, 2019
1 parent 60e223d commit a5973f9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

set -e o pipefail

echo $INPUT_CONTAINER
echo $INPUT_CLUSTER
echo $INPUT_TASK
echo $INPUT_SERVICE
# Validate input
[ -z "$INPUT_CLUSTER" ] && (echo "Missing Cluster Name" && exit 1)
[ -z "$INPUT_CONTAINER" ] && (echo "Missing Container Name" && exit 1)
[ -z "$INPUT_TASK" ] && (echo "Missing Task Name" && exit 1)
[ -z "$INPUT_SERVICE" ] && (echo "Missing Service Name" && exit 1)

# parse env variables
env_variables=$(jq -n 'env' | jq --arg CONTAINER "$INPUT_CONTAINER" -r 'keys[] as $k | "-e \($CONTAINER) \($k) \"\(values[$k])\""')

# make string command to be evaluated (one line string)
command=$(printf "ecs deploy $INPUT_CLUSTER $INPUT_SERVICE --task $INPUT_TASK $env_variables --exclusive-env")

echo $command

# fire command
eval $command

0 comments on commit a5973f9

Please sign in to comment.