Skip to content

Commit

Permalink
🔨 Update offline package script (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
tosone authored Dec 28, 2023
1 parent ed54a1c commit aa4b99f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
9 changes: 6 additions & 3 deletions scripts/offline-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ DOCKER=${DOCKER:-docker}
"$DOCKER" pull ghcr.io/go-sigma/sigma:nightly-alpine
"$DOCKER" pull redis:7.0-alpine
"$DOCKER" pull mysql:8.0
"$DOCKER" pull postgres:15-alpine

"$DOCKER" save quay.io/minio/minio:RELEASE.2023-11-20T22-40-07Z ghcr.io/go-sigma/sigma:nightly-alpine ghcr.io/go-sigma/sigma-builder:nightly redis:7.0-alpine mysql:8.0 postgres:15-alpine | gzip > sigma.tar.gz
"$DOCKER" save quay.io/minio/minio:RELEASE.2023-11-20T22-40-07Z ghcr.io/go-sigma/sigma:nightly-alpine ghcr.io/go-sigma/sigma-builder:nightly redis:7.0-alpine mysql:8.0 | gzip > sigma.tar.gz

if [ -d package ]; then
rm -rf package
Expand All @@ -26,6 +25,10 @@ cp conf/sigma.test.io.crt ./package/sigma/conf/
cp conf/sigma.test.io.key ./package/sigma/conf/
mv ./sigma.tar.gz ./package/sigma

tar zcvf sigma-offline.tar.gz -C ./package sigma
if [ -f sigma-offline.tar.gz ]; then
rm sigma-offline.tar.gz
fi

tar zcf sigma-offline.tar.gz -C ./package sigma

rm -rf ./package
13 changes: 11 additions & 2 deletions scripts/samples/restart.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/bin/sh

DOCKER=${DOCKER:-docker}
SIGMA_VOLUME=${SIGMA_VOLUME:-$PWD}

if [ "$SIGMA_VOLUME" != "$PWD" ]; then
cp -rf sigma.tar.gz "$SIGMA_VOLUME"
cp -rf docker-compose.yml "$SIGMA_VOLUME"
cp -rf samples "$SIGMA_VOLUME"
fi

"$DOCKER" exec -it sigma-dind \
cd /app && docker load -i sigma.tar.gz && \
sh -c 'cd /app && docker load -i sigma.tar.gz && \
docker compose --project-name sigma down && \
docker compose --project-name sigma -f /app/docker-compose.yml up --detach
docker compose --project-name sigma -f /app/docker-compose.yml up --detach'
2 changes: 1 addition & 1 deletion scripts/samples/samples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ push_image test-size-limit centos:8

if [ ! -f "./helm" ]; then
curl -sL https://get.helm.sh/helm-v3.13.1-linux-arm64.tar.gz | tar xvz --strip-components 1
rm LICENSE README.md
rm LICENSE README.md
fi

if [ -d "./demo" ]; then
Expand Down
9 changes: 8 additions & 1 deletion scripts/samples/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@
# 2. sh -c "$(curl -fsSL https://get.docker.com)"

DOCKER=${DOCKER:-docker}
SIGMA_VOLUME=${SIGMA_VOLUME:-$PWD}

"$DOCKER" run --privileged --name sigma-dind -d \
-v "$PWD":/app \
-v "$SIGMA_VOLUME":/app \
-p 443:3000 \
-p 3306:3306 \
-p 6379:6379 \
-p 9000:9000 \
-p 9001:9001 \
docker:24-dind

if [ "$SIGMA_VOLUME" != "$PWD" ]; then
cp -rf sigma.tar.gz "$SIGMA_VOLUME"
cp -rf docker-compose.yml "$SIGMA_VOLUME"
cp -rf samples "$SIGMA_VOLUME"
fi

"$DOCKER" exec -it sigma-dind \
timeout 180 sh -c 'while ! docker info >/dev/null 2>&1; do echo "Waiting for docker daemon ready..."; sleep 3; done && \
cd /app && docker load -i sigma.tar.gz && \
Expand Down

0 comments on commit aa4b99f

Please sign in to comment.