Faster deploys
This commit is contained in:
parent
45ab5b4dc5
commit
4da2ec2fef
|
@ -1,17 +1,38 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Set the tmpdir
|
||||||
|
if [ -z "$TMPDIR" ]; then
|
||||||
|
TMPDIR="/tmp"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create a temporary build dir and make sure we clean it up. For
|
||||||
|
# debugging, comment out the trap line.
|
||||||
|
DEPLOY=`mktemp -d /tmp/vagrant-docs-XXXXXX`
|
||||||
|
trap "rm -rf $DEPLOY" INT TERM EXIT
|
||||||
|
|
||||||
# Get the parent directory of where this script is.
|
# Get the parent directory of where this script is.
|
||||||
SOURCE="${BASH_SOURCE[0]}"
|
SOURCE="${BASH_SOURCE[0]}"
|
||||||
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
|
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
|
||||||
DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
|
DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
|
||||||
|
|
||||||
|
# Copy into tmpdir
|
||||||
|
cp -R $DIR/website/docs/ $DEPLOY/
|
||||||
|
|
||||||
# Change into that directory
|
# Change into that directory
|
||||||
cd $DIR
|
cd $DEPLOY
|
||||||
|
|
||||||
# Add the git remote if it doesn't exist
|
# Ignore some stuff
|
||||||
git remote | grep heroku-docs || {
|
touch .gitignore
|
||||||
git remote add heroku-docs git@heroku.com:vagrantup-docs-2.git
|
echo ".sass-cache" >> .gitignore
|
||||||
}
|
echo "build" >> .gitignore
|
||||||
|
|
||||||
# Push the subtree (force)
|
# Add everything
|
||||||
git push heroku-docs `git subtree split --prefix website/docs master`:master --force
|
git init .
|
||||||
|
git add .
|
||||||
|
git commit -q -m "Deploy by $USER"
|
||||||
|
|
||||||
|
git remote add heroku git@heroku.com:vagrantup-docs-2.git
|
||||||
|
git push -f heroku master
|
||||||
|
|
||||||
|
# Cleanup the deploy
|
||||||
|
rm -rf $DEPLOY
|
||||||
|
|
|
@ -1,17 +1,38 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Set the tmpdir
|
||||||
|
if [ -z "$TMPDIR" ]; then
|
||||||
|
TMPDIR="/tmp"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create a temporary build dir and make sure we clean it up. For
|
||||||
|
# debugging, comment out the trap line.
|
||||||
|
DEPLOY=`mktemp -d /tmp/vagrant-www-XXXXXX`
|
||||||
|
trap "rm -rf $DEPLOY" INT TERM EXIT
|
||||||
|
|
||||||
# Get the parent directory of where this script is.
|
# Get the parent directory of where this script is.
|
||||||
SOURCE="${BASH_SOURCE[0]}"
|
SOURCE="${BASH_SOURCE[0]}"
|
||||||
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
|
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
|
||||||
DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
|
DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
|
||||||
|
|
||||||
|
# Copy into tmpdir
|
||||||
|
cp -R $DIR/website/www/ $DEPLOY/
|
||||||
|
|
||||||
# Change into that directory
|
# Change into that directory
|
||||||
cd $DIR
|
cd $DEPLOY
|
||||||
|
|
||||||
# Add the git remote if it doesn't exist
|
# Ignore some stuff
|
||||||
git remote | grep heroku-www || {
|
touch .gitignore
|
||||||
git remote add heroku-www git@heroku.com:vagrantup-www-2.git
|
echo ".sass-cache" >> .gitignore
|
||||||
}
|
echo "build" >> .gitignore
|
||||||
|
|
||||||
# Push the subtree (force)
|
# Add everything
|
||||||
git push heroku-www `git subtree split --prefix website/www master`:master --force
|
git init .
|
||||||
|
git add .
|
||||||
|
git commit -q -m "Deploy by $USER"
|
||||||
|
|
||||||
|
git remote add heroku git@heroku.com:vagrantup-www-2.git
|
||||||
|
git push -f heroku master
|
||||||
|
|
||||||
|
# Cleanup the deploy
|
||||||
|
rm -rf $DEPLOY
|
||||||
|
|
Loading…
Reference in New Issue