Skip to content

Commit b184dda

Browse files
committed
build locally, including NPM. local host must be the same architecture as remote host.
1 parent fa92b1c commit b184dda

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

build.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ export CUR_DEPLOY=$(git rev-parse --verify HEAD)
44
mkdir -p $HOME/.bundles
55
export DEPLOY_DIR=$HOME/.bundles/$APP-$CUR_DEPLOY
66
export BUILD_OUTPUT_FILE=$HOME/.meteor_build_output.txt
7-
[ -f $DEPLOY_DIR.tar.gz ] ||\
7+
if ! [ -f "$DEPLOY_DIR.tar.gz" ]; then
88
meteor build --directory $DEPLOY_DIR > $BUILD_OUTPUT_FILE &&\
9+
cd $DEPLOY_DIR/bundle/programs/server &&\
10+
npm install fibers > $BUILD_OUTPUT_FILE &&\
11+
npm install > $BUILD_OUTPUT_FILE &&\
912
tar -czf $DEPLOY_DIR.tar.gz -C $DEPLOY_DIR bundle &&\
1013
rm -rf $DEPLOY_DIR
14+
fi
1115
echo $CUR_DEPLOY

deploy.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
2-
# Make sure the remote folder is ready.
3-
# {} weren't were being escaped so I made this straight forward.
4-
ssh $USER@$REMOTE "mkdir -p ~/bundles && mkdir -p ~/bundles/$DEPLOY"
52
# Send zipped file over.
6-
rsync $HOME/.bundles/$APP-$DEPLOY.tar.gz $REMOTE:~/bundles/$DEPLOY.tar.gz
3+
rsync $HOME/.bundles/$APP-$DEPLOY.tar.gz $REMOTE_USER@$REMOTE:~/bundles/$APP-$DEPLOY.tar.gz
74
# Unzip and build the bundle.
8-
ssh $USER@$REMOTE "tar -xzf ~/bundles/$DEPLOY.tar.gz -C ~/bundles/$DEPLOY && rm -f ~/bundle && ln -s ~/bundles/$DEPLOY/bundle ~ && cd ~/bundle/programs/server && npm install fibers && npm install"
5+
ssh $REMOTE_USER@$REMOTE "\
6+
rm -rf /var/opt/node/$APP &&\
7+
mkdir -p /var/opt/node/$APP &&\
8+
tar -xzf ~/bundles/$APP-$DEPLOY.tar.gz -C /var/opt/node/$APP"

0 commit comments

Comments
 (0)