diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e58f0e429ed16..eaf34f4174557 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -278,22 +278,6 @@ jobs: echo "versionOpenSearch_inBuild=$VERSION" >> $GITHUB_OUTPUT echo "VERSION=$VERSION" >> $GITHUB_ENV - - name: PRE Cache /usr/share/wazuh-indexer/bin/opensearch-plugin - id: pre-assemble-cache-usr-share-opensearch-plugins - uses: actions/cache@v4 - with: - path: | - ./usr/share/wazuh-indexer/bin/opensearch-plugin - key: ${{ runner.os }}-usr-share-opensearch-${{ hashFiles('**.jar') }} - restore-keys: | - ${{ runner.os }}-usr-share-opensearch- - ${{ runner.os }}-usr-share-opensearch - - - if: ${{steps.pre-assemble-cache-usr-share-opensearch-plugins.outputs.cache-hit == 'true'}} - name: PRE Cache /usr/share/wazuh-indexer/bin/opensearch-plugin success - run: ls -la ./usr/share/wazuh-indexer/bin/opensearch-plugin - - - name: PRE Cache ~/.m2/repository/org/opensearch id: pre-assemble-cache-m2-repository-opensearch-plugins uses: actions/cache@v4 @@ -309,23 +293,6 @@ jobs: name: PRE Cache ~/.m2/repository/org/opensearch success run: ls -la ~/.m2/repository/org/opensearch - - - name: PRE Cache $HOME/.m2/org/opensearch/plugin/ - id: pre-assemble-cache-home-m2-opensearch-plugins - uses: actions/cache@v4 - with: - path: | - $HOME/.m2/org/opensearch/plugin/ - key: ${{ runner.os }}-home-m2-opensearch-${{ hashFiles('**.xml') }} - restore-keys: | - ${{ runner.os }}-home-m2-opensearch- - ${{ runner.os }}-home-m2-opensearch - - - if: ${{steps.pre-assemble-cache-home-m2-opensearch-plugins.outputs.cache-hit == 'true'}} - name: PRE Cache $HOME/.m2/org/opensearch/plugin/ - run: ls -la $HOME/.m2/org/opensearch/plugin/ - - - name: Run `assemble.sh` run: | bash build-scripts/assemble.sh \ @@ -333,22 +300,6 @@ jobs: -d ${{ matrix.distribution }} \ -r ${{ inputs.revision }} - - name: POST Cache /usr/share/wazuh-indexer/bin/opensearch-plugin - id: post-assemble-cache-usr-share-opensearch-plugins - uses: actions/cache@v4 - with: - path: | - ./usr/share/wazuh-indexer/bin/opensearch-plugin - key: ${{ runner.os }}-usr-share-opensearch-${{ hashFiles('**.jar') }} - restore-keys: | - ${{ runner.os }}-usr-share-opensearch- - ${{ runner.os }}-usr-share-opensearch - - - if: ${{steps.post-assemble-cache-usr-share-opensearch-plugins.outputs.cache-hit == 'true'}} - name: POST Cache /usr/share/wazuh-indexer/bin/opensearch-plugin success - run: ls -la ./usr/share/wazuh-indexer/bin/opensearch-plugin - - - name: POST Cache ~/.m2/repository/org/opensearch id: post-assemble-cache-m2-repository-opensearch-plugins uses: actions/cache@v4 @@ -364,23 +315,6 @@ jobs: name: POST Cache ~/.m2/repository/org/opensearch success run: ls -la ~/.m2/repository/org/opensearch - - - name: POST Cache $HOME/.m2/org/opensearch/plugin/ - id: post-assemble-cache-home-m2-opensearch-plugins - uses: actions/cache@v4 - with: - path: | - $HOME/.m2/org/opensearch/plugin/ - key: ${{ runner.os }}-home-m2-opensearch-${{ hashFiles('**.xml') }} - restore-keys: | - ${{ runner.os }}-home-m2-opensearch- - ${{ runner.os }}-home-m2-opensearch - - - if: ${{steps.pre-assemble-cache-home-m2-opensearch-plugins.outputs.cache-hit == 'true'}} - name: POST Cache $HOME/.m2/org/opensearch/plugin/ - run: ls -la $HOME/.m2/org/opensearch/plugin/ - - - name: Test RPM package if: ${{ matrix.distribution == 'rpm' }} uses: addnab/docker-run-action@v3 diff --git a/build-scripts/assemble.sh b/build-scripts/assemble.sh index de0ee859d02c5..62e2eec30d5ee 100644 --- a/build-scripts/assemble.sh +++ b/build-scripts/assemble.sh @@ -226,18 +226,19 @@ function enable_performance_analyzer_rca() { function install_plugins() { echo "Installing OpenSearch plugins" local maven_repo_local="$HOME/.m2" + echo "Content of .m2/repository/org/opensearch/" + ls la "~/.m2/repository/org/opensearch/" for plugin in "${plugins[@]}"; do echo "Plugin ${plugin}, version ${VERSION}" local plugin_from_maven="org.opensearch.plugin:${plugin}:${VERSION}.0" - if [[ -f "${maven_repo_local}/org/opensearch/plugin/${plugin}/${VERSION}.0/${plugin}-${VERSION}.0.zip" ]]; then + if [[ -f "~/.m2/repository/org/opensearch/${plugin}/${VERSION}.0/${plugin}-${VERSION}.0.pom" ]]; then echo "Plugin ${plugin} is already present, download omitted." else echo "Downloand ${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" fi - echo "Path TO CACHE ${PATH_BIN}/opensearch-plugin and OPENSEARCH_PATH_CONF=$PATH_CONF" - 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"