Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Add CI/CD workflow for extensions (#3007)

Dennis Kuijscf09c1fd48ef
diff --git a/.ci_cd/check_artifacts.sh b/.ci_cd/check_artifacts.sh
new file mode 100755
index 000000000..d68d05a58
--- /dev/null
+++ b/.ci_cd/check_artifacts.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+set -eo pipefail
+
+RELEASED_VERSION="${1:?Usage: $0 <released_version>}"
+
+echo "Check if OpenRemote artifacts '$RELEASED_VERSION' are available."
+STATUS=$(curl --head --silent https://repo1.maven.org/maven2/io/openremote/openremote-manager/$RELEASED_VERSION/openremote-manager-$RELEASED_VERSION.jar --output /dev/null --write-out "%{http_code}")
+COUNT=0
+
+while [ "$STATUS" != 200 ] && [ $COUNT -lt 30 ]; do
+ echo "Artifacts not yet available ... Sleeping 60 seconds"
+ sleep 60
+ STATUS=$(curl --head --silent https://repo1.maven.org/maven2/io/openremote/openremote-manager/$RELEASED_VERSION/openremote-manager-$RELEASED_VERSION.jar --output /dev/null --write-out "%{http_code}")
+ COUNT=$((COUNT+1))
+done
+
+if [ "$STATUS" != '200' ]; then
+ echo "Cannot retrieve artifacts"
+ exit 1
+fi
+
+echo "Artifacts available!"
diff --git a/.ci_cd/ci_cd.json b/.ci_cd/ci_cd.json
index d77cdb304..1f368ccc8 100644
--- a/.ci_cd/ci_cd.json
+++ b/.ci_cd/ci_cd.json
@@ -2,22 +2,22 @@
"push": {
"master": {
"distribute": {
- "docker": "develop",
- "npm": "$version-snapshot"
+ "docker": "develop-core",
+ "npm": "$version-core-snapshot"
},
"deploy": {
- "managerTag": "develop",
+ "managerTag": "develop-core",
"environment": "staging"
}
}
},
"release": {
"distribute": {
- "docker": "latest,$version",
- "npm": "$version"
+ "docker": "latest-core,$version-core",
+ "npm": "$version-core"
},
"deploy": {
- "managerTag": "latest",
+ "managerTag": "latest-core",
"environment": "demo"
}
}
diff --git a/.github/workflows/extensions.yml b/.github/workflows/extensions.yml
new file mode 100644
index 000000000..e82a48edd
--- /dev/null
+++ b/.github/workflows/extensions.yml
@@ -0,0 +1,45 @@
+name: Extensions
+on:
+ workflow_call:
+ inputs:
+ version:
+ type: string
+ is_release:
+ type: boolean
+ secrets:
+ GH_EXTENSIONS_TOKEN:
+ required: true
+
+jobs:
+ check-artifacts:
+ name: Check if artifacts are available
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ - run: |
+ chmod +x .ci_cd/check_artifacts.sh
+ .ci_cd/check_artifacts.sh "$VERSION"
+ env:
+ VERSION: ${{ inputs.version }}
+
+ create-extensions-release:
+ name: Create new release in openremote/extensions
+ runs-on: ubuntu-latest
+ needs: check-artifacts
+ if: ${{ inputs.is_release == true }}
+ steps:
+ - run: gh release create $VERSION -R openremote/extensions --generate-notes
+ env:
+ GH_TOKEN: ${{ secrets.GH_EXTENSIONS_TOKEN }}
+ VERSION: ${{ inputs.version }}
+
+ trigger-extensions-ci-cd:
+ name: Run CI/CD in openremote/extensions
+ runs-on: ubuntu-latest
+ needs: check-artifacts
+ steps:
+ - run: gh workflow run ci_cd.yml -R openremote/extensions -f VERSION="$VERSION" -f IS_RELEASE="$IS_RELEASE"
+ env:
+ GH_TOKEN: ${{ github.token }}
+ VERSION: ${{ inputs.version }}
+ IS_RELEASE: ${{ inputs.is_release }}
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index 63a3f33ce..c752f2dde 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -196,6 +196,17 @@ jobs:
secrets:
NPM_AUTH_TOKEN: ${{ secrets._TEMP_NPM_AUTH_TOKEN }}
+ extensions:
+ name: Extensions
+ needs: [install-dist, publish-maven, publish-npm]
+ if: ${{ !failure() && !cancelled() }}
+ uses: "./.github/workflows/extensions.yml"
+ with:
+ version: ${{ needs.install-dist.outputs.npmTag }}
+ is_release: ${{ steps.get-version-details.outputs.is_release }}
+ secrets:
+ GH_EXTENSIONS_TOKEN: ${{ secrets._TEMP_GH_EXTENSIONS_TOKEN }}
+
deployment:
name: Deploy
needs: [detect-changes, unit-tests, integration-tests, ui-check-outdated-translations, ui-component-tests, ui-app-tests]
diff --git a/profile/dev-ui.yml b/profile/dev-ui.yml
index a45754f1e..b649036c7 100644
--- a/profile/dev-ui.yml
+++ b/profile/dev-ui.yml
@@ -44,9 +44,6 @@ services:
file: deploy.yml
service: manager
image: openremote/manager:${MANAGER_VERSION:-develop}
- build:
- context: ../manager/build/install/manager/
- dockerfile: Dockerfile
depends_on:
postgresql:
condition: service_healthy
@@ -55,5 +52,6 @@ services:
environment:
OR_SETUP_RUN_ON_RESTART: ${OR_SETUP_RUN_ON_RESTART:-true}
OR_DEV_MODE: ${OR_DEV_MODE:-true}
+ OR_SETUP_TYPE: 'demo'
ports:
- "8080:8080"