forked from Rottschaferanders/LaserWeb4-Binaries
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.osx.sh
executable file
·65 lines (47 loc) · 1.49 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
54
55
56
57
58
59
60
61
62
63
64
65
#!/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
npm install
npm update ew.comm-server
# Commence
cd ../
# Download LaserWeb UI / install modules
if [ -d $LW_DIR ]; then
rm -rf $LW_DIR
fi
git clone https://github.com/Rack-Robotics/EDMWeb.git $LW_DIR
cd $LW_DIR
git checkout $TARGET_UI_BRANCH
# nvm install v10.16.3
# nvm install 12
# yarn
npm run installdev
# export UI_VERSION=$(git describe --abbrev=0 --tags)
export UI_VERSION="1.0.0"
# export SERVER_VERSION=$(cat ./node_modules/ew.comm-server/version.txt | cut -c 3-6)
export SERVER_VERSION=$(cat ./node_modules/ew.comm-server/version.txt)
# Bundle LaserWeb app using webpack
npm run bundle-dev
cd ../$CURRENT_DIR
git tag -f $UI_VERSION-$SERVER_VERSION
# Overwrite app with latest version
rm -rf ./node_modules/ew.comm-server/app/
cp -Rf ../$LW_DIR/dist ./node_modules/ew.comm-server/app/
echo $UI_VERSION-$SERVER_VERSION>./node_modules/ew.comm-server/app/VERSION
echo "BUILDING Laserweb $UI_VERSION-$SERVER_VERSION"
yarn run make
# Copy web front-end + build server component
# These are not needed because we are now using electron-forge
# ./node_modules/.bin/electron-rebuild
# ./node_modules/.bin/asar
# ./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