forked from LaserWeb/LaserWeb4-Binaries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.osx.sh
executable file
·53 lines (39 loc) · 1.21 KB
/
build.osx.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
#
# build.sh
#
# Builds OSX distribution of LaserWeb
#
# Set target branch
export TARGET_UI_BRANCH=$(cat BRANCH)
export CURRENT_DIR=${PWD##*/}
export LW_DIR="Laserweb4"
echo "Targetting UI Branch: $TARGET_UI_BRANCH"
yarn
# Commence
cd ../
# Download LaserWeb UI / install modules
if [ -d $LW_DIR ]; then
rm -rf $LW_DIR
fi
git clone https://github.com/Laserweb/LaserWeb4.git $LW_DIR
cd $LW_DIR
git checkout $TARGET_UI_BRANCH
yarn
npm run installdev
export UI_VERSION=$(git describe --abbrev=0 --tags)
export SERVER_VERSION=$(cat ./node_modules/lw.comm-server/version.txt | cut -c 3-6)
# Bundle LaserWeb app using webpack
npm run bundle-dev
cd ../$CURRENT_DIR
git tag -f $UI_VERSION-$SERVER_VERSION
# Overwrite app with latest version
ls -la
rm -rf ./node_modules/lw.comm-server/app/
cp -Rf ../$LW_DIR/dist ./node_modules/lw.comm-server/app/
echo $UI_VERSION-$SERVER_VERSION>./node_modules/lw.comm-server/app/VERSION
echo "BUILDING Laserweb $UI_VERSION-$SERVER_VERSION"
# Copy web front-end + build server component
./node_modules/.bin/electron-rebuild
./node_modules/.bin/build --em.version=$UI_VERSION-$SERVER_VERSION -p never
#./node_modules/.bin/build --linux --em.version=$UI_VERSION-$SERVER_VERSION -p never