Initial commit
This contains the initial commit for the storyboard web client project, consisting of the basic build & testing harnesses, simple set of routes, and a list of basic dependencies necessary to run an application. It's purpose is to be reference Javascript/Angular project to test out the build images.
This commit is contained in:
71
bin/bootstrap.sh
Executable file
71
bin/bootstrap.sh
Executable file
@@ -0,0 +1,71 @@
|
||||
#!/bin/bash -xe
|
||||
|
||||
# This script bootstraps the current workspace with a locally compiled
|
||||
# node/grunt/bower javascript toolchain. This is done because recent NodeJS
|
||||
# releases (v0.10+) are not available for the images we use for builds
|
||||
# (CentOS, Ubuntu 12.04 precise), and because we only need node to generate our
|
||||
# static assets.
|
||||
#
|
||||
|
||||
node_version=0.10.24
|
||||
script_dir="$( cd "$( dirname "$0" )" && pwd )"
|
||||
workspace_path="$(dirname "$script_dir")"
|
||||
|
||||
node_archive_path=~/.cache/storyboard/node-v$node_version.tar.gz
|
||||
node_remote_path=http://nodejs.org/dist/v$node_version/node-v$node_version.tar.gz
|
||||
|
||||
# Sanity check cleanup.
|
||||
rm -fr $workspace_path/.local/
|
||||
rm -fr $workspace_path/.build/
|
||||
|
||||
# Create our working directories
|
||||
mkdir -p $workspace_path/.local/
|
||||
mkdir -p $workspace_path/.build/
|
||||
mkdir -p ~/.cache/storyboard
|
||||
|
||||
# Download the source if we don't have it already.
|
||||
if [ ! -f $node_archive_path ]; then
|
||||
echo "Downloading Node v$node_version..."
|
||||
cd ~/.cache/storyboard
|
||||
wget $node_remote_path -O $node_archive_path
|
||||
cd $workspace_path
|
||||
fi
|
||||
|
||||
# Compile into the workspace, so we keep things isolated.
|
||||
# Note that on build nodes without ccache this will take a while.
|
||||
|
||||
cd $workspace_path/.build/
|
||||
tar -xf $node_archive_path
|
||||
cd $workspace_path/.build/node-v$node_version
|
||||
|
||||
# Run config, exit & dump if it fails.
|
||||
echo 'Configuring...'
|
||||
CONFIG_OUTPUT=$(./configure --prefix=$workspace_path/.local/ 2>&1)
|
||||
if [ $? != 0 ]; then
|
||||
echo $CONFIG_OUTPUT
|
||||
cd $workspace_path
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run make
|
||||
echo 'Make...'
|
||||
MAKE_OUTPUT=$(make 2>&1)
|
||||
if [ $? != 0 ]; then
|
||||
echo $MAKE_OUTPUT
|
||||
cd $workspace_path
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run make install
|
||||
echo 'Make Install...'
|
||||
MAKE_INSTALL_OUTPUT=$(make install 2>&1)
|
||||
if [ $? != 0 ]; then
|
||||
echo $MAKE_INSTALL_OUTPUT
|
||||
cd $workspace_path
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Go back home...
|
||||
cd $workspace_path
|
||||
|
||||
exit 0
|
||||
38
bin/build.sh
Executable file
38
bin/build.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script executes the build.
|
||||
|
||||
VDISPLAY=99
|
||||
DIMENSIONS='1280x1024x24'
|
||||
XVFB=/usr/bin/Xvfb
|
||||
BIN_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||
WORKSPACE="$(dirname "$BIN_DIR")"
|
||||
|
||||
# Add our new bin directory to the PATH
|
||||
echo "Adding $WORKSPACE/.local/bin to PATH"
|
||||
export PATH=$WORKSPACE/.local/bin:$PATH
|
||||
echo "Adding $WORKSPACE/node_modules/.bin to PATH"
|
||||
export PATH=$WORKSPACE/node_modules/.bin:$PATH
|
||||
|
||||
cd $WORKSPACE;
|
||||
|
||||
echo "Installing build dependencies"
|
||||
npm prune
|
||||
npm install
|
||||
|
||||
echo "Installing compile dependencies"
|
||||
bower prune
|
||||
bower install
|
||||
|
||||
echo "Launching Virtual Frame Buffer"
|
||||
$XVFB :${VDISPLAY} -screen 0 ${DIMENSIONS} -ac +extension GLX +render -noreset 2>&1 > /dev/null &
|
||||
|
||||
echo "Building"
|
||||
set +e
|
||||
DISPLAY=:${VDISPLAY} grunt clean test
|
||||
result=$?
|
||||
|
||||
pkill Xvfb 2>&1 > /dev/null
|
||||
set -e
|
||||
|
||||
exit $result
|
||||
Reference in New Issue
Block a user