feat(pipeline): build, create
This commit is contained in:
parent
06b2ccae30
commit
b3b6bf2da7
2 changed files with 45 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
name: ci
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
name: createapp
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
EDGEXR_PLATFORM_USERNAME: ${{ secrets.EDGEXR_PLATFORM_USERNAME }}
|
||||
EDGEXR_PLATFORM_PASSWORD: ${{ secrets.EDGEXR_PLATFORM_PASSWORD }}
|
||||
|
||||
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 Curl
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y curl jq
|
||||
-
|
||||
name: Login Into edgeXR
|
||||
run: |
|
||||
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}'"}' -s | jq -r .token)"
|
||||
-
|
||||
name: Create App
|
||||
run: |
|
||||
curl -X POST https://hub.apps.edge.platform.mg3.mdb.osc.live/api/v1/auth/org/show -H "Authorization: Bearer $EDGEXR_TOKEN"
|
||||
Loading…
Add table
Add a link
Reference in a new issue