Hristo
Hristo

Reputation: 46517

hooking into Google App Engine's deploy

The Google App Engine Launcher has a nice little "Deploy" button that will push my changes to prod. However, I'd like to be able to minify/obfuscate my JavaScript before deploying.

I've read about several tools that can do this: Google Closure Compiler, Uglify.js, YUI Compressor. Of course, I could do this manually before deploying, but I'd much rather be able to have this run automatically.

Is there a way to hook into App Engine's deploy process, and run a minification/obfuscation task on my JavaScript? If not, any suggestions on other approaches?

Upvotes: 0

Views: 385

Answers (2)

Lipis
Lipis

Reputation: 21835

As already mentioned minifying and obfuscating the code depends on the specific setup of your app and has to be done before deploying on App Engine.

That was one of the main reasons that I started the gae-init project. Among other things it has a custom script that combines and minifies all the static files (JS/CSS) before deploying, while when running locally keeping them as they are.

Upvotes: 2

Mihail Russu
Mihail Russu

Reputation: 2536

Not sure if there's a way to hook to "App Engine Launcher" but all it does is run a appcfg.py update myapp/ command where myapp/ is your app directory. You could simply create your own shell/batch file where you first minify the files and then deploy them by running the command above.

Also, take a look at Google's Pagespeed service that comes with paid App Engine projects where css/js/etc is minified automatically on Google's servers.

Upvotes: 1

Related Questions