diff --git a/resources/static/dialog/views/verify_primary_user.ejs b/resources/static/dialog/views/verify_primary_user.ejs index 105cb872e2b771bb171849ffd32f92a9723318f0..ea43a338118f5409606a1296c3e32299830d74dc 100644 --- a/resources/static/dialog/views/verify_primary_user.ejs +++ b/resources/static/dialog/views/verify_primary_user.ejs @@ -17,7 +17,6 @@ <li> <%= gettext("You must sign in with your email provider to verify ownership of this address. This window will be redirected to") %> - <p> <strong><%= auth_url %></strong>. </p> @@ -34,7 +33,6 @@ <div class="cf form_section"> <%= gettext("You must sign in with your email provider to verify ownership of this address. This window will be redirected to") %> - <p> <strong><%= auth_url %></strong>. </p> diff --git a/scripts/deploy.js b/scripts/deploy.js index b5df5f74d24527b72f3c70481ea3482ecedb9a32..d95993c80a6f8b03dd23246a73ec73a91c277b19 100755 --- a/scripts/deploy.js +++ b/scripts/deploy.js @@ -41,24 +41,30 @@ verbs['destroy'] = function(args) { var name = args[0]; validateName(name); - process.stdout.write("trying to destroy VM for " + name + ".hacksign.in: "); - vm.destroy(name, function(err) { + process.stdout.write("trying to destroy VM for " + name + ".hacksign.in: "); + vm.destroy(name, function(err, deets) { console.log(err ? ("failed: " + err) : "done"); - process.stdout.write("trying to remove DNS for " + name + ".hacksign.in: "); + process.stdout.write("trying to remove DNS for " + name + ".hacksign.in: "); dns.deleteRecord(name, function(err) { console.log(err ? "failed: " + err : "done"); + if (deets && deets.ipAddress) { + process.stdout.write("trying to remove git remote: "); + git.removeRemote(name, deets.ipAddress, function(err) { + console.log(err ? "failed: " + err : "done"); + }); + } }); }); } verbs['test'] = function() { // let's see if we can contact aws and zerigo - process.stdout.write("Checking DNS management access: "); + process.stdout.write("Checking DNS management access: "); dns.inUse("somerandomname", function(err) { console.log(err ? "NOT ok: " + err : "good"); - process.stdout.write("Checking AWS access: "); + process.stdout.write("Checking AWS access: "); vm.list(function(err) { - console.log(err ? "NOT ok: " + err : "good"); + console.log(err ? "NOT ok: " + err : "good"); }); }); } diff --git a/scripts/deploy/git.js b/scripts/deploy/git.js index 34b88c26be8b74f78d8b546da26ea7e99759de5b..8f0d9dceabf273b47e8e7f0cba889f3f65a81b45 100644 --- a/scripts/deploy/git.js +++ b/scripts/deploy/git.js @@ -5,3 +5,29 @@ exports.addRemote = function(name, host, cb) { var cmd = 'git remote add ' + name + ' app@'+ host + ':git'; child_process.exec(cmd, cb); }; + +// remove a remote, but only if it is pointed to a specific +// host. This will keep deploy from killing manuall remotes +// that you've set up +exports.removeRemote = function(name, host, cb) { + var desired = 'app@'+ host + ':git'; + var cmd = 'git remote -v show | grep push'; + child_process.exec(cmd, function(err, r) { + try { + var remotes = {}; + r.split('\n').forEach(function(line) { + if (!line.length) return; + var line = line.split('\t'); + if (!line.length == 2) return; + remotes[line[0]] = line[1].split(" ")[0]; + }); + if (remotes[name] && remotes[name] === desired) { + child_process.exec('git remote rm ' + name, cb); + } else { + throw "no such remote"; + } + } catch(e) { + cb(e); + } + }); +}; diff --git a/scripts/deploy/vm.js b/scripts/deploy/vm.js index f6efc45e6e606873fab39ed77dce584c8a3e65cd..ae94adfb4fe297a1ddd7f3984eefac2ed216126f 100644 --- a/scripts/deploy/vm.js +++ b/scripts/deploy/vm.js @@ -4,7 +4,7 @@ jsel = require('JSONSelect'), key = require('./key.js'), sec = require('./sec.js'); -const BROWSERID_TEMPLATE_IMAGE_ID = 'ami-1553827c'; +const BROWSERID_TEMPLATE_IMAGE_ID = 'ami-fd558494'; function extractInstanceDeets(horribleBlob) { var instance = {}; @@ -44,7 +44,7 @@ exports.destroy = function(name, cb) { InstanceId: r[name].instanceId }, function(result) { try { return cb(result.Errors.Error.Message); } catch(e) {}; - cb(null); + cb(null, r[name]); }); }); };