From 52ba82521a36a5a4015cb3816075057440ffc3dc Mon Sep 17 00:00:00 2001 From: Darryl Mendillo <1238655+darrylmendillo@users.noreply.github.com> Date: Wed, 16 Dec 2020 15:34:04 -0500 Subject: [PATCH] add nomad address --- Dockerfile | 14 +++++++++++--- README.md | 3 ++- action.yml | 4 ++++ docker-compose.yml | 3 ++- entrypoint.sh | 6 +++++- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index cfa24b1..e02f2ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,16 @@ -ARG VERSION="0.2.9" -FROM jrasell/levant:${VERSION} as deploy +FROM debian:10.6-slim as deploy LABEL name="deploy" +ARG VERSION="0.2.9" +ARG BINARY="linux-amd64-levant" + +RUN apt-get update && \ + apt-get install -y \ + wget + ADD entrypoint.sh /entrypoint.sh -ENTRYPOINT [ "/entrypoint.sh" ] \ No newline at end of file +RUN wget https://github.com/hashicorp/levant/releases/download/${VERSION}/${BINARY} -O /usr/bin/levant &&\ + chmod +x /usr/bin/levant +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/README.md b/README.md index 57dfd19..efe2729 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ Searches all subdirectories accoring to `config`. All matched files will be rend - name: deploy uses: pennsignals/deploy_actio@v1.0.0 with: - versiob: '0.2.6-rc.1' # required + version: '0.2.6-rc.1' # required config: './deploy_config.yml' # required + nomad_addr: 'http://10.146.0.5:4646' ``` \ No newline at end of file diff --git a/action.yml b/action.yml index 22de6fc..e8c56d9 100644 --- a/action.yml +++ b/action.yml @@ -12,10 +12,14 @@ inputs: config: description: "deploy_config.yml file with all deployment settings" required: true + nomad_addr: + description: "target nomad deployment address" + required: true runs: using: "docker" image: "Dockerfile" args: + - ${{ inputs.nomad_addr }} - ${{ inputs.version }} - ${{ inputs.config }} diff --git a/docker-compose.yml b/docker-compose.yml index d993f52..b401763 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,8 @@ services: build: . environment: - INPUT_CONFIG=deploy_config.yml - - INPUT_VERSIOB=1.0.0 + - INPUT_VERSION=1.0.0 + - INPUT_NOMAD_ADDR=http://10.146.0.5:4646/ volumes: - ./:/source working_dir: /source \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index a8d83c4..c5916e0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash # echo all the variabls echo "INPUT_ADDR: $INPUT_VERSION" echo "INPUT_CONFIG: $INPUT_CONFIG" +echo "INPUT_NOMAD_ADDR: $INPUT_NOMAD_ADDR" + +# export NOMAD_ADDR for deployment +export "NOMAD_ADDR=$INPUT_NOMAD_ADDR" # use levant to deploy service nomad jobs as templates for dir in */ ; do