blob: 6c5780067dce17faced20497302a6abe073f9ef3 [file] [log] [blame]
Jeremy Mordkoff03156e32017-09-30 21:42:44 -04001#!/bin/bash
2
3#
4# Copyright 2017 RIFT.IO Inc
5#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18
19abort()
20{
21 echo >&2 '
22***************
23*** ABORTED ***
24***************
25'
26 echo "An error occurred. Exiting..." >&2
27 exit 1
28}
29
30trap 'abort' 0
31
32set -e
33
34# Add your script below....
35# If an error occurs, the abort() function will be called.
36#----------------------------------------------------------
37CMAKE_BUILD=true
38
39# change to the directory of this script
40cd $PLUGIN_DIR
41cd ..
42
43echo 'Building plugin '$PLUGIN_NAME
44echo 'Fetching third-party node_modules for '$PLUGIN_NAME
45npm install
46echo 'Fetching third-party node_modules for '$PLUGIN_NAME'...done'
47echo 'Packaging '$PLUGIN_NAME' using webpack'
48ui_plugin_cmake_build=$CMAKE_BUILD ./node_modules/.bin/webpack --optimize-minimize --progress --config webpack.production.config.js --bail
49echo 'Packaging '$PLUGIN_NAME' using webpack... done'
50echo 'Packaging debug version of '$PLUGIN_NAME' using webpack'
51ui_plugin_cmake_build=$CMAKE_BUILD ./node_modules/.bin/webpack --progress --config webpack.production.config.js --production-debug --bail
52echo 'Packaging '$PLUGIN_NAME' using webpack... done'
53echo 'Building plugin '$PLUGIN_NAME'... done'
54# Done!
55trap : 0
56
57echo >&2 '
58************
59*** DONE ***
60************
61'