Skip to content

Commit

Permalink
feat: update kystrap script
Browse files Browse the repository at this point in the history
  • Loading branch information
shifty11 committed Dec 19, 2023
1 parent 8bd2d65 commit de005dd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"build": "lerna run build",
"build:binaries": "lerna run build:binaries --concurrency 1",
"generate:protos": "bash proto/proto-gen.sh",
"bootstrap:integration": "sh tools/kystrap/start.sh",
"pub": "lerna run build && lerna publish",
"build:changed": "lerna run --since origin/master --include-dependents build",
"test": "lerna run test",
Expand Down
22 changes: 19 additions & 3 deletions tools/kystrap/start.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
#!/bin/sh

# Set INTEGRATIONS_DIR
INTEGRATIONS_DIR="$(pwd)"/integrations
if [ ! -d "$INTEGRATIONS_DIR" ]; then
INTEGRATIONS_DIR="$(pwd)"/../../integrations
fi
if [ ! -d "$INTEGRATIONS_DIR" ]; then
echo "Could not find INTEGRATIONS_DIR folder"
exit 1
fi

# Set KYSTRAP_DIR
KYSTRAP_DIR="$(pwd)"/tools/kystrap
if [ ! -d "$KYSTRAP_DIR" ]; then
KYSTRAP_DIR="$(pwd)"/../kystrap
fi

# Build docker image
docker build --tag kystrap .
docker build --tag kystrap "$KYSTRAP_DIR" || exit 1

# Run docker image
docker run \
-it `# Interactive mode` \
--rm `# Remove container after run` \
--user "$(id -u):$(id -g)" `# Run as current user` \
-v $(pwd)/../../integrations:/app/out `# Mount integrations folder` \
kystrap $(echo "$@") # Pass all arguments to kystrap
-v "$INTEGRATIONS_DIR":/app/out `# Mount integrations folder` \
kystrap $(echo "$@") # Pass all arguments to kystrap

0 comments on commit de005dd

Please sign in to comment.