chore(edgeplatform): using new delete -f feature from edge connect sdk cli
This commit is contained in:
parent
2d52ae273d
commit
2d40350cad
2 changed files with 16 additions and 36 deletions
31
action.yaml
31
action.yaml
|
|
@ -3,24 +3,13 @@ description: 'Deletes an Edge Connect application using the edge-connect-client'
|
||||||
author: 'DevFW'
|
author: 'DevFW'
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
name:
|
configFile:
|
||||||
description: 'The application name.'
|
description: 'Path to the Edge Connect configuration file.'
|
||||||
required: true
|
|
||||||
appVersion:
|
|
||||||
description: 'The application version.'
|
|
||||||
required: true
|
|
||||||
org:
|
|
||||||
description: 'The organization name.'
|
|
||||||
required: true
|
|
||||||
region:
|
|
||||||
description: 'The region name.'
|
|
||||||
required: true
|
|
||||||
cloudletOrg:
|
|
||||||
description: 'The cloudlet organization name.'
|
|
||||||
required: true
|
|
||||||
cloudlet:
|
|
||||||
description: 'The cloudlet name.'
|
|
||||||
required: true
|
required: true
|
||||||
|
dryRun:
|
||||||
|
description: 'Perform a dry run of the deletion.'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
version:
|
version:
|
||||||
description: 'The version of the edge-connect-client to use.'
|
description: 'The version of the edge-connect-client to use.'
|
||||||
required: false
|
required: false
|
||||||
|
|
@ -44,12 +33,8 @@ runs:
|
||||||
${{ github.action_path }}/endpoint.sh
|
${{ github.action_path }}/endpoint.sh
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
INPUT_NAME: ${{ inputs.name }}
|
INPUT_CONFIG_FILE: ${{ inputs.configFile }}
|
||||||
INPUT_APPVERSION: ${{ inputs.appVersion }}
|
INPUT_DRY_RUN: ${{ inputs.dryRun }}
|
||||||
INPUT_ORG: ${{ inputs.org }}
|
|
||||||
INPUT_REGION: ${{ inputs.region }}
|
|
||||||
INPUT_CLOUDLET_ORG: ${{ inputs.cloudletOrg }}
|
|
||||||
INPUT_CLOUDLET: ${{ inputs.cloudlet }}
|
|
||||||
INPUT_VERSION: ${{ inputs.version }}
|
INPUT_VERSION: ${{ inputs.version }}
|
||||||
EDGE_CONNECT_BASE_URL: ${{ inputs.baseUrl }}
|
EDGE_CONNECT_BASE_URL: ${{ inputs.baseUrl }}
|
||||||
EDGE_CONNECT_USERNAME: ${{ inputs.username }}
|
EDGE_CONNECT_USERNAME: ${{ inputs.username }}
|
||||||
|
|
|
||||||
21
endpoint.sh
21
endpoint.sh
|
|
@ -18,22 +18,17 @@ main() {
|
||||||
local cli_path="${temp_dir}/edge-connect-client"
|
local cli_path="${temp_dir}/edge-connect-client"
|
||||||
chmod +x "${cli_path}"
|
chmod +x "${cli_path}"
|
||||||
|
|
||||||
local -a args_instance_delete
|
local -a args
|
||||||
args_instance_delete=("--name" "${INPUT_NAME}-${INPUT_APPVERSION}-instance" "--org" "${INPUT_ORG}" "--region" "${INPUT_REGION}" "--cloudlet-org" "${INPUT_CLOUDLET_ORG}" "--cloudlet" "${INPUT_CLOUDLET}")
|
args=("--file" "${INPUT_CONFIG_FILE}")
|
||||||
|
|
||||||
echo Executing: "${cli_path}" instance delete "${args_instance_delete[@]}"
|
if [[ "${INPUT_DRY_RUN}" == "true" ]]; then
|
||||||
|
args+=("--dry-run")
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo Executing: "${cli_path}" delete --auto-approve "${args[@]}"
|
||||||
|
|
||||||
# The CLI uses an interactive prompt, so we need to pipe "yes" to it.
|
# The CLI uses an interactive prompt, so we need to pipe "yes" to it.
|
||||||
# we ignore an error by ||true in case the instance does not exist, so that we still delete the app
|
"${cli_path}" delete --auto-approve "${args[@]}"
|
||||||
"${cli_path}" instance delete "${args_instance_delete[@]}" || true
|
|
||||||
|
|
||||||
local -a args_app_delete
|
|
||||||
args_app_delete=("--name" "${INPUT_NAME}" "--version" "${INPUT_APPVERSION}" "--org" "${INPUT_ORG}" "--region" "${INPUT_REGION}")
|
|
||||||
|
|
||||||
echo Executing: "${cli_path}" app delete "${args_app_delete[@]}"
|
|
||||||
|
|
||||||
# The CLI uses an interactive prompt, so we need to pipe "yes" to it.
|
|
||||||
"${cli_path}" app delete "${args_app_delete[@]}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue