I’m getting a lot of trouble trying to upload wars to Beanstalk using its console. Specially large wars (larger than 50MB).
So, I’ve build this simple script that upload your war to Beanstalk and generates one version for it.
You have to have a credentials.properties file in the same directory you’re running the script.
The default AWS ‘credentials.properties’ file as below
accessKey = AKIAAIEQF6SPAKSE5BN5 secretKey = J7fa9akja879FGA308JAHA749jha7va83akaf931
After that, just run the beanstalk.groovy with the usage shown below:
Usage: groovy beanstalkUpload.groovy <path_to_war> <application_name> <application_version_label>
Attention
The script uses Grape to resolve dependencies (thanks @berngp), so, the first time you run the script it will take a while to initialize (approx 5 minutes in my 15mb/s internet). So, be patient.
Further times, the script will run immediately.
Example
groovy beanstalkUpload.groovy ../sde-0.1.war sde 0.1-beta
Output will be thrown in your console, as this example:
[2011/02/18 14:10:08] [sde] Loading 'credentials.propeties' file [2011/02/18 14:10:08] [sde] Loaded AWS credentials [2011/02/18 14:10:08] [sde] Creating s3 bucket 'sde-d27c0fd0-8b57-44ff-8692-82233496e0a8' to hold application file [2011/02/18 14:16:59] [sde] Uploading to sde-d27c0fd0-8b57-44ff-8692-82233496e0a8/20110218141010-sde-0.1.war: [InProgress] - 48955392 of 48956935 (100%) [2011/02/18 14:17:00] [sde] Creating application version... [2011/02/18 14:17:03] [sde] Done! [2011/02/18 14:17:03] [sde] App: sde [2011/02/18 14:17:03] [sde] Version: 0.5 [2011/02/18 14:17:03] [sde] S3 Bucket: sde-d27c0fd0-8b57-44ff-8692-82233496e0a8 [2011/02/18 14:17:03] [sde] War file: 20110218141010-sde-0.1.war [2011/02/18 14:17:03] [sde] Version created at: 2011/02/18 14:17:02
(AWS SDK Logs are turned off, for esthetic purposes)
Feel free to fork the repo, do your changes and send me a pull request
Lucas Teixeira
@lucastex