Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
  • Loading branch information
therealbobo committed Jun 6, 2024
1 parent 14d967e commit 1ec5368
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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-installer.exe "https://github.com/draios/sysdig/releases/download/${SYSDIG_VERSION_WIN32}/sysdig-${SYSDIG_VERSION_WIN32}-AMD64.exe"
7z e sysdig-installer.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
}

Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 1ec5368

Please sign in to comment.