From f7596d6ecf2c92afae317da75897da468a0e29c9 Mon Sep 17 00:00:00 2001 From: "franz.germann" Date: Thu, 14 Aug 2025 11:25:00 +0200 Subject: [PATCH] feat: add input parameters to pipeline --- .forgejo/workflows/createapp.yaml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/createapp.yaml b/.forgejo/workflows/createapp.yaml index f2c2920..b66fd57 100644 --- a/.forgejo/workflows/createapp.yaml +++ b/.forgejo/workflows/createapp.yaml @@ -2,10 +2,26 @@ name: createapp on: workflow_dispatch: + inputs: + a_app_version: + type: string + description: "Application Version e.g. 1.0.0" + required: true + b_app_region: + type: string + description: "Application Region e.g. EU" + default: EU + c_app_flavor: + type: string + description: "Application Flavor e.g. EU.small" + default: EU.small env: EDGEXR_PLATFORM_USERNAME: ${{ secrets.EDGEXR_PLATFORM_USERNAME }} EDGEXR_PLATFORM_PASSWORD: ${{ secrets.EDGEXR_PLATFORM_PASSWORD }} + APP_VERSION: ${{ inputs.a_app_version }} + APP_REGION: ${{ inputs.b_app_region }} + APP_FLAVOR: ${{ inputs.c_app_flavor }} jobs: build: @@ -46,22 +62,24 @@ jobs: "App": { "key": { "organization": "edp-developer-framework", - "name": "HelloWorldAuto", - "version": "1.0" + "name": "${{ steps.repository.outputs.repository }}", + "version": "${APP_VERSION}" }, - "image_path": "edp.buildth.ing/devfw-cicd/fibonacci_pipeline:development", + "image_path": "${{ steps.repository.outputs.registry }}/${{ steps.repository.outputs.repository }}:${{ steps.docker.outputs.tags }}", "image_type": "Docker", "access_ports": "tcp:80", "default_flavor": { - "name": "EU.small" + "name": "${APP_FLAVOR}" }, "deployment": "docker", "required_outbound_connections": null }, - "Region": "EU" + "Region": "${APP_REGION}" } EOF ) + echo $CREATEAPP_JSON + echo create app curl -X POST https://hub.apps.edge.platform.mg3.mdb.osc.live/api/v1/auth/ctrl/CreateApp -H 'Content-Type: application/json' -H "Authorization: Bearer $EDGEXR_TOKEN" -Sf --data "$CREATEAPP_JSON" \ No newline at end of file