Skip to content

Instantly share code, notes, and snippets.

@DMeechan
Last active February 20, 2018 14:10
Show Gist options
  • Save DMeechan/a1f3fc24e9f965e8855d14d3cb35c36c to your computer and use it in GitHub Desktop.
Save DMeechan/a1f3fc24e9f965e8855d14d3cb35c36c to your computer and use it in GitHub Desktop.
IBM Cloud Meteor 1.6 Build Script
#!/bin/bash
# See guide here:
# https://gist.github.com/DMeechan/25469e18ea9fde342540752002a17d64
METEOR_HOME=.meteor/local
PATH=$METEOR_HOME/usr/bin:$METEOR_HOME/usr/lib/meteor/bin:$PATH
indent() {
c='s/^/ /'
case $(uname) in
Darwin) sed -l "$c";; # mac/bsd sed: -l buffers on line boundaries
*) sed -u "$c";; # unix/gnu sed: -u unbuffered (arbitrary) chunks of data
esac
}
status() {
echo "-----> $*"
}
install_meteor() {
status "Installing Meteor (ignore any warnings about launcher scripts)"
export PATH=/usr/bin:$PATH # necessary for install script to run from URL
curl https://install.meteor.com | sh
status "Updating PATH with Meteor"
PATH=$HOME/.meteor:$PATH
}
build() {
(
status "Building meteor bundle"
meteor npm install
meteor build $ARCHIVE_DIR --directory --server-only --architecture os.linux.x86_64
status "Installing dependencies"
cd $ARCHIVE_DIR/bundle/programs/server/
meteor npm install
cd ../../
chmod -R +w+x *
# status "Preparing for deployment"
mkdir $WORKSPACE/$ARCHIVE_DIR/bin
cp $WORKSPACE/bin/* $WORKSPACE/$ARCHIVE_DIR/bin/
status "Build complete"
)
}
install_meteor
build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment