Skip to content

Commit

Permalink
Initial import from old busted repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Martin committed Nov 18, 2011
0 parents commit d69c2d1
Show file tree
Hide file tree
Showing 108 changed files with 26,401 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
*~
/dev_bundle
/dev_bundle*.tar.gz
661 changes: 661 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Skybreak

Skybreak is an ultra-simple framework for building modern websites and web applications. What once took weeks, now takes hours in Skybreak.

With Skybreak you write apps:

* in pure Javascript
* that send data over the wire, rather than HTML
* using your choice of popular open-source libraries

**Have a look at the main Skybreak documentation here:**

http://preview.skybreakplatform.com

**This is still pre-release software. If you use it please, PLEASE sign up on the website above. Especially if you deploy a web site with ```skybreak deploy```**

## Quick Start (normal install process)

Install Skybreak (only OS X, for now):

curl -sL bit.ly/n122Iu | /bin/sh

Create a project:

skybreak create try-skybreak

Run it:

cd try-skybreak
skybreak

Deploy it to the world, for free:

skybreak deploy try-skybreak.skybreakplatform.com


## Slow Start (for developers)

If you want to run on the bleeding edge, or help develop Skybreak, you can run Skybreak directly from a git checkout.

git clone [email protected]:honeycomb/skybreak.git
cd skybreak

If you're the sort of person who likes to build everything from scratch, you can build all the Skybreak dependencies (node.js, npm, mongodb, etc) with the provided script. If you do not run this script, Skybreak will automatically download pre-compiled binaries when you first run it.

./admin/generate-dev-bundle.sh # OPTIONAL

Now you can run skybreak directly from the checkout (if you did not build the dev bundle above, this will take a few moments to download dependencies).

./skybreak --help

Or install to ```/usr/local``` like the normal install process. This will cause ```skybreak``` to be in your ```PATH```.

./install.sh
skybreak --help



## Developer Resources

- XXX google group
- XXX irc channel


96 changes: 96 additions & 0 deletions admin/cut-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#!/bin/bash

set -e

# cd to top level dir
cd `dirname $0`
cd ..

# Check for MacOS
if [ `uname` != "Darwin" ] ; then
echo "Skybreak only support MacOS X right now."
exit 1
fi

# make sure we're clean
# http://stackoverflow.com/questions/2657935/checking-for-a-dirty-index-or-untracked-files-with-git
function warn_and_exit { echo $1 ; return 1; }
git diff-files --quiet || \
warn_and_exit "Local changes. Aborting."
git diff-index --quiet --cached HEAD || \
warn_and_exit "Local changes staged. Aborting."
test -z "$(git ls-files --others --exclude-standard)" || \
warn_and_exit "Uncommitted files. Aborting."

# Make sure we have an up to date dev bundle by re-downloading.
for i in dev_bundle_*.tar.gz ; do
test -f $i && warn_and_exit "Local dev_bundle tarball. Aborting."
done
if [ -d dev_bundle ] ; then
echo "Removing old dev_bundle."
rm -rf dev_bundle
fi

# Force dev_bundle re-creation
./skybreak --version || \
warn_and_exit "dev_bundle installation failed."


# increment the version number
export NODE_PATH="$(pwd)/dev_bundle/lib/node_modules"
./dev_bundle/bin/node admin/increment-version.js

echo "Installing."

# install it.
./install.sh

# get the version number.
VERSION="$(/usr/local/bin/skybreak --version | sed 's/.* //')"

# tar it up
TARBALL=~/skybreak-package-${VERSION}.tar.gz
echo "Tarring to: $TARBALL"

tar -C /usr/local --exclude .skybreak/local -czf "$TARBALL" skybreak

# commit to git
echo
echo "//////////////////////"
echo "//////////////////////"
git diff

echo
echo "//////////////////////"
echo "// Commit to git? Press enter to continue. Hit C-c to abort."
read anykey

git commit -a -m "Bump to version $VERSION"
git push origin master


echo
echo "//////////////////////"

# prompt are you sure
echo "// Result tarball:"
ls -l "$TARBALL"
md5 "$TARBALL"

cat <<EOF
/////////////////////
/////////////////////
// Push release $VERSION ? Press enter to continue. Hit C-c to abort.
/////////////////////
EOF
read

s3cmd -P put "$TARBALL" s3://com.skybreakplatform.static
s3cmd -P put ./admin/install-s3.sh s3://com.skybreakplatform.static/update/
s3cmd -P put ./admin/manifest.json s3://com.skybreakplatform.static/update/

echo
echo "//////////////////////"
echo "// Pushed and live!"
144 changes: 144 additions & 0 deletions admin/generate-dev-bundle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
#!/bin/bash

set -e

BUNDLE_VERSION=0.0.4
UNAME=$(uname)

if [ "$UNAME" == "Linux" ] ; then
MONGO_NAME="mongodb-linux-x86_64-2.0.1"
MONGO_URL="http://fastdl.mongodb.org/linux/${MONGO_NAME}.tgz"
elif [ "$UNAME" == "Darwin" ] ; then
MONGO_NAME="mongodb-osx-x86_64-2.0.1"
MONGO_URL="http://fastdl.mongodb.org/osx/${MONGO_NAME}.tgz"
else
echo "This OS not yet supported"
exit 1
fi


# save off skybreak checkout dir as final target
cd `dirname $0`/..
TARGET_DIR=`pwd`

DIR=`mktemp -d -t generate-dev-bundle-XXXXXXXX`
trap 'rm -rf "$DIR" >/dev/null 2>&1' 0

echo BUILDING IN "$DIR"

cd "$DIR"
mkdir build
cd build

git clone git://github.com/joyent/node.git
cd node
git checkout v0.6.1

# Disable obnoxious print. No easy way to disable that I found.
patch -p1 <<EOF
diff --git a/lib/sys.js b/lib/sys.js
index c37e2a7..d4e71bc 100644
--- a/lib/sys.js
+++ b/lib/sys.js
@@ -21,12 +21,13 @@
var util = require('util');
-var sysWarning;
-if (!sysWarning) {
- sysWarning = 'The "sys" module is now called "util". ' +
- 'It should have a similar interface.';
- util.error(sysWarning);
-}
+// XXX skybreak disabled
+// var sysWarning;
+// if (!sysWarning) {
+// sysWarning = 'The "sys" module is now called "util". ' +
+// 'It should have a similar interface.';
+// util.error(sysWarning);
+// }
exports.print = util.print;
exports.puts = util.puts;
EOF

export JOBS=4
./configure --prefix="$DIR"
make
make install

# export path so we use our new node for later builds
export PATH="$DIR/bin:$PATH"

which node

cd ..
git clone https://github.com/isaacs/npm
cd npm
git checkout v1.0.105
make
node cli.js install -g -f

which npm

cd "$DIR/lib/node_modules"
npm install [email protected]
npm install [email protected]
npm install [email protected]
npm install [email protected]
npm install [email protected]
npm install [email protected]
npm install [email protected]
npm install [email protected]
npm install [email protected]
npm install [email protected]
npm install [email protected]
npm install [email protected]
npm install [email protected]
npm install [email protected]
npm install [email protected]

# patched versions to allow node 0.6.
# This breaks websockets!
# see https://github.com/nodejitsu/node-http-proxy/pull/152
# and https://github.com/nodejitsu/node-http-proxy/tree/0.6-compatibility
npm install 'git+https://github.com/lukasberns/node-http-proxy.git#2688d308bc'


cd "$DIR"
curl "$MONGO_URL" | tar -xz
mv "$MONGO_NAME" mongodb

# don't ship a number of mongo binaries. they are big and unused. these
# could be deleted from git dev_bundle but not sure which we'll end up
# needing.
cd mongodb/bin
rm bsondump mongodump mongoexport mongofiles mongoimport mongorestore mongos mongosniff mongostat mongotop
cd ../..


patch -p2 <<EOF
diff --git a/dev_bundle/lib/node_modules/socket.io/lib/manager.js b/dev_bundle/lib/node_modules/socket.io/lib/manager.js
index ee2bf49..a68f9cb 100644
--- a/dev_bundle/lib/node_modules/socket.io/lib/manager.js
+++ b/dev_bundle/lib/node_modules/socket.io/lib/manager.js
@@ -114,7 +114,7 @@ function Manager (server, options) {
}
}
- this.log.info('socket.io started');
+ // this.log.info('socket.io started'); // XXX skybreak disabled
};
Manager.prototype.__proto__ = EventEmitter.prototype
EOF

echo BUNDLING

cd "$DIR"
echo "${BUNDLE_VERSION}" > .bundle_version.txt
rm -rf build

tar czf "${TARGET_DIR}/dev_bundle_${UNAME}_${BUNDLE_VERSION}.tar.gz" .

echo DONE
64 changes: 64 additions & 0 deletions admin/increment-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

var fs = require('fs');
var path = require('path');
var semver = require('semver');


var optimist = require('optimist')

var updater = require('../app/lib/updater.js');
var _ = require('../app/lib/third/underscore.js');


// What files to update. Relative to project root.
var UPDATE_FILES = ['app/lib/updater.js', 'admin/install-s3.sh',
['admin/manifest.json', 'g']];

// Files to update for dev_bundle
var BUNDLE_FILES = ['admin/generate-dev-bundle.sh', 'skybreak'];


var opt = require('optimist')
.alias('dev_bundle', 'd')
.boolean('dev_bundle')
.describe('dev_bundle', 'Update the dev_bundle version, not the main version.')
.alias('new_version', 'n')
.describe('new_version', 'A new version number. Default is to increment patch number.')
.usage('Usage: $0 [options]')
;
var argv = opt.argv;
if (argv.help) {
process.stdout.write(opt.help());
process.exit(1);
}

var CURRENT_VERSION = updater.CURRENT_VERSION;
var files = UPDATE_FILES;

if (argv.dev_bundle) {
var version_path = path.join(__dirname, '..', 'skybreak');
var version_data = fs.readFileSync(version_path, 'utf8');
var version_match = /BUNDLE_VERSION=([\d\.]+)/.exec(version_data);
CURRENT_VERSION = version_match[1];
files = BUNDLE_FILES;
}

var NEW_VERSION = argv.new_version || semver.inc(CURRENT_VERSION, 'patch');

console.log("Updating from " + CURRENT_VERSION + " to " + NEW_VERSION);

_.each(files, function (file) {
var flags = '';
if (file instanceof Array) {
flags = file[1];
file = file[0];
}
var fp = path.join(__dirname, '..', file);
var text = fs.readFileSync(fp, 'utf8');
var new_text = text.replace(new RegExp(CURRENT_VERSION, flags), NEW_VERSION);
fs.writeFileSync(fp, new_text, 'utf8');

console.log("updated file: " + fp);
});

console.log("Complete");
Loading

0 comments on commit d69c2d1

Please sign in to comment.