Skip to content

Commit

Permalink
[DPE-3309] Add support for repository-gcs (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
phvalguima authored Jan 12, 2024
1 parent ef3406d commit 8b2768d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ./
Expand Down
16 changes: 16 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 8b2768d

Please sign in to comment.