Skip to content

Commit cd0d865

Browse files
committed
wip
Signed-off-by: Roberto Scolaro <[email protected]>
1 parent 14d967e commit cd0d865

File tree

3 files changed

+99
-25
lines changed

3 files changed

+99
-25
lines changed

.github/workflows/ci.yaml

+32-12
Original file line numberDiff line numberDiff line change
@@ -25,38 +25,58 @@ jobs:
2525
print(f'version={version}'.lower(), file=ofp)
2626
print(f'semver={semver}'.lower(), file=ofp)
2727
28+
update-builder:
29+
env:
30+
REGISTRY: ghcr.io
31+
BUILDER_IMAGE: ghcr.io/draios/sysdig-inspect-builder
32+
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout Sysdig
36+
uses: actions/checkout@v3
37+
38+
- name: Set up Docker Buildx
39+
uses: docker/setup-buildx-action@v2
40+
41+
- name: Login to Github Packages
42+
uses: docker/login-action@v2
43+
with:
44+
registry: ${{ env.REGISTRY }}
45+
username: ${{ github.actor }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Build new builder
49+
id: build-skeleton-builder
50+
uses: docker/build-push-action@v3
51+
with:
52+
context: .
53+
file: build/Dockerfile
54+
tags: ${{ format('{0}:dev,{0}:{1}', env.BUILDER_IMAGE, github.sha) }}
55+
push: true
56+
2857

2958
build-sysdig-inspect:
3059
needs: [build-settings]
3160
env:
32-
BUILDER: "sysdiglabs/sysdig-inspect-builder:0.2"
61+
BUILDER: "ghcr.io/draios/sysdig-inspect-builder:dev"
3362
SEMVER: ${{ needs.build-settings.outputs.semver }}
3463
VERSION: ${{ needs.build-settings.outputs.version }}
3564

3665
runs-on: ubuntu-latest
3766
container:
38-
image: "sysdiglabs/sysdig-inspect-builder:0.2"
67+
image: ${{ env.BUILDER }}
3968
env:
4069
INSTALL_DEPS: true
4170
GIT_BRANCH: dev
4271
SEMVER: ${{ needs.build-settings.outputs.semver }}
4372
VERSION: ${{ needs.build-settings.outputs.version }}
4473
BUILD_MAC: true
74+
BUILD_WIN32: true
4575
volumes:
4676
- /var/run/docker.sock:/var/run/docker.sock
4777
steps:
4878
- name: Checkout Sysdig
4979
uses: actions/checkout@v3
50-
- name: install 7z
51-
run: |
52-
cd /tmp
53-
sed -i '/^mozilla\/DST_Root_CA_X3/s/^/!/' /etc/ca-certificates.conf &&
54-
update-ca-certificates -f &&
55-
curl -L -o 7z.tar.xz https://www.7-zip.org/a/7z2301-linux-x64.tar.xz &&
56-
tar -xaf 7z.tar.xz &&
57-
mv 7zz /usr/bin/7z &&
58-
rm -vfr /tmp/* &&
59-
cd -
6080
- name: Build sysdig-inspect
6181
run: ./build/build.sh
6282
- name: Upload artifacts rpm

build/Dockerfile

+17-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:stable-slim
1+
FROM debian:buster
22

33

44

@@ -24,18 +24,22 @@ RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
2424

2525
# Install the latest Docker CE binaries
2626
# From https://github.com/getintodevops/jenkins-withdocker/blob/master/Dockerfile
27-
RUN apt-get install -y \
28-
apt-transport-https \
29-
ca-certificates \
30-
gnupg2 \
31-
software-properties-common && \
32-
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg > /tmp/dkey; apt-key add /tmp/dkey && \
33-
add-apt-repository \
34-
"deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \
35-
$(lsb_release -cs) \
36-
stable" && \
37-
apt-get update -qq && \
38-
apt-get install -y docker-ce
27+
RUN dpkg --add-architecture i386 && \
28+
apt-get update && \
29+
apt-get install -y \
30+
apt-transport-https \
31+
wine wine32 \
32+
ca-certificates \
33+
gnupg2 \
34+
p7zip-full \
35+
software-properties-common && \
36+
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg > /tmp/dkey; apt-key add /tmp/dkey && \
37+
add-apt-repository \
38+
"deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \
39+
$(lsb_release -cs) \
40+
stable" && \
41+
apt-get update -qq && \
42+
apt-get install -y docker-ce
3943

4044
# Cleanup
4145
RUN apt-get clean && \

build/build.sh

+50
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
SYSDIG_VERSION="0.37.1"
44
SYSDIG_VERSION_MAC="0.37.1"
5+
SYSDIG_VERSION_WIN32="0.37.1"
56

67
# Env parameters
78
# - CLEANUP (default: true)
@@ -47,6 +48,14 @@ setup_env() {
4748
then
4849
BUILD_MAC_INSTALLER=false
4950
fi
51+
if [ -z ${BUILD_WIN32} ]
52+
then
53+
BUILD_WIN32=true
54+
fi
55+
if [ -z ${BUILD_WIN32_INSTALLER} ]
56+
then
57+
BUILD_WIN32_INSTALLER=false
58+
fi
5059
if [ -z ${ENVIRONMENT} ]
5160
then
5261
ENVIRONMENT=development
@@ -126,6 +135,20 @@ install_dependencies() {
126135
cp -v sysdig-${SYSDIG_VERSION_MAC}-x86_64/bin/csysdig deps/sysdig-mac/
127136
cp -vr sysdig-${SYSDIG_VERSION_MAC}-x86_64/share/sysdig/chisels deps/sysdig-mac/
128137
fi
138+
139+
if [ "${BUILD_WIN32}" = "true" ] || [ "${BUILD_WIN32_INSTALLER}" = "true" ]; then
140+
# WIN32 binaries
141+
142+
mkdir -p deps/sysdig-win32/chisels
143+
mkdir win32
144+
cd win32
145+
curl -L -o sysdig-installer.exe "https://github.com/draios/sysdig/releases/download/${SYSDIG_VERSION_WIN32}/sysdig-${SYSDIG_VERSION_WIN32}-AMD64.exe"
146+
7z e sysdig-installer.exe || true
147+
cd ..
148+
cp -v win32/sysdig.exe deps/sysdig-win32/
149+
cp -v win32/csysdig.exe deps/sysdig-win32/
150+
cp -v win32/*.lua deps/sysdig-win32/chisels
151+
fi
129152
fi
130153
}
131154

@@ -211,6 +234,33 @@ build() {
211234
cp electron-out/make/Sysdig\ Inspect-${INSPECT_USER_VERSION}.dmg out/mac/installers/sysdig-inspect-mac-x86_64.dmg
212235
fi
213236
fi
237+
238+
if [ "${BUILD_WIN32}" = "true" ] || [ "${BUILD_WIN32_INSTALLER}" = "true" ]; then
239+
#
240+
# build WIN32 package
241+
#
242+
rm -rf out/win32
243+
244+
rm -rf ember-electron/resources/sysdig
245+
npm run bundle -- deps/sysdig-mac
246+
if [ "${BUILD_WIN32}" = "true" ]; then
247+
npm run package:win -- --environment ${ENVIRONMENT} --user-tracking-key ${USER_TRACKING_KEY}
248+
fi
249+
if [ "${BUILD_WIN32_INSTALLER}" = "true" ]; then
250+
npm run make:win -- --environment ${ENVIRONMENT} --user-tracking-key ${USER_TRACKING_KEY}
251+
fi
252+
253+
cd electron-out
254+
ls -lah
255+
zip -ry Sysdig\ Inspect-darwin-x64.zip Sysdig\ Inspect-darwin-x64
256+
cd ..
257+
mkdir -p out/mac/binaries
258+
cp electron-out/Sysdig\ Inspect-darwin-x64.zip out/mac/binaries/sysdig-inspect-mac-x86_64.zip
259+
if [ "${BUILD_WIN32_INSTALLER}" = "true" ]; then
260+
mkdir -p out/mac/installers
261+
cp electron-out/make/Sysdig\ Inspect-${INSPECT_USER_VERSION}.dmg out/mac/installers/sysdig-inspect-mac-x86_64.dmg
262+
fi
263+
fi
214264
}
215265

216266
cleanup() {

0 commit comments

Comments
 (0)