From c873f0d6e6dcf907a103dcb6f36a4c4f1d89ccaa Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Tue, 26 Nov 2024 17:40:54 +0100 Subject: [PATCH 01/17] Add install unzip command --- scripts/test-packages/osd-test-packages.Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/test-packages/osd-test-packages.Dockerfile b/scripts/test-packages/osd-test-packages.Dockerfile index 50fe3a2fef..2799ba22ac 100644 --- a/scripts/test-packages/osd-test-packages.Dockerfile +++ b/scripts/test-packages/osd-test-packages.Dockerfile @@ -15,6 +15,7 @@ ADD ./plugins /tmp/ # RUN rm /tmp/${PACKAGE_NAME} # USER opensearch-dashboards # +RUN apt-get update && apt-get install -y unzip COPY --chown=opensearch-dashboards ./install-plugins.sh / RUN chmod +x /install-plugins.sh RUN /install-plugins.sh From 02ed73b0db7a853210c6568cf9c2fbaebb542856 Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Tue, 26 Nov 2024 17:58:55 +0100 Subject: [PATCH 02/17] Fix unzip command --- scripts/test-packages/osd-test-packages.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test-packages/osd-test-packages.Dockerfile b/scripts/test-packages/osd-test-packages.Dockerfile index 2799ba22ac..6b03b73282 100644 --- a/scripts/test-packages/osd-test-packages.Dockerfile +++ b/scripts/test-packages/osd-test-packages.Dockerfile @@ -15,7 +15,7 @@ ADD ./plugins /tmp/ # RUN rm /tmp/${PACKAGE_NAME} # USER opensearch-dashboards # -RUN apt-get update && apt-get install -y unzip +RUN yum update -y && yum install -y unzip COPY --chown=opensearch-dashboards ./install-plugins.sh / RUN chmod +x /install-plugins.sh RUN /install-plugins.sh From 13b0867f3bf112bf6d82fb67721e7f767861f0c1 Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Tue, 26 Nov 2024 18:20:35 +0100 Subject: [PATCH 03/17] Escalate root user privileges --- .github/workflows/manual-build.yml | 6 +++--- scripts/test-packages/install-plugins.sh | 4 ++-- scripts/test-packages/osd-test-packages.Dockerfile | 11 +++++------ 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/manual-build.yml b/.github/workflows/manual-build.yml index 3d9ef45dd4..223ff7aa96 100644 --- a/.github/workflows/manual-build.yml +++ b/.github/workflows/manual-build.yml @@ -52,21 +52,21 @@ jobs: echo "revision=$(jq -r '.revision' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV echo "versionPlatform=$(jq -r '.pluginPlatform.version' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV - - name: Step 03 - Download the plugin's artifact + - name: Step 03 - Download the main plugin's artifact uses: actions/download-artifact@v4 with: name: wazuh-dashboard-plugins_wazuh_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip overwrite: true - - name: Step 04 - Download the plugin's artifact + - name: Step 04 - Download the core plugin's artifact uses: actions/download-artifact@v4 with: name: wazuh-dashboard-plugins_wazuh-core_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh-core_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip overwrite: true - - name: Step 05 - Download the plugin's artifact + - name: Step 05 - Download the check-updates plugin's artifact uses: actions/download-artifact@v4 with: name: wazuh-dashboard-plugins_wazuh-check-updates_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip diff --git a/scripts/test-packages/install-plugins.sh b/scripts/test-packages/install-plugins.sh index 28e679c332..a4caad68b9 100644 --- a/scripts/test-packages/install-plugins.sh +++ b/scripts/test-packages/install-plugins.sh @@ -1,10 +1,10 @@ - plugins=$(ls /tmp) +plugins=$(ls /tmp) echo $plugins for plugin in $plugins; do echo $plugin unzip $plugin -d /unziped/ done - plugins=$(ls /tmp/unziped) +plugins=$(ls /tmp/unziped) for plugin in $plugins; do echo $plugin /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin install file:///tmp/unziped/$plugin diff --git a/scripts/test-packages/osd-test-packages.Dockerfile b/scripts/test-packages/osd-test-packages.Dockerfile index 6b03b73282..65cd3af9cc 100644 --- a/scripts/test-packages/osd-test-packages.Dockerfile +++ b/scripts/test-packages/osd-test-packages.Dockerfile @@ -8,14 +8,13 @@ ARG PACKAGE_NAME ADD ./plugins /tmp/ # This is needed to run it local -# -# USER root -# RUN yum update -y && yum install -y unzip + +USER root +RUN yum update -y && yum install -y unzip # RUN unzip /tmp/${PACKAGE_NAME} -d /tmp/ # RUN rm /tmp/${PACKAGE_NAME} -# USER opensearch-dashboards -# -RUN yum update -y && yum install -y unzip +USER opensearch-dashboards + COPY --chown=opensearch-dashboards ./install-plugins.sh / RUN chmod +x /install-plugins.sh RUN /install-plugins.sh From 4e52ed83bfe0bb4960c921e56f0015a0dd16de8e Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Tue, 26 Nov 2024 18:34:00 +0100 Subject: [PATCH 04/17] Fix unzip command path --- scripts/test-packages/install-plugins.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test-packages/install-plugins.sh b/scripts/test-packages/install-plugins.sh index a4caad68b9..49d4bd23da 100644 --- a/scripts/test-packages/install-plugins.sh +++ b/scripts/test-packages/install-plugins.sh @@ -2,7 +2,7 @@ plugins=$(ls /tmp) echo $plugins for plugin in $plugins; do echo $plugin - unzip $plugin -d /unziped/ + unzip /tmp/$plugin -d /tmp/unziped/ done plugins=$(ls /tmp/unziped) for plugin in $plugins; do From 122099c964111c569820a4a67a74f03a2f93c0a4 Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Tue, 26 Nov 2024 18:53:45 +0100 Subject: [PATCH 05/17] Unzip in dockefile --- scripts/test-packages/install-plugins.sh | 12 ++++++------ scripts/test-packages/osd-test-packages.Dockerfile | 12 +++++++++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/scripts/test-packages/install-plugins.sh b/scripts/test-packages/install-plugins.sh index 49d4bd23da..cc4663ebdc 100644 --- a/scripts/test-packages/install-plugins.sh +++ b/scripts/test-packages/install-plugins.sh @@ -1,9 +1,9 @@ -plugins=$(ls /tmp) -echo $plugins -for plugin in $plugins; do - echo $plugin - unzip /tmp/$plugin -d /tmp/unziped/ -done +# plugins=$(ls /tmp) +# echo $plugins +# for plugin in $plugins; do +# echo $plugin +# unzip /tmp/$plugin -d /tmp/unziped/ +# done plugins=$(ls /tmp/unziped) for plugin in $plugins; do echo $plugin diff --git a/scripts/test-packages/osd-test-packages.Dockerfile b/scripts/test-packages/osd-test-packages.Dockerfile index 65cd3af9cc..23a332db7b 100644 --- a/scripts/test-packages/osd-test-packages.Dockerfile +++ b/scripts/test-packages/osd-test-packages.Dockerfile @@ -11,8 +11,18 @@ ADD ./plugins /tmp/ USER root RUN yum update -y && yum install -y unzip -# RUN unzip /tmp/${PACKAGE_NAME} -d /tmp/ +RUN plugins=$(ls /tmp) +RUN for plugin in $plugins; do \ + echo $plugin; \ + unzip /tmp/$plugin -d /tmp/unziped/; \ +done # RUN rm /tmp/${PACKAGE_NAME} +# echo $plugins +# for plugin in $plugins; do +# echo $plugin +# unzip /tmp/$plugin -d /tmp/unziped/ +# done + USER opensearch-dashboards COPY --chown=opensearch-dashboards ./install-plugins.sh / From b74f9e2b72d57b80e10e7e152c124ebff53bd378 Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Wed, 27 Nov 2024 11:54:30 +0100 Subject: [PATCH 06/17] Change for loop --- scripts/test-packages/osd-test-packages.Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/test-packages/osd-test-packages.Dockerfile b/scripts/test-packages/osd-test-packages.Dockerfile index 23a332db7b..5426eca6f7 100644 --- a/scripts/test-packages/osd-test-packages.Dockerfile +++ b/scripts/test-packages/osd-test-packages.Dockerfile @@ -11,8 +11,8 @@ ADD ./plugins /tmp/ USER root RUN yum update -y && yum install -y unzip -RUN plugins=$(ls /tmp) -RUN for plugin in $plugins; do \ +RUN sh -x \ +for plugin in $(ls /tmp); do \ echo $plugin; \ unzip /tmp/$plugin -d /tmp/unziped/; \ done From 32c9adf7bc0279bb5e5bc380ebc9d56499f0c21b Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Wed, 27 Nov 2024 12:05:29 +0100 Subject: [PATCH 07/17] Change for loop --- scripts/test-packages/osd-test-packages.Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/test-packages/osd-test-packages.Dockerfile b/scripts/test-packages/osd-test-packages.Dockerfile index 5426eca6f7..8578143742 100644 --- a/scripts/test-packages/osd-test-packages.Dockerfile +++ b/scripts/test-packages/osd-test-packages.Dockerfile @@ -11,8 +11,7 @@ ADD ./plugins /tmp/ USER root RUN yum update -y && yum install -y unzip -RUN sh -x \ -for plugin in $(ls /tmp); do \ +RUN for plugin in $(ls /tmp); do \ echo $plugin; \ unzip /tmp/$plugin -d /tmp/unziped/; \ done @@ -28,4 +27,3 @@ USER opensearch-dashboards COPY --chown=opensearch-dashboards ./install-plugins.sh / RUN chmod +x /install-plugins.sh RUN /install-plugins.sh - From 0b23885a979a797a259fb4b4adb485da4a867d39 Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Wed, 27 Nov 2024 12:28:33 +0100 Subject: [PATCH 08/17] add ls -la --- scripts/test-packages/osd-test-packages.Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/test-packages/osd-test-packages.Dockerfile b/scripts/test-packages/osd-test-packages.Dockerfile index 8578143742..346f000c79 100644 --- a/scripts/test-packages/osd-test-packages.Dockerfile +++ b/scripts/test-packages/osd-test-packages.Dockerfile @@ -11,6 +11,7 @@ ADD ./plugins /tmp/ USER root RUN yum update -y && yum install -y unzip +RUN ls -la /tmp RUN for plugin in $(ls /tmp); do \ echo $plugin; \ unzip /tmp/$plugin -d /tmp/unziped/; \ From ece58fb6c3fb3415f709736cf174ec5d9f00eef5 Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Wed, 27 Nov 2024 12:34:46 +0100 Subject: [PATCH 09/17] Change test plugins path --- scripts/test-packages/osd-test-packages.Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/test-packages/osd-test-packages.Dockerfile b/scripts/test-packages/osd-test-packages.Dockerfile index 346f000c79..ffde4f14aa 100644 --- a/scripts/test-packages/osd-test-packages.Dockerfile +++ b/scripts/test-packages/osd-test-packages.Dockerfile @@ -6,15 +6,16 @@ FROM opensearchproject/opensearch-dashboards:${OSD_VERSION} ARG PACKAGE_NAME -ADD ./plugins /tmp/ +ADD ./plugins /tmp/plugins/ # This is needed to run it local +RUN mkdir /tmp/unziped USER root RUN yum update -y && yum install -y unzip RUN ls -la /tmp -RUN for plugin in $(ls /tmp); do \ +RUN for plugin in $(ls /tmp/plugins); do \ echo $plugin; \ - unzip /tmp/$plugin -d /tmp/unziped/; \ + unzip /tmp/plugins/$plugin -d /tmp/unziped/; \ done # RUN rm /tmp/${PACKAGE_NAME} # echo $plugins From 41b0de5eb522080403408b17498e5fd33aef2e41 Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Wed, 27 Nov 2024 12:40:01 +0100 Subject: [PATCH 10/17] change ls --- scripts/test-packages/osd-test-packages.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test-packages/osd-test-packages.Dockerfile b/scripts/test-packages/osd-test-packages.Dockerfile index ffde4f14aa..8bc8edb661 100644 --- a/scripts/test-packages/osd-test-packages.Dockerfile +++ b/scripts/test-packages/osd-test-packages.Dockerfile @@ -12,7 +12,7 @@ ADD ./plugins /tmp/plugins/ RUN mkdir /tmp/unziped USER root RUN yum update -y && yum install -y unzip -RUN ls -la /tmp +RUN ls -la /tmp/plugins RUN for plugin in $(ls /tmp/plugins); do \ echo $plugin; \ unzip /tmp/plugins/$plugin -d /tmp/unziped/; \ From 9c831e9d6cfc33f6ece1ea323a9592e26c17427d Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Wed, 27 Nov 2024 12:47:37 +0100 Subject: [PATCH 11/17] change folder name --- scripts/test-packages/osd-test-packages.Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/test-packages/osd-test-packages.Dockerfile b/scripts/test-packages/osd-test-packages.Dockerfile index 8bc8edb661..2470f38c66 100644 --- a/scripts/test-packages/osd-test-packages.Dockerfile +++ b/scripts/test-packages/osd-test-packages.Dockerfile @@ -11,11 +11,13 @@ ADD ./plugins /tmp/plugins/ RUN mkdir /tmp/unziped USER root +RUN mkdir /tmp/test +RUN cp /tmp/plugins/* /tmp/test RUN yum update -y && yum install -y unzip -RUN ls -la /tmp/plugins -RUN for plugin in $(ls /tmp/plugins); do \ +RUN ls -la /tmp/test +RUN for plugin in $(ls /tmp/test); do \ echo $plugin; \ - unzip /tmp/plugins/$plugin -d /tmp/unziped/; \ + unzip /tmp/test/$plugin -d /tmp/unziped/; \ done # RUN rm /tmp/${PACKAGE_NAME} # echo $plugins From 40d7f387432f66c4bd3f73a07f1a6cd478a6d7bf Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Wed, 27 Nov 2024 13:07:32 +0100 Subject: [PATCH 12/17] Comment the unzip process --- scripts/test-packages/install-plugins.sh | 4 ++-- .../osd-test-packages.Dockerfile | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/test-packages/install-plugins.sh b/scripts/test-packages/install-plugins.sh index cc4663ebdc..b8a69da704 100644 --- a/scripts/test-packages/install-plugins.sh +++ b/scripts/test-packages/install-plugins.sh @@ -4,8 +4,8 @@ # echo $plugin # unzip /tmp/$plugin -d /tmp/unziped/ # done -plugins=$(ls /tmp/unziped) +plugins=$(ls /tmp/plugins) for plugin in $plugins; do echo $plugin - /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin install file:///tmp/unziped/$plugin + /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin install file:///tmp/plugins/$plugin/$(ls /tmp/plugins/$plugin) done diff --git a/scripts/test-packages/osd-test-packages.Dockerfile b/scripts/test-packages/osd-test-packages.Dockerfile index 2470f38c66..337b386ceb 100644 --- a/scripts/test-packages/osd-test-packages.Dockerfile +++ b/scripts/test-packages/osd-test-packages.Dockerfile @@ -9,16 +9,16 @@ ARG PACKAGE_NAME ADD ./plugins /tmp/plugins/ # This is needed to run it local -RUN mkdir /tmp/unziped -USER root -RUN mkdir /tmp/test -RUN cp /tmp/plugins/* /tmp/test -RUN yum update -y && yum install -y unzip -RUN ls -la /tmp/test -RUN for plugin in $(ls /tmp/test); do \ - echo $plugin; \ - unzip /tmp/test/$plugin -d /tmp/unziped/; \ -done +# RUN mkdir /tmp/unziped +# USER root +# RUN mkdir /tmp/test +# RUN cp /tmp/plugins/* /tmp/test +# RUN yum update -y && yum install -y unzip +# RUN ls -la /tmp/test +# RUN for plugin in $(ls /tmp/test); do \ +# echo $plugin; \ +# unzip /tmp/test/$plugin -d /tmp/unziped/; \ +# done # RUN rm /tmp/${PACKAGE_NAME} # echo $plugins # for plugin in $plugins; do From 0cbb47e669545b6d1b154c2bf441bd339819d471 Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Wed, 27 Nov 2024 13:21:47 +0100 Subject: [PATCH 13/17] Clean code --- scripts/test-packages/install-plugins.sh | 11 +++------ .../osd-test-packages.Dockerfile | 23 ++++--------------- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/scripts/test-packages/install-plugins.sh b/scripts/test-packages/install-plugins.sh index b8a69da704..f4a52643a2 100644 --- a/scripts/test-packages/install-plugins.sh +++ b/scripts/test-packages/install-plugins.sh @@ -1,11 +1,6 @@ -# plugins=$(ls /tmp) -# echo $plugins -# for plugin in $plugins; do -# echo $plugin -# unzip /tmp/$plugin -d /tmp/unziped/ -# done -plugins=$(ls /tmp/plugins) +plugins=$(ls /tmp) for plugin in $plugins; do echo $plugin - /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin install file:///tmp/plugins/$plugin/$(ls /tmp/plugins/$plugin) + /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin install file:///tmp/$plugin/$(ls /tmp/$plugin) done +echo "All plugins installed successfully" diff --git a/scripts/test-packages/osd-test-packages.Dockerfile b/scripts/test-packages/osd-test-packages.Dockerfile index 337b386ceb..b7e5c7ef50 100644 --- a/scripts/test-packages/osd-test-packages.Dockerfile +++ b/scripts/test-packages/osd-test-packages.Dockerfile @@ -6,28 +6,15 @@ FROM opensearchproject/opensearch-dashboards:${OSD_VERSION} ARG PACKAGE_NAME -ADD ./plugins /tmp/plugins/ +ADD ./plugins /tmp/ # This is needed to run it local - -# RUN mkdir /tmp/unziped +# # USER root -# RUN mkdir /tmp/test -# RUN cp /tmp/plugins/* /tmp/test # RUN yum update -y && yum install -y unzip -# RUN ls -la /tmp/test -# RUN for plugin in $(ls /tmp/test); do \ -# echo $plugin; \ -# unzip /tmp/test/$plugin -d /tmp/unziped/; \ -# done +# RUN unzip /tmp/${PACKAGE_NAME} -d /tmp/ # RUN rm /tmp/${PACKAGE_NAME} -# echo $plugins -# for plugin in $plugins; do -# echo $plugin -# unzip /tmp/$plugin -d /tmp/unziped/ -# done - -USER opensearch-dashboards - +# USER opensearch-dashboards +# COPY --chown=opensearch-dashboards ./install-plugins.sh / RUN chmod +x /install-plugins.sh RUN /install-plugins.sh From 30e5d51c1b329ea61523c517259d0ed8aa8217c0 Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Wed, 27 Nov 2024 13:42:21 +0100 Subject: [PATCH 14/17] Format artifact name with slash --- .github/workflows/dev-environment.yml | 5 +++-- .github/workflows/manual-build.yml | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dev-environment.yml b/.github/workflows/dev-environment.yml index 32d9fb5d95..d37987b9ef 100644 --- a/.github/workflows/dev-environment.yml +++ b/.github/workflows/dev-environment.yml @@ -108,8 +108,9 @@ jobs: cd /home/node/kbn/plugins/${{ matrix.plugins.container_path }} && yarn && ${{ inputs.command }}; ' - - name: Get the plugin version + - name: Get the plugin version and and format reference name run: | + echo "githubReference=$(echo ${{ inputs.reference }} | sed 's/\//-/g')" >> $GITHUB_ENV echo "version=$(jq -r '.version' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV echo "revision=$(jq -r '.revision' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV @@ -117,7 +118,7 @@ jobs: if: ${{ inputs.artifact_name && inputs.artifact_path }} uses: actions/upload-artifact@v4 with: - name: ${{ inputs.artifact_name }}_${{ matrix.plugins.container_path }}_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip + name: ${{ inputs.artifact_name }}_${{ matrix.plugins.container_path }}_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip path: ${{ matrix.plugins.path }}/${{ inputs.artifact_path }} if-no-files-found: 'error' overwrite: true diff --git a/.github/workflows/manual-build.yml b/.github/workflows/manual-build.yml index 223ff7aa96..8b0ad88084 100644 --- a/.github/workflows/manual-build.yml +++ b/.github/workflows/manual-build.yml @@ -45,8 +45,9 @@ jobs: ref: ${{ inputs.reference }} path: wazuh - - name: Step 02 - Get version and revision + - name: Step 02 - Set variables run: | + echo "githubReference=$(echo ${{ inputs.reference }} | sed 's/\//-/g')" >> $GITHUB_ENV echo "currentDir=$(pwd -P)" >> $GITHUB_ENV echo "version=$(jq -r '.version' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV echo "revision=$(jq -r '.revision' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV @@ -56,21 +57,21 @@ jobs: uses: actions/download-artifact@v4 with: name: wazuh-dashboard-plugins_wazuh_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip - path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip + path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip overwrite: true - name: Step 04 - Download the core plugin's artifact uses: actions/download-artifact@v4 with: name: wazuh-dashboard-plugins_wazuh-core_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip - path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh-core_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip + path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh-core_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip overwrite: true - name: Step 05 - Download the check-updates plugin's artifact uses: actions/download-artifact@v4 with: name: wazuh-dashboard-plugins_wazuh-check-updates_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip - path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh-check-updates_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip + path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh-check-updates_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip overwrite: true - name: Step 06 - Build the Docker image From f55e190ba359e27bbb6dd5022d485afb56d513bf Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Wed, 27 Nov 2024 14:02:13 +0100 Subject: [PATCH 15/17] Implement githubReference --- .github/workflows/manual-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/manual-build.yml b/.github/workflows/manual-build.yml index 8b0ad88084..e8c03183da 100644 --- a/.github/workflows/manual-build.yml +++ b/.github/workflows/manual-build.yml @@ -56,21 +56,21 @@ jobs: - name: Step 03 - Download the main plugin's artifact uses: actions/download-artifact@v4 with: - name: wazuh-dashboard-plugins_wazuh_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip + name: wazuh-dashboard-plugins_wazuh_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip overwrite: true - name: Step 04 - Download the core plugin's artifact uses: actions/download-artifact@v4 with: - name: wazuh-dashboard-plugins_wazuh-core_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip + name: wazuh-dashboard-plugins_wazuh-core_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh-core_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip overwrite: true - name: Step 05 - Download the check-updates plugin's artifact uses: actions/download-artifact@v4 with: - name: wazuh-dashboard-plugins_wazuh-check-updates_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip + name: wazuh-dashboard-plugins_wazuh-check-updates_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh-check-updates_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip overwrite: true From a77cf5c8458fe3185d7454ddfe6822f9c0071e25 Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Wed, 27 Nov 2024 18:00:24 +0100 Subject: [PATCH 16/17] Test set -e --- scripts/test-packages/install-plugins.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/test-packages/install-plugins.sh b/scripts/test-packages/install-plugins.sh index f4a52643a2..2429238ed4 100644 --- a/scripts/test-packages/install-plugins.sh +++ b/scripts/test-packages/install-plugins.sh @@ -1,6 +1,8 @@ +set -e + plugins=$(ls /tmp) for plugin in $plugins; do echo $plugin - /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin install file:///tmp/$plugin/$(ls /tmp/$plugin) + /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin install file:///tmpf/$plugin/$(ls /tmp/$plugin) done echo "All plugins installed successfully" From c665466fc6ca439f46aa569a2f02fbc5379f3ff5 Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Wed, 27 Nov 2024 18:22:12 +0100 Subject: [PATCH 17/17] Remove set -e test --- scripts/test-packages/install-plugins.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test-packages/install-plugins.sh b/scripts/test-packages/install-plugins.sh index 2429238ed4..411c022666 100644 --- a/scripts/test-packages/install-plugins.sh +++ b/scripts/test-packages/install-plugins.sh @@ -3,6 +3,6 @@ set -e plugins=$(ls /tmp) for plugin in $plugins; do echo $plugin - /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin install file:///tmpf/$plugin/$(ls /tmp/$plugin) + /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin install file:///tmp/$plugin/$(ls /tmp/$plugin) done echo "All plugins installed successfully"