Skip to content

armgit / core

Public Imported from GitHub
0

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

Fix issues with Extensions CI/CD (#3046)

Dennis Kuijsec949bee8edd
diff --git a/.ci_cd/check_artifacts.sh b/.ci_cd/check_artifacts.sh
index d68d05a58..24c41ff5d 100755
--- a/.ci_cd/check_artifacts.sh
+++ b/.ci_cd/check_artifacts.sh
@@ -1,22 +1,46 @@
#!/bin/bash
set -eo pipefail
-RELEASED_VERSION="${1:?Usage: $0 <released_version>}"
+RELEASED_VERSION="${1:?Usage: $0 <released_version> <true or false>}"
+IS_RELEASE="${2:?Usage: $0 <released_version> <true or false>}"
-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
+if [ "$IS_RELEASE" == true ]; then
+ 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=$((COUNT+1))
-done
+ 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!"
+fi
+
+if [ "$IS_RELEASE" == false ]; then
+ echo "Check if OpenRemote SNAPSHOT artifacts '$RELEASED_VERSION' are available."
+ VERSION=$(curl -s "https://central.sonatype.com/repository/maven-snapshots/io/openremote/openremote-manager/maven-metadata.xml" | sed -n 's:.*<latest>\(.*\)</latest>.*:\1:p')
+ COUNT=0
+
+ while [ "$VERSION" != "$RELEASED_VERSION" ] && [ "$COUNT" -lt 30 ]; do
+ echo "SNAPSHOT artifacts not yet available ... Sleeping 60 seconds"
+ sleep 60
+ VERSION=$(curl -s "https://central.sonatype.com/repository/maven-snapshots/io/openremote/openremote-manager/maven-metadata.xml" | sed -n 's:.*<latest>\(.*\)</latest>.*:\1:p')
+ COUNT=$((COUNT+1))
+ done
+
+ if [ "$VERSION" != "$RELEASED_VERSION" ]; then
+ echo "Cannot retrieve SNAPSHOT artifacts"
+ exit 1
+ fi
-if [ "$STATUS" != '200' ]; then
- echo "Cannot retrieve artifacts"
- exit 1
+ echo "SNAPSHOT artifacts available!"
fi
-echo "Artifacts available!"
diff --git a/.github/workflows/extensions.yml b/.github/workflows/extensions.yml
index 1f4414e60..527b1c9aa 100644
--- a/.github/workflows/extensions.yml
+++ b/.github/workflows/extensions.yml
@@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- run: |
chmod +x .ci_cd/check_artifacts.sh
- .ci_cd/check_artifacts.sh "${{ inputs.version }}"
+ .ci_cd/check_artifacts.sh "${{ inputs.version }}" "${{ inputs.is_release }}"
create-extensions-release:
name: Create new release in openremote/extensions
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index d8d1926d7..90c1d5c29 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -198,11 +198,11 @@ jobs:
extensions:
name: Extensions
- needs: [detect-changes, install-dist, publish-maven, publish-npm]
+ needs: [detect-changes, publish-maven, publish-npm]
if: ${{ !failure() && !cancelled() }}
uses: "./.github/workflows/extensions.yml"
with:
- version: ${{ needs.install-dist.outputs.npmTag }}
+ version: ${{ needs.detect-changes.outputs.version_with_qualifier }}
is_release: ${{ needs.detect-changes.outputs.is_release }}
secrets:
GH_EXTENSIONS_TOKEN: ${{ secrets._TEMP_GH_EXTENSIONS_TOKEN }}
diff --git a/manager/build.gradle b/manager/build.gradle
index 24193e932..0f88cdeab 100644
--- a/manager/build.gradle
+++ b/manager/build.gradle
@@ -105,6 +105,7 @@ tasks.withType(Zip) {
distributions {
main {
contents {
+ exclude("**/openremote-demo-setup-*.jar", "**/openremote-energy-extension-*.jar")
from(project.projectDir) {
include("*Dockerfile", "entrypoint.sh", "heapdump-rename.sh")
}