From: dsc Date: Tue, 8 May 2012 21:37:53 +0000 (-0700) Subject: checkpoint X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=3dda5bee86a38a94c2bcd1f7e0c6d653198e2526;p=limn-bak.git checkpoint --- diff --git a/fabfile.py b/fabfile.py index eae72de..710f5d7 100644 --- a/fabfile.py +++ b/fabfile.py @@ -1,13 +1,52 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + from fabric.api import * +from fabric.colors import white, blue, cyan, green, yellow, red, magenta env.project_name = 'kraken-ui' - env.roledefs = { 'test': ['less.ly'], 'production': ['reportcard2.pmtpa.wmflabs'], } +@task +def update_version(): + """ Updates `lib/version.js`. + """ + local('coke update_version') + +@task +def collapse_trees(): + """ + # Ensure gitrev is up to date + coke update_version + + # Ensure clean dist directory + [ -e "tmp/dist" ] && rm -rf tmp/dist + mkdir -p tmp/dist + + ### Collapse the serve trees into one directory + log "Collapsing serve trees..." + + # Copy the static files, derived files, and the whole data directory (bc lack of trailing /) + # into dist. Note that you will need to load all the site pages in your browser to populate var + # with the derived files. + rsync -Ca static/ var/ data tmp/dist/ + + # We copy lib (which contains .co source files) to src to make it easy to link source content + # to each other. Finding it in gitweb is a pain. Finding it in gerrit is almost impossible. + # But this could go away when we move to github. + rsync -Ca lib/ tmp/dist/src/ + + # For some reason, the shell tool does not generate a file identical to the middleware. So whatever. + # We curl here because we know that version works. + curl --silent --fail --url http://$DEV_HOST/vendor/browserify.js > tmp/dist/vendor/browserify.js + # browserify -o tmp/dist/vendor/browserify.js -r events -r seq + """ + update_version() + @task def bundle(): @@ -37,4 +76,5 @@ def restart_server(): @task def deploy(): """Full deployment of latest project""" - pass \ No newline at end of file + pass +