From 3a91aacbbf9e6c9d173ff1432c93fd727b19a423 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Mon, 6 Jun 2016 19:44:12 +0200 Subject: [PATCH] Use Amazon SES on travis --- .elasticbeanstalk/config.yml | 12 ++++++++++++ .travis.yml | 2 +- res/aws_release.sh | 34 ++++++++++++++++++++++++++++++++++ test/integration/email-test.js | 4 +--- 4 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 .elasticbeanstalk/config.yml create mode 100755 res/aws_release.sh diff --git a/.elasticbeanstalk/config.yml b/.elasticbeanstalk/config.yml new file mode 100644 index 0000000..6ac17fc --- /dev/null +++ b/.elasticbeanstalk/config.yml @@ -0,0 +1,12 @@ +branch-defaults: + release/prod: + environment: keyserver-prod + release/test: + environment: keyserver-test +global: + application_name: keyserver + default_ec2_keyname: null + default_platform: Node.js + default_region: eu-west-1 + profile: eb-cli + sc: git diff --git a/.travis.yml b/.travis.yml index dcd0a8b..6a1fc7b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,4 +14,4 @@ notifications: services: - mongodb env: - - MONGO_URI=127.0.0.1:27017/test_db MONGO_USER=travis MONGO_PASS=test SMTP_HOST=127.0.0.1 SMTP_PORT=465 SMTP_TLS=true SMTP_STARTTLS=true SMTP_PGP=true SMTP_USER=smtp_user SMTP_PASS=smtp_pass SENDER_NAME=Travis SENDER_EMAIL=travis@mailvelope.com \ No newline at end of file + - MONGO_URI=127.0.0.1:27017/test_db MONGO_USER=travis MONGO_PASS=test \ No newline at end of file diff --git a/res/aws_release.sh b/res/aws_release.sh new file mode 100755 index 0000000..d218443 --- /dev/null +++ b/res/aws_release.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +# go to root +cd `dirname $0` +cd .. + +if [ "$1" != "prod" ] && [ "$1" != "test" ] ; then + echo 'Usage: ./res/aws_release prod|test' + exit 0 +fi + +# switch branch +git checkout master +git branch -D release/$1 +git checkout -b release/$1 +git merge master --no-edit + +# install only production dependencies +rm -rf node_modules/ +npm install --production + +# delete .gitignore files before adding to git for aws deployment +find node_modules/ -name ".gitignore" -exec rm -rf {} \; + +# Add runtime dependencies to git +sed -i "" '/node_modules/d' .gitignore +git add .gitignore node_modules/ +git commit -m "Update release" + +# push to aws +eb deploy keyserver-$1 + +# switch back to master branch +git checkout master \ No newline at end of file diff --git a/test/integration/email-test.js b/test/integration/email-test.js index 9650c2a..6abc976 100644 --- a/test/integration/email-test.js +++ b/test/integration/email-test.js @@ -21,9 +21,7 @@ describe('Email Integration Tests', function() { try { credentials = require('../../credentials.json'); } catch(e) { - log.warn('email-test', 'No credentials.json found ... skipping tests.'); - this.skip(); - return; + log.info('email-test', 'No credentials.json found ... using environment vars.'); } publicKeyArmored = require('fs').readFileSync(__dirname + '/../key1.asc', 'utf8'); origin = {