From 5ae005ada34d8231c7aa5337ae0aecf6fa229c90 Mon Sep 17 00:00:00 2001 From: Malena Casas Date: Thu, 14 Nov 2024 14:45:00 -0300 Subject: [PATCH] =?UTF-8?q?Add=20versi=C3=B3n=20of=20OpenSearch=20to=20key?= =?UTF-8?q?=20of=20cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 12 ++++++------ build-scripts/assemble.sh | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 68c89f0e20e7a..49295a6a02fee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -279,6 +279,8 @@ jobs: VERSION=$(bash build-scripts/upstream-version.sh) echo "versionOpenSearch_inBuild=$VERSION" >> $GITHUB_OUTPUT echo "VERSION=$VERSION" >> $GITHUB_ENV + env: + opensearch_version: bash build-scripts/upstream-version.sh - name: PRE Cache ${{ env.maven_local_path }} id: pre-assemble-cache-m2-opensearch-plugins @@ -286,10 +288,9 @@ jobs: with: path: | ${{ env.maven_local_path }} - key: ${{ runner.os }}-m2-opensearch-plugin-${{ hashFiles('**.sha1') }} + key: ${{ runner.os }}-m2-opensearch-${{ opensearch_version }}-plugin-${{ hashFiles('**.sha1') }} restore-keys: | - ${{ runner.os }}-m2-opensearch-plugin- - ${{ runner.os }}-m2-opensearch-plugin + ${{ runner.os }}-m2-opensearch-plugin-${{ opensearch_version }}- - if: ${{steps.pre-assemble-cache-m2-opensearch-plugins.outputs.cache-hit == 'true'}} name: PRE Cache ${{ env.maven_local_path }} success @@ -308,10 +309,9 @@ jobs: with: path: | ${{ env.maven_local_path }} - key: ${{ runner.os }}-m2-opensearch-plugin-${{ hashFiles('**.sha1') }} + key: ${{ runner.os }}-m2-opensearch-${{ opensearch_version }}-plugin-${{ hashFiles('**.sha1') }} restore-keys: | - ${{ runner.os }}-m2-opensearch-plugin- - ${{ runner.os }}-m2-opensearch-plugin + ${{ runner.os }}-m2-opensearch-plugin-${{ opensearch_version }}- - if: ${{steps.post-assemble-cache-m2-opensearch-plugins.outputs.cache-hit == 'true'}} name: POST Cache ${{ env.maven_local_path }} success diff --git a/build-scripts/assemble.sh b/build-scripts/assemble.sh index 78f90ce17a719..9149a5538bf98 100644 --- a/build-scripts/assemble.sh +++ b/build-scripts/assemble.sh @@ -234,7 +234,6 @@ function install_plugins() { echo "Download ${plugin} plugin." mvn -Dmaven.repo.local="${maven_repo_local}" org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl=https://repo1.maven.org/maven2 -Dartifact="${plugin_from_maven}:zip" OPENSEARCH_PATH_CONF=$PATH_CONF "${PATH_BIN}/opensearch-plugin" install --batch --verbose "file:${maven_repo_local}/org/opensearch/plugin/${plugin}/${VERSION}.0/${plugin}-${VERSION}.0.zip" - done echo "Installing Wazuh plugins"