From ef7745c020d04485d90191634c0bb90dc472d58f Mon Sep 17 00:00:00 2001 From: Daniel Sy Date: Mon, 22 Sep 2025 16:36:13 +0200 Subject: [PATCH] feat(action): :sparkles: Initial commit --- deploy/action.yml | 133 +++++++++++++++++++++++++++++++++++++++++++++ destroy/action.yml | 0 2 files changed, 133 insertions(+) create mode 100644 deploy/action.yml create mode 100644 destroy/action.yml diff --git a/deploy/action.yml b/deploy/action.yml new file mode 100644 index 0000000..e9b4612 --- /dev/null +++ b/deploy/action.yml @@ -0,0 +1,133 @@ +name: 'Deploy to Edge Connect' +author: 'IPCEI' +description: | + Deploys something to Edge Connect. + +inputs: + region: + description: "Application Region e.g. EU" + default: EU + required: true + flavor: + description: "Application Flavor e.g. EU.small" + default: EU.small + required: true + cloudlet: + description: "Cloudlet locations: Amsterdam-OTC, Hamburg, Leipzig, Munich, Berlin, Frankfurt, Magdeburg-OTC, Bonn, Magdeburg" + default: Munich + required: true + edgexr_platform_username: + description: "EdgeXr Platform Username" + required: true + edgexr_platform_password: + description: "EdgeXr Platform Password" + required: true + edge_url: + description: "EdgeXr Platform URL" + default: "hub.apps.edge.platform.mg3.mdb.osc.live" + required: false + +outputs: + url: + description: 'The url of the deployed application' + value: ${{ steps.createappinstance.outputs.url }} + +runs: + using: 'composite' + steps: + - name: Repository meta + id: repository + shell: bash + run: | + registry=${{ github.server_url }} + registry=${registry##http*://} + echo "registry=${registry}" >> "$GITHUB_OUTPUT" + echo "registry=${registry}" + repository="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" + echo "repository=${repository}" >> "$GITHUB_OUTPUT" + echo "repository=${repository}" + - name: Docker meta + uses: docker/metadata-action@v5 + id: docker + with: + images: ${{ steps.repository.outputs.registry }}/${{ steps.repository.outputs.repository }} + - name: Install Dependencies + shell: bash + run: | + sudo apt update + sudo apt install -y curl jq + - + name: Create Edge Connect App + shell: bash + run: | + set -e + echo login + EDGEXR_TOKEN="$(curl -X POST https://${{ inputs.edge_url }}/api/v1/login -H 'Content-Type: application/json' --data '{"password": "'${{ inputs.edgexr_platform_password }}'","username": "'${{ inputs.edgexr_platform_username }}'"}' -sSf | jq -r .token)" + + CREATEAPP_JSON=$(cat <> "$GITHUB_OUTPUT")" diff --git a/destroy/action.yml b/destroy/action.yml new file mode 100644 index 0000000..e69de29