Update build & deploy settings for CircleCI
This commit is contained in:
+11
-7
@@ -38,6 +38,12 @@ module.exports = (grunt)->
|
||||
prod:
|
||||
files: './dist/js/main.js': ['./src/coffee/main.coffee']
|
||||
|
||||
coffee:
|
||||
dev:
|
||||
options:
|
||||
sourceMap: true
|
||||
files: [expand:true, cwd:'./src/coffee', src:'**/*.coffee', dest:'./dist']
|
||||
|
||||
clean:
|
||||
dist: ['./dist']
|
||||
|
||||
@@ -134,16 +140,14 @@ module.exports = (grunt)->
|
||||
|
||||
grunt.registerTask 'default', 'build'
|
||||
|
||||
grunt.registerTask 'build', [
|
||||
'rsync', 'sass:build', 'jade', 'copy', 'browserify:dev', 'exorcise'
|
||||
]
|
||||
|
||||
grunt.registerTask 'dist', [
|
||||
'clean', 'rsync', 'sass:dist', 'jade', 'copy', 'browserify:prod', 'uglify', 'test'
|
||||
]
|
||||
grunt.registerTask 'build', ['rsync', 'sass:build', 'jade', 'copy', 'browserify:dev', 'exorcise']
|
||||
|
||||
grunt.registerTask 'clean-watch', ['clean', 'build', 'watch']
|
||||
|
||||
grunt.registerTask 'dist', ['rsync', 'sass:dist', 'jade', 'copy', 'browserify:prod', 'uglify']
|
||||
|
||||
grunt.registerTask 'prepublish', ['clean', 'coffee']
|
||||
|
||||
grunt.registerTask 'use-local-deps', ->
|
||||
grunt.file.mkdir './node_modules'
|
||||
grunt.file.delete './node_modules/crafting-guide-common', force:true
|
||||
|
||||
+2
-1
@@ -4,7 +4,7 @@
|
||||
"description": "Source code for http://crafting-guide.com",
|
||||
"main": "./build/index.js",
|
||||
"scripts": {
|
||||
"prepublish": "grunt build",
|
||||
"prepublish": "grunt prepublish",
|
||||
"test": "grunt test"
|
||||
},
|
||||
"repository": {
|
||||
@@ -24,6 +24,7 @@
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-browserify": "^3.2.1",
|
||||
"grunt-contrib-clean": "^0.6.0",
|
||||
"grunt-contrib-coffee": "^0.13.0",
|
||||
"grunt-contrib-copy": "^0.7.0",
|
||||
"grunt-contrib-jade": "^0.13.0",
|
||||
"grunt-contrib-sass": "^0.8.1",
|
||||
|
||||
@@ -35,6 +35,11 @@ if [[ ! -e "$S3CMD_CFG" ]]; then
|
||||
cat $AWS_CONFIG_FILE | grep "aws_secret_access_key" | sed "s/aws_secret_access_key/secret_key/" >> "$S3CMD_CFG"
|
||||
fi
|
||||
|
||||
if grunt clean dist; then
|
||||
echo "Preparing to upload to S3..."
|
||||
s3cmd sync -r --add-header="cache-control:max-age=1800" $SOURCE_DIR $TARGET_DIR
|
||||
echo "S3 Upload Complete"
|
||||
else
|
||||
echo "ERROR: Building distribution failed. Aborting deployment!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user