Last active
August 29, 2015 14:19
-
-
Save martinhbramwell/1e95dab33a03174f8cef to your computer and use it in GitHub Desktop.
Meteoris server-side deployment scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I use these shell scripts on my server to control Meteor project deployment by means of SSH/RPC calls. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
export dir=$(dirname "$0") | |
echo "Stepping into meteor directory :: ${dir}" | |
pushd ${dir} | |
export proj=$(cat .CURRPROJ) | |
export serv_dir=${proj}/bundle/programs/server | |
echo "Reinstalling 'fibers' in project server directory :: ${serv_dir}" | |
pushd ${serv_dir} | |
npm install fibers 2> /dev/null | |
npm install underscore 2> /dev/null | |
npm install source-map-support 2> /dev/null | |
npm install semver 2> /dev/null | |
popd | |
popd | |
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
INCOMING=/home/yourself/incoming | |
PROJ=$1 | |
APPLICATION_NAME=$2 | |
echo "Builing the application '${APPLICATION_NAME}' from project file ${PROJ}.tar.gz." | |
# | |
FULL=${INCOMING}/${PROJ}.tar.gz | |
if [ ! -e "${FULL}" ] | |
then | |
echo "${FULL} DOES NOT EXIST." | |
exit | |
fi | |
# | |
# | |
APK=${INCOMING}/${APPLICATION_NAME}.apk | |
if [ ! -e "${APK}" ] | |
then | |
echo "${APK} DOES NOT EXIST." | |
exit | |
fi | |
# | |
export FULLFILE=$(ls ${FULL}) | |
echo "Full file is :: ${FULLFILE}" | |
# | |
export PARTFILE="${FULLFILE##*/}" | |
export FILENAME="${PARTFILE%%.*}" | |
export WORKPATH=/home/meteor | |
echo "Work path is :: ${WORKPATH}/${FILENAME}" | |
# | |
cat > ${WORKPATH}/.CURRPROJ <<EOF | |
${FILENAME} | |
EOF | |
# | |
echo | |
echo "Current project is ... " | |
cat ${WORKPATH}/.CURRPROJ | |
# | |
echo | |
echo "Make directory :: ${WORKPATH}/${FILENAME}" | |
mkdir -p ${WORKPATH}/${FILENAME} | |
# | |
echo | |
echo "Extracting tar -- tar zxf ${FULLFILE} -C ${WORKPATH}/${FILENAME}" | |
tar zxf ${FULLFILE} -C ${WORKPATH}/${FILENAME} | |
# | |
pushd ${WORKPATH}/${FILENAME}/bundle | |
touch ../settings.json | |
chmod ug+w ../settings.json | |
# | |
mv ./programs/web.browser/app/settings.json .. | |
pushd ./programs | |
# echo "Files in ${WORKPATH}/${FILENAME}/bundle/programs/web.browser/app are ..." | |
# ls -la ./web.browser/app | |
# | |
echo | |
export DNLDS="web.browser/app/dnld" | |
echo "Stepping into $(pwd)/${DNLDS}" | |
chmod ugo+w -R ./${DNLDS} | |
pushd ./${DNLDS} | |
ls -l ${APK} | |
ls -l $(pwd) | |
echo "Copying ${APK} to $(pwd)" | |
cp ${APK} . | |
popd | |
popd | |
# | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
echo "Trying to stop..." | |
stop meteor 2>/dev/null | |
echo "Trying to start..." | |
start meteor | |
echo "Exiting." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment