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