chore: add script to build a local version of a service

This commit is contained in:
Karol Sójko 2023-01-30 09:52:57 +01:00
parent b5c9c4b188
commit 8216fe5e36
No known key found for this signature in database
GPG key ID: D966F68E8A92F649

18
bundle.sh Executable file
View file

@ -0,0 +1,18 @@
#!/bin/bash
SERVICE=$1 && shift 1
if [ "$SERVICE" == "" ]; then
echo "Please input a service name as parameter"
exit 1
fi
echo "Bundling and building local docker image for service: $SERVICE"
rm -rf $TMPDIR/bundle-$SERVICE/
mkdir -p $TMPDIR/bundle-$SERVICE
yarn workspace @standardnotes/$SERVICE-server bundle --no-compress --output-directory $TMPDIR/bundle-$SERVICE
docker build $TMPDIR/bundle-$SERVICE -f $TMPDIR/bundle-$SERVICE/packages/$SERVICE/Dockerfile -t standardnotes/$SERVICE:local