UNPKG

1.19 kBapplication/x-shView Raw
1#!/bin/bash -ex
2# Note: -ex option above will terminate on first error, and echo each command
3
4# This build file is executed by Sagoku Static Web App deployment
5# when you configure your Sagoku Static Web App build script path to point here
6# The container that executes this script will copy the result to S3 bucket sequoia-static
7
8SRC_DIR=$1 # root folder of the workspace, /opt/git/workspace
9BUILD_DIR=$2 # /mnt/deb-builds/${PACKAGE_NAME}-${VERSION}
10PACKAGE_NAME=$3 # appName
11VERSION=$4 # autogenerated timestamp
12env
13echo "Setting up Package $PACKAGE_NAME Version ${VERSION}"
14echo "Building ${PACKAGE_NAME} in ${BUILD_DIR}"
15
16# Set up node and npm install libraries.
17wget https://nodejs.org/dist/v6.9.2/node-v6.9.2-linux-x64.tar.xz
18xz -dc node-v6.9.2-linux-x64.tar.xz | tar xf - -C /usr/local/
19export PATH=$PATH:/usr/local/node-v6.9.2-linux-x64/bin
20# This is where the node package file is
21cd ${SRC_DIR}
22mkdir -p ${SRC_DIR}/build
23npm install
24NODE_ENV=production npm run build
25
26cp -r ${SRC_DIR}/documentation/assets ${SRC_DIR}/documentation/styleguide/assets
27
28rsync -va ${SRC_DIR}/documentation/ ${BUILD_DIR}
29ls -al ${SRC_DIR}/documentation/
30ls -al ${BUILD_DIR}
31echo "Build script complete"