From 568ccebcc1c506c98b2c2fdfdd108940c7fbd7da Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Fri, 31 Oct 2014 16:03:16 +0100 Subject: [PATCH] Migrate to EB v3.x CLI and Frankfurt region --- .elasticbeanstalk/config.yml | 12 ++++++++++++ .gitignore | 1 - Gruntfile.js | 8 ++++---- res/aws_release.sh | 22 ++++++++++++++-------- 4 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 .elasticbeanstalk/config.yml diff --git a/.elasticbeanstalk/config.yml b/.elasticbeanstalk/config.yml new file mode 100644 index 0000000..b19dc9e --- /dev/null +++ b/.elasticbeanstalk/config.yml @@ -0,0 +1,12 @@ +branch-defaults: + release/prod: + environment: mail-html5-prod + release/test: + environment: mail-html5-test +global: + application_name: mail-html5 + default_ec2_keyname: null + default_platform: Node.js + default_region: eu-central-1 + profile: eb-cli + sc: git diff --git a/.gitignore b/.gitignore index 0cfc0d2..07e93b1 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ src/css/ dist/ release/ test/integration/src/ -.elasticbeanstalk/ test/*/index.js **/*.browserified.js **/*.js.map diff --git a/Gruntfile.js b/Gruntfile.js index ff4360a..5aebe49 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -455,7 +455,7 @@ module.exports = function(grunt) { }); grunt.registerTask('manifest-test', function() { if (!version) { - throw new Error('You must specify the version: "--release=1.0"'); + throw new Error('You must specify the version: "--release=1.0.0"'); } patchManifest({ @@ -465,9 +465,9 @@ module.exports = function(grunt) { deleteKey: true }); }); - grunt.registerTask('manifest-stable', function() { + grunt.registerTask('manifest-prod', function() { if (!version) { - throw new Error('You must specify the version: "--release=1.0"'); + throw new Error('You must specify the version: "--release=1.0.0"'); } patchManifest({ @@ -509,7 +509,7 @@ module.exports = function(grunt) { grunt.registerTask('release-dev', ['dist', 'manifest-dev', 'compress']); grunt.registerTask('release-test', ['dist', 'manifest-test', 'clean:release', 'compress']); - grunt.registerTask('release-stable', ['dist', 'manifest-stable', 'clean:release', 'compress']); + grunt.registerTask('release-prod', ['dist', 'manifest-prod', 'clean:release', 'compress']); grunt.registerTask('default', ['release-dev']); }; \ No newline at end of file diff --git a/res/aws_release.sh b/res/aws_release.sh index 7c04569..0cef23a 100755 --- a/res/aws_release.sh +++ b/res/aws_release.sh @@ -4,16 +4,22 @@ cd `dirname $0` cd .. +if [ "$#" -ne 3 ] || [ "$1" != "prod" ] && [ "$1" != "test" ] ; then + echo 'Usage: ./res/aws_release prod|test from-branch 1.0.0' + exit 0 +fi + # switch branch -git checkout aws-dist -git merge master --no-edit +git checkout $2 +git branch release/$1 +git checkout release/$1 +git merge $2 --no-edit # build and test rm -rf node_modules/ npm cache clear npm install -grunt release-$1 --release=$2 -grunt test +grunt release-$1 --release=$3 # install only production dependencies rm -rf node_modules/ @@ -26,10 +32,10 @@ find node_modules/ -name ".gitignore" -exec rm -rf {} \; sed -i "" '/dist/d' .gitignore sed -i "" '/node_modules/d' .gitignore git add .gitignore node_modules/ dist/ -git commit -m "Update aws-dist" +git commit -m "Update release" # push to aws -git aws.push +eb deploy -# switch back to master branch -git checkout master \ No newline at end of file +# switch back to $2 branch +git checkout $2 \ No newline at end of file