What’s with the guid/uuid directory created by sc-build?

When I run sc-build, the output is placed in ./tmp/build/static/app_name/en/b82a3bf91217954903a4fd7da14707caa9f47520.

This page in the Sproutcore wiki suggests that the guid/uuid directory is the build number.

Deploying

  • When you are ready to deploy your app, all you need to do is run sc-build.
  • sc-build generates a bundle of HTML, JS, and CSS inside a directory with a MD5 hash code as a build number.
  • The hash code is based on the contents of the files, so changing your files will change the hash code.
  • When you deploy your app, you just need to copy the entire contents of the tmp/build directory to a static web server.
  • Your web server should be configured to serve everything EXCEPT for the index.html file with a 1-year expiration header. This will allow your assets to be cached “permanently” on browsers once they load them.
  • Since the index.html file references the resources it needs by build number, deploying a new version of your app will automatically load the new assets.
  • Once you’ve copied your files out, you should symlink the build directory for the app you want to load to the actual URL you want the user to visit to load your app.
  • Example: if you want ppl to visit your app at http://myapp.com/appname and your built project has a directory called static/appname/123efab45aeb29c3de4, then you should symlink /appname -> /static/appname/123efab45aeb29c3de4.
  • You can actually have multiple built versions of your app deployed this way since each one will have a different build number. Just create a different symlink to each version you want to load.

So, if you specify a build number when using sc-build, the guid/uuid will be replaced with a nice looking build number.

For example, sc-build –build=0001 -rcv –languages=en will create the directory structure:

./tmp/build/static/app_name/en/0001.

Leave a comment

0 Comments.

Leave a Reply


[ Ctrl + Enter ]