From 8b2768d3f9cfdb181d9421c1864b9aed817a43c0 Mon Sep 17 00:00:00 2001 From: phvalguima Date: Fri, 12 Jan 2024 11:01:04 +0100 Subject: [PATCH] [DPE-3309] Add support for repository-gcs (#50) --- .github/workflows/ci.yaml | 7 ++++++- snap/snapcraft.yaml | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fed23c0..cf0a85e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -143,7 +143,7 @@ jobs: exit 1 fi - - name: Check if Prometheus Exporter and repository-s3 plugins are available + - name: Check if Prometheus Exporter and repository plugins are available env: OPENSEARCH_JAVA_HOME: /snap/opensearch/current/usr/lib/jvm/java-17-openjdk-amd64 OPENSEARCH_BIN: /snap/opensearch/current/usr/share/opensearch/bin @@ -162,6 +162,11 @@ jobs: if [ ! "$repository_s3_is_there" ]; then exit 1 fi + # repository-gcs appears in plugins listing + repository_gcs_is_there=$(sudo -E "${OPENSEARCH_BIN}"/opensearch-plugin list | grep repository-gcs) + if [ ! "$repository_gcs_is_there" ]; then + exit 1 + fi # Prometheus exporter can be queried sudo cp /var/snap/opensearch/current/etc/opensearch/certificates/node-cm0.pem ./ diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 57b36b9..9003aac 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -230,6 +230,22 @@ parts: rm -rf "${CRAFT_PART_INSTALL}/${res}" done + opensearch-plugin-repository-gcs: + plugin: nil + after: [opensearch] + override-build: | + # update deps + apt-get install unzip + version="$(craftctl get version)" + archive="repository-gcs-${version}.zip" + url="https://artifacts.opensearch.org/releases/plugins/repository-gcs/${version}/${archive}" + curl -L -o "${archive}" "${url}" + unzip "${archive}" -d "${CRAFT_PART_INSTALL}/repository-gcs" + mkdir -p "${CRAFT_PART_INSTALL}/usr/share/opensearch/plugins" + mv "${CRAFT_PART_INSTALL}/repository-gcs" "${CRAFT_PART_INSTALL}/usr/share/opensearch/plugins" + # Final clean-up + rm "${archive}" + opensearch-plugin-repository-s3: plugin: nil after: [opensearch]