From 1142d46d355bbc24e570c5af76a337ca6c83206a Mon Sep 17 00:00:00 2001 From: Roberto Scolaro Date: Thu, 6 Jun 2024 09:11:32 +0000 Subject: [PATCH] wip Signed-off-by: Roberto Scolaro --- build/build.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/build/build.sh b/build/build.sh index 4da9662..35cabd8 100755 --- a/build/build.sh +++ b/build/build.sh @@ -2,6 +2,7 @@ SYSDIG_VERSION="0.37.1" SYSDIG_VERSION_MAC="0.37.1" +SYSDIG_VERSION_WIN32="0.37.1" # Env parameters # - CLEANUP (default: true) @@ -47,6 +48,14 @@ setup_env() { then BUILD_MAC_INSTALLER=false fi + if [ -z ${BUILD_WIN32} ] + then + BUILD_WIN32=true + fi + if [ -z ${BUILD_WIN32_INSTALLER} ] + then + BUILD_WIN32_INSTALLER=false + fi if [ -z ${ENVIRONMENT} ] then ENVIRONMENT=development @@ -126,6 +135,18 @@ install_dependencies() { cp -v sysdig-${SYSDIG_VERSION_MAC}-x86_64/bin/csysdig deps/sysdig-mac/ cp -vr sysdig-${SYSDIG_VERSION_MAC}-x86_64/share/sysdig/chisels deps/sysdig-mac/ fi + + if [ "${BUILD_WIN32}" = "true" ] || [ "${BUILD_WIN32_INSTALLER}" = "true" ]; then + # WIN32 binaries + + mkdir -p deps/sysdig-win32/chisels + + curl -L -o sysdig.exe "https://github.com/draios/sysdig/releases/download/${SYSDIG_VERSION_WIN32}/sysdig-${SYSDIG_VERSION_WIN32}-AMD64.exe" + 7z e sysdig.exe || true + cp -v sysdig.exe deps/sysdig-win32/ + cp -v csysdig.exe deps/sysdig-win32/ + cp -v *.lua deps/sysdig-win32/chisels + fi fi } @@ -211,6 +232,33 @@ build() { cp electron-out/make/Sysdig\ Inspect-${INSPECT_USER_VERSION}.dmg out/mac/installers/sysdig-inspect-mac-x86_64.dmg fi fi + + if [ "${BUILD_WIN32}" = "true" ] || [ "${BUILD_WIN32_INSTALLER}" = "true" ]; then + # + # build WIN32 package + # + rm -rf out/win32 + + rm -rf ember-electron/resources/sysdig + npm run bundle -- deps/sysdig-mac + if [ "${BUILD_WIN32}" = "true" ]; then + npm run package:win -- --environment ${ENVIRONMENT} --user-tracking-key ${USER_TRACKING_KEY} + fi + if [ "${BUILD_WIN32_INSTALLER}" = "true" ]; then + npm run make:win -- --environment ${ENVIRONMENT} --user-tracking-key ${USER_TRACKING_KEY} + fi + + cd electron-out + ls -lah + zip -ry Sysdig\ Inspect-darwin-x64.zip Sysdig\ Inspect-darwin-x64 + cd .. + mkdir -p out/mac/binaries + cp electron-out/Sysdig\ Inspect-darwin-x64.zip out/mac/binaries/sysdig-inspect-mac-x86_64.zip + if [ "${BUILD_WIN32_INSTALLER}" = "true" ]; then + mkdir -p out/mac/installers + cp electron-out/make/Sysdig\ Inspect-${INSPECT_USER_VERSION}.dmg out/mac/installers/sysdig-inspect-mac-x86_64.dmg + fi + fi } cleanup() {