 		resourceToken: process.env['RESOURCE_TOKEN'] or 'http://vtex.io'
 		relativePath: ''
 		pkg: grunt.file.readJSON('package.json')
+		pacha: grunt.file.readJSON('tools/pachamama/pachamama.config')[0]
 		clean: ['build', 'deploy']
 		copy:
 			main:

	grunt.registerTask 'gen-version', ->
		env = this.args[0] or 'dev'
		console.log 'Deploying to environment:', env
		grunt.config 'meta.env', env
		grunt.task.run ['set-version', 'copy:env', 'string-replace:deploy']
	

				options:
					replacements: [
						pattern: /src="(\.\.\/)?(?!http|\/|\/\/)/ig
						replacement: 'src="<%= resourceToken %>/<%= pacha.infrastructure.s3.bucket %>/<%= meta.commit %>/'
					,
						pattern: /href="(\.\.\/)?(?!http|\/|\/\/)/ig
						replacement: 'href="<%= resourceToken %>/<%= pacha.infrastructure.s3.bucket %>/<%= meta.commit %>/'
					]

		connect:
