Initial upload
This commit is contained in:
parent
8fdcc8f382
commit
2f5fe15521
2 changed files with 53 additions and 0 deletions
28
action.yaml
28
action.yaml
|
|
@ -0,0 +1,28 @@
|
|||
name: 'Edge Connect Deploy'
|
||||
description: 'Deploys an Edge Connect application using the edge-connect-client'
|
||||
author: 'DevFW'
|
||||
|
||||
inputs:
|
||||
config-file:
|
||||
description: 'Path to the Edge Connect configuration file.'
|
||||
required: true
|
||||
dry-run:
|
||||
description: 'Perform a dry run of the deployment.'
|
||||
required: false
|
||||
default: 'false'
|
||||
version:
|
||||
description: 'The version of the edge-connect-client to use.'
|
||||
required: false
|
||||
default: 'v0.1.0'
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: 'Download and run edge-connect-client'
|
||||
run: |
|
||||
${{ github.action_path }}/endpoint.sh
|
||||
shell: bash
|
||||
env:
|
||||
INPUT_CONFIG-FILE: ${{ inputs.config-file }}
|
||||
INPUT_DRY-RUN: ${{ inputs.dry-run }}
|
||||
INPUT_VERSION: ${{ inputs.version }}
|
||||
25
endpoint.sh
25
endpoint.sh
|
|
@ -1,3 +1,28 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
main() {
|
||||
local download_url="https://edp.buildth.ing/DevFW-CICD/edge-connect-client/releases/download/${INPUT_VERSION}/edge-connect-client_Linux_x86_64.tar.gz"
|
||||
|
||||
echo "Downloading edge-connect-client from ${download_url}"
|
||||
|
||||
local temp_dir
|
||||
temp_dir=$(mktemp -d)
|
||||
|
||||
curl -sSL "${download_url}" | tar -xz -C "${temp_dir}"
|
||||
|
||||
local cli_path="${temp_dir}/edge-connect-client"
|
||||
chmod +x "${cli_path}"
|
||||
|
||||
local -a args
|
||||
args=("--file" "${INPUT_CONFIG-FILE}")
|
||||
|
||||
if [[ "${INPUT_DRY-RUN}" == "true" ]]; then
|
||||
args+=("--dry-run")
|
||||
fi
|
||||
|
||||
# The CLI uses an interactive prompt, so we need to pipe "yes" to it.
|
||||
yes | "${cli_path}" apply "${args[@]}"
|
||||
}
|
||||
|
||||
main
|
||||
Loading…
Add table
Add a link
Reference in a new issue