Skip to content

Instantly share code, notes, and snippets.

@anthonycintron
Created May 18, 2012 14:05
Show Gist options
  • Save anthonycintron/2725442 to your computer and use it in GitHub Desktop.
Save anthonycintron/2725442 to your computer and use it in GitHub Desktop.
"""
Compresses InterviewIO Plug-in
"""
def minify_plugin():
plug_in_location = 'components/Recorder\ Plug-in/interview_plugin/'
plug_in_name = 'interviewio-1.0.1b.js'
minified_plugin_name = 'interviewio-1.0.1b-min.js'
local(JAVA_LOCATION + ' -jar ' + YUI_LOCATION + ' ' + plug_in_location + plug_in_name + ' -o ' + plug_in_location + minified_plugin_name + ' --nomunge')
print("We've minified %s" % minified_plugin_name)
upload_plugin( minified_plugin_name )
"""
Uploads any asset to an S3 Bucket
"""
def upload_assets(filename, local_path, s3_path='/'):
from boto.s3.connection import S3Connection
from boto.s3.key import Key
import os
bucket_name = 'interviewio-files'
_path = os.path.realpath(os.path.dirname(__file__))
project_path = os.sep.join(_path.split(os.sep)[:-1])
project_name = 'interviewio'
_file = project_path + '/' + project_name + '/' + local_path + '/' + filename
conn = S3Connection(AWS_ACCESS_KEY, AWS_SECRET_KEY)
bucket = conn.get_bucket(bucket_name)
k = Key(bucket)
k.key = s3_path + filename
k.set_contents_from_filename(_file, replace=True)
k.make_public()
print("Uploaded %s to %s" % (filename, k.key))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment