commit 02cd1153bd52aea8190aca1fa24e09b6c2dd682d Author: Daniel Sy Date: Mon Sep 15 14:52:54 2025 +0200 feat(coder): :sparkles: Initial commit diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml new file mode 100644 index 0000000..3d1a205 --- /dev/null +++ b/.forgejo/workflows/build.yaml @@ -0,0 +1,49 @@ +name: build + +on: + push: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - + name: Repository meta + id: repository + 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: Login to registry + uses: docker/login-action@v3 + with: + registry: ${{ steps.repository.outputs.registry }} + username: "${{ secrets.PACKAGES_USER }}" + password: "${{ secrets.PACKAGES_TOKEN }}" + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + buildkitd-flags: '--allow-insecure-entitlement network.host' + driver-opts: network=host + - + name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + allow: network.host + network: host + tags: ${{ steps.docker.outputs.tags }} diff --git a/.forgejo/workflows/createapp.yaml b/.forgejo/workflows/createapp.yaml new file mode 100644 index 0000000..e43f89c --- /dev/null +++ b/.forgejo/workflows/createapp.yaml @@ -0,0 +1,136 @@ +name: createapp + +on: + workflow_dispatch: + inputs: + a_app_region: + type: string + description: "Application Region e.g. EU" + default: EU + required: true + b_app_flavor: + type: string + description: "Application Flavor e.g. EU.small" + default: EU.small + required: true + c_cloudlet: + type: choice + options: + - Amsterdam-OTC + - Hamburg + - Leipzig + - Munich + - Berlin + - Frankfurt + - Magdeburg-OTC + - Bonn + - Magdeburg + - crm-vm-2 + description: "Cloudlet location" + default: Munich + required: true + +env: + EDGEXR_PLATFORM_USERNAME: ${{ secrets.EDGEXR_PLATFORM_USERNAME }} + EDGEXR_PLATFORM_PASSWORD: ${{ secrets.EDGEXR_PLATFORM_PASSWORD }} + APP_REGION: ${{ inputs.a_app_region }} + APP_FLAVOR: ${{ inputs.b_app_flavor }} + CLOUDLET: ${{ inputs.c_cloudlet }} + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - + name: Repository meta + id: repository + 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 + run: | + sudo apt update + sudo apt install -y curl jq + - + name: Create Edge Connect App + run: | + set -e + echo login + EDGEXR_TOKEN="$(curl -X POST https://mc.orca.platform.mg3.mdb.osc.live/api/v1/login -H 'Content-Type: application/json' --data '{"password": "'${EDGEXR_PLATFORM_PASSWORD}'","username": "'${EDGEXR_PLATFORM_USERNAME}'"}' -sSf | jq -r .token)" + + CREATEAPP_JSON=$(cat <> "$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 + run: | + sudo apt update + sudo apt install -y curl jq + - + name: Delete Edge Connect App Instance + run: | + set -e + echo login + EDGEXR_TOKEN="$(curl -X POST https://hub.apps.edge.platform.mg3.mdb.osc.live/api/v1/login -H 'Content-Type: application/json' --data '{"password": "'${EDGEXR_PLATFORM_PASSWORD}'","username": "'${EDGEXR_PLATFORM_USERNAME}'"}' -sSf | jq -r .token)" + + DELETEAPPINSTANCE_JSON=$(cat <