Skip to content

Commit

Permalink
Merge branch '4.9.0' into 6368-fix-duplicate-help-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Tostti authored Jan 29, 2024
2 parents 9e4501c + b24c15f commit 5a9ed51
Show file tree
Hide file tree
Showing 29 changed files with 507 additions and 34 deletions.
49 changes: 35 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,39 @@
name: Build

on:
workflow_dispatch
workflow_call:
inputs:
CHECKOUT_TO: # This is the branch to checkout to. Defaults to 'master'
description: 'The branch/tag/commit to checkout to'
required: true
default: ''
type: string
workflow_dispatch:
inputs:
CHECKOUT_TO: # This is the branch to checkout to. Defaults to 'master'
description: 'The branch/tag/commit to checkout to'
required: true
default: ''

jobs:
generate-linux-image:
build:
runs-on: ubuntu-latest
name: Generate Linux image
name: Build
defaults:
run:
working-directory: ./artifacts
strategy:
matrix:
include:
- name: Linux x64
ext: tar.gz
suffix: linux-x64
script: build-platform --linux --skip-os-packages --release
DISTRIBUTION: [ tar.gz ]
ARCHITECTURE: [ x64 ]

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: wazuh/wazuh-dashboard
path: ./artifacts
ref: ${{ inputs.CHECKOUT_TO }}

- name: Setup Node
uses: actions/setup-node@v3
Expand Down Expand Up @@ -52,20 +63,30 @@ jobs:
- name: Get package version
run: |
echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV
echo "WZD_VERSION=$(yarn --silent wzd-version)" >> $GITHUB_ENV
echo "WZD_REVISION=$(yarn --silent wzd-revision)" >> $GITHUB_ENV
- name: Get artifact build name
run: |
echo "ARTIFACT_BUILD_NAME=opensearch-dashboards-${{ env.VERSION }}-${{ matrix.suffix }}.${{ matrix.ext }}" >> $GITHUB_ENV
echo "ARTIFACT_BUILD_NAME=wazuh-dashboard_${{ env.WZD_VERSION }}-${{ env.WZD_REVISION }}_${{ matrix.ARCHITECTURE }}_${{ inputs.CHECKOUT_TO }}.${{ matrix.DISTRIBUTION }}" >> $GITHUB_ENV
- name: Run bootstrap
run: yarn osd bootstrap

- name: Build `${{ matrix.name }}`
run: yarn ${{ matrix.script }} --release
- name: Build linux-x64
if: matrix.ARCHITECTURE == 'x64'
run: yarn build-platform --linux --skip-os-packages --release

- name: Build linux-arm64
if: matrix.ARCHITECTURE == 'arm64'
run: yarn build-platform --linux-arm --skip-os-packages --release

- name: Rename artifact
run: mv /home/runner/work/wazuh-dashboard/wazuh-dashboard/artifacts/target/opensearch-dashboards-${{ env.VERSION }}-linux-${{ matrix.ARCHITECTURE }}.${{ matrix.DISTRIBUTION }} /home/runner/work/wazuh-dashboard/wazuh-dashboard/artifacts/target/${{ env.ARTIFACT_BUILD_NAME }}

- uses: actions/upload-artifact@v3
if: success()
with:
name: ${{ matrix.suffix }}-${{ env.VERSION }}
name: ${{ env.ARTIFACT_BUILD_NAME }}
path: ./artifacts/target/${{ env.ARTIFACT_BUILD_NAME }}
retention-days: 30
retention-days: 30
212 changes: 212 additions & 0 deletions .github/workflows/build_wazuh_dashboard_with_plugins.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
name: Build final packages

on:
workflow_dispatch:
inputs:
REFERENCE_SECURITY_PLUGIN:
description: 'Reference Wazuh security packages (branch/tag/commit)'
required: true
default: ''
REFERENCE_WAZUH_PLUGINS:
description: 'Reference Wazuh plugins (branch/tag/commit)'
required: true
default: ''
REFERENCE_WAZUH_DASHBOARD:
description: 'Reference Wazuh dashboard (branch/tag/commit)'
required: true
default: ''
DISTRIBUTION:
description: 'Distribution to build (deb | rpm | tar | all-platforms)'
required: true
default: ''

jobs:
build-plugins:
name: Build plugins
uses: wazuh/wazuh-dashboard-plugins/.github/workflows/manual-build.yml@master
with:
reference: ${{ inputs.REFERENCE_WAZUH_PLUGINS }}

build-dashboard:
name: Build dashboard
uses: wazuh/wazuh-dashboard/.github/workflows/[email protected]
with:
CHECKOUT_TO: ${{ inputs.REFERENCE_WAZUH_DASHBOARD }}

build-security-plugin:
name: Build security plugin
uses: wazuh/wazuh-security-dashboards-plugin/.github/workflows/[email protected]
with:
reference: ${{ inputs.REFERENCE_SECURITY_PLUGIN }}


Build-base-package:
needs: [build-plugins, build-dashboard, build-security-plugin]
runs-on: ubuntu-latest
name: Generate final packages
strategy:
fail-fast: false
matrix:
# TODO: Add arm64 support
ARCHITECTURE: [ x64 ]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Setup variables
run: |
echo "CURRENT_DIR=$(pwd -P)" >> $GITHUB_ENV
echo "VERSION=$(yarn --silent wzd-version)" >> $GITHUB_ENV
echo "REVISION=$(yarn --silent wzd-revision)" >> $GITHUB_ENV
- name: Setup packages names
run: |
echo "WAZUH_DASHBOARD_SLIM=wazuh-dashboard_${{ env.VERSION }}-${{ env.REVISION }}_${{ matrix.ARCHITECTURE }}_${{ inputs.REFERENCE_WAZUH_DASHBOARD }}.tar.gz" >> $GITHUB_ENV
echo "WAZUH_SECURITY_PLUGIN=wazuh-security-dashboards-plugin_${{ env.VERSION }}-${{ env.REVISION }}_${{ inputs.REFERENCE_SECURITY_PLUGIN }}.zip" >> $GITHUB_ENV
echo "WAZUH_PLUGINS=wazuh-dashboard-plugins_${{ env.VERSION }}-${{ env.REVISION }}_${{ inputs.REFERENCE_WAZUH_PLUGINS }}.zip" >> $GITHUB_ENV
- name: Download dashboard artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.WAZUH_DASHBOARD_SLIM }}
path: ${{ env.CURRENT_DIR }}/artifacts/dashboard

- name: Download security plugin artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.WAZUH_SECURITY_PLUGIN }}
path: ${{ env.CURRENT_DIR }}/artifacts/security-plugin

- name: Download plugins artifacts
uses: actions/download-artifact@v3
with:
name: ${{ env.WAZUH_PLUGINS }}
path: ${{ env.CURRENT_DIR }}/artifacts/plugins

- name: Zip plugins
run: |
zip -r -j ${{ env.CURRENT_DIR }}/artifacts/wazuh-package.zip ${{ env.CURRENT_DIR }}/artifacts/plugins
zip -r -j ${{ env.CURRENT_DIR }}/artifacts/security-package.zip ${{ env.CURRENT_DIR }}/artifacts/security-plugin
zip -r -j ${{ env.CURRENT_DIR }}/artifacts/dashboard-package.zip ${{ env.CURRENT_DIR }}/artifacts/dashboard/${{ env.WAZUH_DASHBOARD_SLIM }}
- name: Build packages
run: |
cd ${{ env.CURRENT_DIR }}/dev-tools/build-packages
bash ./build-packages.sh \
-v ${{ env.VERSION }} \
-r ${{ env.REVISION }} \
-a file://${{env.CURRENT_DIR}}/artifacts/wazuh-package.zip \
-s file://${{env.CURRENT_DIR}}/artifacts/security-package.zip \
-b file://${{env.CURRENT_DIR}}/artifacts/dashboard-package.zip \
--tar
- name: Upload tar packages
uses: actions/upload-artifact@v3
with:
name: wazuh-dashboard-${{ env.VERSION }}-${{ env.REVISION }}-linux-${{ matrix.ARCHITECTURE }}.tar.gz
path: ${{ env.CURRENT_DIR }}/dev-tools/build-packages/output/wazuh-dashboard-${{ env.VERSION }}-${{ env.REVISION }}-linux-${{ matrix.ARCHITECTURE }}.tar.gz
retention-days: 30

build-deb-package:
needs: [Build-base-package]
if: ( contains(inputs.DISTRIBUTION, 'deb') || contains(inputs.DISTRIBUTION, 'all-platforms') )
runs-on: ubuntu-latest
name: Build deb package
strategy:
fail-fast: false
matrix:
# TODO: Add arm64 support
ARCHITECTURE: [ x64 ]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Setup variables
run: |
echo "CURRENT_DIR=$(pwd -P)" >> $GITHUB_ENV
echo "VERSION=$(yarn --silent wzd-version)" >> $GITHUB_ENV
echo "REVISION=$(yarn --silent wzd-revision)" >> $GITHUB_ENV
- name: Download dashboard artifact
uses: actions/download-artifact@v3
with:
name: wazuh-dashboard-${{ env.VERSION }}-${{ env.REVISION }}-linux-${{ matrix.ARCHITECTURE }}.tar.gz
path: ${{ env.CURRENT_DIR }}/artifacts/dashboard-tar

- name: Build packages
run: |
cd ${{ env.CURRENT_DIR }}/dev-tools/build-packages/deb/
bash ./launcher.sh \
-v ${{ env.VERSION }} \
-r ${{ env.REVISION }} \
-p file://${{env.CURRENT_DIR}}/artifacts/dashboard-tar/wazuh-dashboard-${{ env.VERSION }}-${{ env.REVISION }}-linux-${{ matrix.ARCHITECTURE }}.tar.gz
- name: Upload deb packages
uses: actions/upload-artifact@v3
if: success()
with:
name: wazuh-dashboard_${{ env.VERSION }}-${{ env.REVISION }}_amd64.deb
path: ${{ env.CURRENT_DIR }}/dev-tools/build-packages/deb/output/wazuh-dashboard_${{ env.VERSION }}-${{ env.REVISION }}_amd64.deb
retention-days: 30


build-rpm-package:
needs: [Build-base-package]
if: ( contains(inputs.DISTRIBUTION, 'rpm') || contains(inputs.DISTRIBUTION, 'all-platforms') )
runs-on: ubuntu-latest
name: Build rpm package
strategy:
fail-fast: false
matrix:
ARCHITECTURE: [ x64 ]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Setup variables
run: |
echo "CURRENT_DIR=$(pwd -P)" >> $GITHUB_ENV
echo "VERSION=$(yarn --silent wzd-version)" >> $GITHUB_ENV
echo "REVISION=$(yarn --silent wzd-revision)" >> $GITHUB_ENV
- name: Download dashboard artifact
uses: actions/download-artifact@v3
with:
name: wazuh-dashboard-${{ env.VERSION }}-${{ env.REVISION }}-linux-${{ matrix.ARCHITECTURE }}.tar.gz
path: ${{ env.CURRENT_DIR }}/artifacts/dashboard-tar

- name: Build packages
run: |
cd ${{ env.CURRENT_DIR }}/dev-tools/build-packages/rpm/
bash ./launcher.sh \
-v ${{ env.VERSION }} \
-r ${{ env.REVISION }} \
-p file://${{env.CURRENT_DIR}}/artifacts/dashboard-tar/wazuh-dashboard-${{ env.VERSION }}-${{ env.REVISION }}-linux-${{ matrix.ARCHITECTURE }}.tar.gz
- name: Upload rpm packages
uses: actions/upload-artifact@v3
if: success()
with:
name: wazuh-dashboard-${{ env.VERSION }}-${{ env.REVISION }}.x86_64.rpm
path: ${{ env.CURRENT_DIR }}/dev-tools/build-packages/rpm/output/wazuh-dashboard-${{ env.VERSION }}-${{ env.REVISION }}.x86_64.rpm
retention-days: 30
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.aws-config.json
.signing-config.json
.ackrc
/dev_tools/build_packages/*/output
/dev-tools/build-packages/*/output
/.opensearch
/.chromium
/package.json.bak
Expand Down
2 changes: 1 addition & 1 deletion config/opensearch_dashboards.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ server.ssl.enabled: true
server.ssl.key: "/etc/wazuh-dashboard/certs/dashboard-key.pem"
server.ssl.certificate: "/etc/wazuh-dashboard/certs/dashboard.pem"
opensearch.ssl.certificateAuthorities: ["/etc/wazuh-dashboard/certs/root-ca.pem"]
uiSettings.overrides.defaultRoute: /app/wazuh
uiSettings.overrides.defaultRoute: /app/wz-home

opensearchDashboards.branding:
useExpandedHeader: false
File renamed without changes.
Loading

0 comments on commit 5a9ed51

Please sign in to comment.