Browse files

Applying review comments.

  • Loading branch information...
1 parent 342e9dd commit c7d98440b3b10cbc6777cdf7739696131f934393 @andrerod andrerod committed Oct 22, 2012
View
24 lib/cli/commands/deployment.js
@@ -25,7 +25,7 @@ var utils = require("../utils");
var constants = require("../constants");
var cacheUtils = require("../cacheUtils");
-var LinkedRevisionControl = require("../linkedrevisioncontrol.js");
+var linkedRevisionControl = require("../linkedrevisioncontrol");
exports.init = function(cli) {
@@ -78,7 +78,7 @@ exports.init = function(cli) {
- return ensureRepositoryUri(context, __cb(_, __frame, 9, 26, function ___(__0, __1) { repositoryUri = __1; return (function __$__1(__then) {
+ return site.ensureRepositoryUri(context, __cb(_, __frame, 9, 26, function ___(__0, __1) { repositoryUri = __1; return (function __$__1(__then) {
if (repositoryUri) {
return listDeployments(context, __cb(_, __frame, 11, 8, __then, true)); } else {
@@ -105,7 +105,7 @@ exports.init = function(cli) {
return _(null, log.error((("deployment with " + commitId) + " does not exist"))); } else { __then(); } ; })(function __$__2() {
- return ensureRepositoryUri(context, __cb(_, __frame, 13, 26, function ___(__0, __3) { repositoryUri = __3; return (function __$__2(__then) {
+ return site.ensureRepositoryUri(context, __cb(_, __frame, 13, 26, function ___(__0, __3) { repositoryUri = __3; return (function __$__2(__then) {
if (repositoryUri) {
return scm.doDeploymentGet(context, __cb(_, __frame, 15, 25, function ___(__0, __4) { deployment = __4; return (function __$__2(__then) {
@@ -157,7 +157,7 @@ exports.init = function(cli) {
return _(null, log.error((("deployment with " + commitId) + " does not exist"))); } else { __then(); } ; })(function __$__3() {
- return ensureRepositoryUri(context, __cb(_, __frame, 13, 26, function ___(__0, __4) { repositoryUri = __4; return (function __$__3(__then) {
+ return site.ensureRepositoryUri(context, __cb(_, __frame, 13, 26, function ___(__0, __4) { repositoryUri = __4; return (function __$__3(__then) {
if (repositoryUri) { return (function __$__3(_) {
var __1 = !options.quiet; if (!__1) { return _(null, __1); } ; return site.confirm((("Reploy deployment with " + context.shortId) + " id? (y/n) "), __cb(_, __frame, 15, 31, function ___(__0, __3) { var __2 = !__3; return _(null, __2); }, true)); })(__cb(_, __frame, -146, 17, function ___(__0, __5) { return (function __$__3(__then) { if (__5) { return _(null); } else { __then(); } ; })(function __$__3() {
@@ -209,7 +209,7 @@ exports.init = function(cli) {
function initializeRemoteRepo(_) { var __frame = { name: "initializeRemoteRepo", line: 209 }; return __func(_, this, arguments, initializeRemoteRepo, 0, __frame, function __$initializeRemoteRepo() {
log.silly("InitializeRemoteRepo");
return site.doRepositoryPost(context, __cb(_, __frame, 2, 8, function __$initializeRemoteRepo() {
- return ensureRepositoryUri(__cb(_, __frame, 3, 8, _, true)); }, true)); }); }; var __frame = { name: "__4", line: 180 }; return __func(_, this, arguments, __4, 2, __frame, function __$__4() { context = { subscription: cli.category("account").lookupSubscriptionId(options.subscription), site: { name: name }, username: options.username, password: options.pass, remoteUri: options.repository, flags: { } }; if (!context.remoteUri) { context.flags = { forceRepositorySelection: true }; } ; return scm.ensureRepositoryUri(context, __cb(_, __frame, 19, 6, function __$__4() { return (function __$__4(__then) { if (!context.repositoryUri) { return initializeRemoteRepo(__cb(_, __frame, 22, 8, __then, true)); } else { __then(); } ; })(function __$__4() { context.lvcClient = LinkedRevisionControl.createClient(cli, "github"); return context.lvcClient.init(context, __cb(_, __frame, 26, 6, function __$__4() { return context.lvcClient.deploy(context, __cb(_, __frame, 27, 6, _, true)); }, true)); }); }, true)); }); });
+ return site.ensureRepositoryUri(context, __cb(_, __frame, 3, 8, _, true)); }, true)); }); }; var __frame = { name: "__4", line: 180 }; return __func(_, this, arguments, __4, 2, __frame, function __$__4() { context = { subscription: cli.category("account").lookupSubscriptionId(options.subscription), site: { name: name }, username: options.username, password: options.pass, remoteUri: options.repository, flags: { } }; if (!context.remoteUri) { context.flags = { forceRepositorySelection: true }; } ; return site.ensureRepositoryUri(context, __cb(_, __frame, 19, 6, function __$__4() { return (function __$__4(__then) { if (!context.repositoryUri) { return initializeRemoteRepo(__cb(_, __frame, 22, 8, __then, true)); } else { __then(); } ; })(function __$__4() { context.lvcClient = linkedRevisionControl.createClient(cli, "github"); return context.lvcClient.init(context, __cb(_, __frame, 26, 6, function __$__4() { return context.lvcClient.deploy(context, __cb(_, __frame, 27, 6, _, true)); }, true)); }); }, true)); }); });
@@ -377,20 +377,6 @@ exports.init = function(cli) {
- function ensureRepositoryUri(context, _) { var siteData, repositoryUri; var __frame = { name: "ensureRepositoryUri", line: 380 }; return __func(_, this, arguments, ensureRepositoryUri, 1, __frame, function __$ensureRepositoryUri() {
- return site.lookupSiteNameAndWebSpace(context, __cb(_, __frame, 1, 19, function ___(__0, __1) { siteData = __1;
- repositoryUri = (siteData && site.getRepositoryUri(siteData)); return (function __$ensureRepositoryUri(__then) {
- if (!repositoryUri) {
- return site.doSiteGet(context, __cb(_, __frame, 4, 17, function ___(__0, __2) { siteData = __2;
- repositoryUri = site.getRepositoryUri(siteData); __then(); }, true)); } else { __then(); } ; })(function __$ensureRepositoryUri() {
-
- if (repositoryUri) {
- context.repositoryAuth = site.getRepositoryAuth(siteData);
- return _(null, context.repositoryUri = repositoryUri); } ; _(); }); }, true)); }); };
-
-
- scm.ensureRepositoryUri = ensureRepositoryUri;
-
function formatDeployment(deployment) {
var timeProperties = ["end_time","last_success_end_time","received_time","start_time",];
for (var i = 0; (i < timeProperties.length); ++i) {
View
28 lib/cli/commands/deployment_.js
@@ -25,7 +25,7 @@ var utils = require('../utils');
var constants = require('../constants');
var cacheUtils = require('../cacheUtils');
-var LinkedRevisionControl = require('../linkedrevisioncontrol.js');
+var linkedRevisionControl = require('../linkedrevisioncontrol');
exports.init = function (cli) {
@@ -78,7 +78,7 @@ exports.init = function (cli) {
}
};
- var repositoryUri = ensureRepositoryUri(context, _);
+ var repositoryUri = site.ensureRepositoryUri(context, _);
if (repositoryUri) {
listDeployments(context, _);
} else {
@@ -105,7 +105,7 @@ exports.init = function (cli) {
return log.error('deployment with ' + commitId + ' does not exist');
}
- var repositoryUri = ensureRepositoryUri(context, _);
+ var repositoryUri = site.ensureRepositoryUri(context, _);
if (repositoryUri) {
var deployment = scm.doDeploymentGet(context, _);
@@ -157,7 +157,7 @@ exports.init = function (cli) {
return log.error('deployment with ' + commitId + ' does not exist');
}
- var repositoryUri = ensureRepositoryUri(context, _);
+ var repositoryUri = site.ensureRepositoryUri(context, _);
if (repositoryUri) {
if (!options.quiet && !site.confirm('Reploy deployment with ' + context.shortId + ' id? (y/n) ', _)) {
return;
@@ -196,20 +196,20 @@ exports.init = function (cli) {
}
// Fetch site and website repository data
- scm.ensureRepositoryUri(context, _);
+ site.ensureRepositoryUri(context, _);
if (!context.repositoryUri) {
// If there is no website remote repo, initialize it
initializeRemoteRepo(_);
}
- context.lvcClient = LinkedRevisionControl.createClient(cli, 'github');
+ context.lvcClient = linkedRevisionControl.createClient(cli, 'github');
context.lvcClient.init(context, _);
context.lvcClient.deploy(context, _);
function initializeRemoteRepo(_) {
log.silly('InitializeRemoteRepo');
site.doRepositoryPost(context, _);
- ensureRepositoryUri(_);
+ site.ensureRepositoryUri(context, _);
}
});
@@ -377,20 +377,6 @@ exports.init = function (cli) {
});
}
- function ensureRepositoryUri(context, _) {
- var siteData = site.lookupSiteNameAndWebSpace(context, _);
- var repositoryUri = siteData && site.getRepositoryUri(siteData);
- if (!repositoryUri) {
- siteData = site.doSiteGet(context, _);
- repositoryUri = site.getRepositoryUri(siteData);
- }
- if (repositoryUri) {
- context.repositoryAuth = site.getRepositoryAuth(siteData);
- return context.repositoryUri = repositoryUri;
- }
- }
- scm.ensureRepositoryUri = ensureRepositoryUri;
-
function formatDeployment(deployment) {
var timeProperties = ['end_time', 'last_success_end_time', 'received_time', 'start_time'];
for (var i = 0; i < timeProperties.length; ++i) {
View
194 lib/cli/commands/log.js
@@ -1,113 +1,81 @@
-/*** Generated by streamline 0.3.6 (callbacks) - DO NOT EDIT ***/
-var __rt=require('streamline/lib/callbacks/runtime').runtime(__filename),__func=__rt.__func,__cb=__rt.__cb,__tryCatch=__rt.__tryCatch,__propagate=__rt.__propagate,__trap=__rt.__trap,__future=__rt.__future,__setEF=__rt.__setEF,__g=__rt.__g;
-/* 1 */ var common = require("../common");
-/* 20 */ var fs = require("fs");
-/* 21 */ var path = require("path");
-/* 22 */ var url = require("url");
-/* 23 */ var crypto = require("crypto");
-/* 24 */ var pfx2pem = require("../../util/certificates/pkcs").pfx2pem;
-/* 25 */ var Channel = require("../channel");
-/* 26 */ var async = require("async");
-/* 27 */ var child_process = require("child_process");
-/* 28 */ var utils = require("../utils");
-/* 29 */ var constants = require("../constants");
-/* 30 */ var cacheUtils = require("../cacheUtils");
-/* 32 */ exports.init = function(cli) {
-/* 34 */ var log = cli.output;
-/* 35 */ var site = cli.category("site");
-/* 36 */ var scm = site.category("deployment");
-/* 37 */ var diagnostic = site.category("log").description("Commands to download diagnostic log");
-/* 40 */ diagnostic.command("download [name]").whiteListPowershell().description("Download diagnostic log").option("-s, --subscription <id>", "use the subscription id").option("-o, --output <path>", "output path, default is local folder").execute(function __1(name, options, _) {
- var context, repositoryUri, buf;
- var __frame = {
- name: "__1",
- line: 45
- };
- return __func(_, this, arguments, __1, 2, __frame, function __$__1() {
-/* 46 */ context = {
-/* 47 */ subscription: cli.category("account").lookupSubscriptionId(options.subscription),
-/* 48 */ path: (options.output || ""),
-/* 49 */ site: {
-/* 50 */ name: name
- }
- };
-/* 54 */ if (!(/[.]zip$/i.test(context.path))) {
-/* 55 */ context.path = path.join(context.path, "diagnostics.zip");
- }
- ;
- return (function __$__1(__then) {
-/* 58 */ if (utils.pathExistsSync(context.path)) {
-/* 59 */ return site.confirm((("Replace existing " + context.path) + "? (y/n) "), __cb(_, __frame, 14, 13, function ___(__0, __2) {
-/* 59 */ var __1 = !__2;
- return (function __$__1(__then) {
- if (__1) {
- return _(null);
- }
- else {
- __then();
- }
- ;
- })(__then);
- }, true));
- }
- else {
- __then();
- }
- ;
- })(function __$__1() {
-/* 64 */ return scm.ensureRepositoryUri(context, __cb(_, __frame, 19, 26, function ___(__0, __3) {
- repositoryUri = __3;
- return (function __$__1(__then) {
-/* 65 */ if (repositoryUri) {
-/* 66 */ return doDownloadDiagnostic(context, __cb(_, __frame, 21, 18, function ___(__0, __4) {
- buf = __4;
-/* 67 */ log.info(("Writing to " + context.path));
-/* 68 */ return fs.writeFile(context.path, buf, __cb(_, __frame, 23, 8, __then, true));
- }, true));
- }
- else {
-/* 70 */ log.error("Repository is not setup");
- __then();
- }
- ;
- })(_);
- }, true));
- });
- });
- });
-/* 74 */ function doDownloadDiagnostic(context, _) {
- var channel, progress;
- var __frame = {
- name: "doDownloadDiagnostic",
- line: 74
- };
- return __func(_, this, arguments, doDownloadDiagnostic, 1, __frame, function __$doDownloadDiagnostic() {
-/* 76 */ channel = scm.getScmChannel(context).path("dump");
-/* 77 */ progress = cli.progress("Downloading diagnostic log");
- return (function ___(__then) {
- (function ___(_) {
- __tryCatch(_, function __$doDownloadDiagnostic() {
-/* 79 */ return channel.GET(__cb(_, __frame, 5, 13, _, true));
- });
- })(function ___(__e, __r, __cont) {
- (function ___(__then) {
- __tryCatch(_, function __$doDownloadDiagnostic() {
-/* 81 */ progress.end();
- __then();
- });
- })(function ___() {
- __tryCatch(_, function ___() {
- if (__cont) {
- __then();
- } else {
- _(__e, __r);
- };
- });
- });
- });
- })(function ___() {
- __tryCatch(_, _);
- });
- });
- };
- };
+/*** Generated by streamline 0.4.5 (callbacks) - DO NOT EDIT ***/ var __rt=require('streamline/lib/callbacks/runtime').runtime(__filename),__func=__rt.__func,__cb=__rt.__cb,__tryCatch=__rt.__tryCatch; var common = require("../common");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+var fs = require("fs");
+var path = require("path");
+var url = require("url");
+var crypto = require("crypto");
+var pfx2pem = require("../../util/certificates/pkcs").pfx2pem;
+var Channel = require("../channel");
+var async = require("async");
+var child_process = require("child_process");
+var utils = require("../utils");
+var constants = require("../constants");
+var cacheUtils = require("../cacheUtils");
+
+exports.init = function(cli) {
+
+ var log = cli.output;
+ var site = cli.category("site");
+ var scm = site.category("deployment");
+ var diagnostic = site.category("log").description("Commands to download diagnostic log");
+
+
+ diagnostic.command("download [name]").whiteListPowershell().description("Download diagnostic log").option("-s, --subscription <id>", "use the subscription id").option("-o, --output <path>", "output path, default is local folder").execute(function __1(name, options, _) { var context, repositoryUri, buf; var __frame = { name: "__1", line: 45 }; return __func(_, this, arguments, __1, 2, __frame, function __$__1() {
+
+
+
+
+
+ context = {
+ subscription: cli.category("account").lookupSubscriptionId(options.subscription),
+ path: (options.output || ""),
+ site: {
+ name: name } };
+
+
+
+ if (!(/[.]zip$/i.test(context.path))) {
+ context.path = path.join(context.path, "diagnostics.zip"); } ; return (function __$__1(__then) {
+
+
+ if (utils.pathExistsSync(context.path)) {
+ return site.confirm((("Replace existing " + context.path) + "? (y/n) "), __cb(_, __frame, 14, 13, function ___(__0, __2) { var __1 = !__2; return (function __$__1(__then) { if (__1) { return _(null); } else { __then(); } ; })(__then); }, true)); } else { __then(); } ; })(function __$__1() {
+
+
+
+
+ return site.ensureRepositoryUri(context, __cb(_, __frame, 19, 26, function ___(__0, __3) { repositoryUri = __3; return (function __$__1(__then) {
+ if (repositoryUri) {
+ return doDownloadDiagnostic(context, __cb(_, __frame, 21, 18, function ___(__0, __4) { buf = __4;
+ log.info(("Writing to " + context.path));
+ return fs.writeFile(context.path, buf, __cb(_, __frame, 23, 8, __then, true)); }, true)); } else {
+
+ log.error("Repository is not setup"); __then(); } ; })(_); }, true)); }); }); });
+
+
+
+ function doDownloadDiagnostic(context, _) { var channel, progress; var __frame = { name: "doDownloadDiagnostic", line: 74 }; return __func(_, this, arguments, doDownloadDiagnostic, 1, __frame, function __$doDownloadDiagnostic() {
+
+ channel = scm.getScmChannel(context).path("dump");
+ progress = cli.progress("Downloading diagnostic log"); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$doDownloadDiagnostic() {
+
+ return channel.GET(__cb(_, __frame, 5, 13, _, true)); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$doDownloadDiagnostic() {
+
+ progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, _); }); }); };};
View
2 lib/cli/commands/log_.js
@@ -61,7 +61,7 @@ exports.init = function (cli) {
}
}
- var repositoryUri = scm.ensureRepositoryUri(context, _);
+ var repositoryUri = site.ensureRepositoryUri(context, _);
if (repositoryUri) {
var buf = doDownloadDiagnostic(context, _);
log.info('Writing to ' + context.path);
View
60 lib/cli/commands/site.js
@@ -27,7 +27,7 @@ var utils = require("../utils");
var constants = require("../constants");
var cacheUtils = require("../cacheUtils");
-var LinkedRevisionControl = require("../linkedrevisioncontrol.js");
+var linkedRevisionControl = require("../linkedrevisioncontrol");
exports.init = function(cli) {
@@ -313,31 +313,17 @@ exports.init = function(cli) {
return exec(("git remote add azure " + gitUri), __cb(_, __frame, 25, 12, _, true)); }); }, true)); }); }); };
- function ensureRepositoryUri(_) { var siteData, repositoryUri; var __frame = { name: "ensureRepositoryUri", line: 316 }; return __func(_, this, arguments, ensureRepositoryUri, 0, __frame, function __$ensureRepositoryUri() {
- return site.lookupSiteNameAndWebSpace(context, __cb(_, __frame, 1, 27, function ___(__0, __1) { siteData = __1;
- repositoryUri = (siteData && site.getRepositoryUri(siteData)); return (function __$ensureRepositoryUri(__then) {
- if (!repositoryUri) {
- return site.doSiteGet(context, __cb(_, __frame, 4, 25, function ___(__0, __2) { siteData = __2;
- repositoryUri = site.getRepositoryUri(siteData); __then(); }, true)); } else { __then(); } ; })(function __$ensureRepositoryUri() {
-
-
- if (repositoryUri) {
- context.repositoryAuth = site.getRepositoryAuth(siteData);
- return _(null, context.repositoryUri = repositoryUri); } ; _(); }); }, true)); }); };
-
-
-
- function ensureSpaces(context, _) { var __frame = { name: "ensureSpaces", line: 330 }; return __func(_, this, arguments, ensureSpaces, 1, __frame, function __$ensureSpaces() { return (function __$ensureSpaces(__then) {
+ function ensureSpaces(context, _) { var __frame = { name: "ensureSpaces", line: 316 }; return __func(_, this, arguments, ensureSpaces, 1, __frame, function __$ensureSpaces() { return (function __$ensureSpaces(__then) {
if (!context.spaces) {
return cacheUtils.readSpaces(context, __cb(_, __frame, 2, 31, function ___(__0, __1) { context.spaces = __1; return (function __$ensureSpaces(__then) {
if ((!context.spaces || !context.spaces.length)) {
- return context.site.doSpacesGet(context, __cb(_, __frame, 4, 33, function ___(__0, __2) { context.spaces = __2; __then(); }, true)); } else { __then(); } ; })(__then); }, true)); } else { __then(); } ; })(_); }); }; var __frame = { name: "__2", line: 127 }; return __func(_, this, arguments, __2, 2, __frame, function __$__2() { context = { subscription: cli.category("account").lookupSubscriptionId(options.subscription), git: options.git, site: { name: nameArg, webspace: options.location, hostname: options.hostname }, publishingUser: options.publishingUsername, username: options.username, password: options.pass, remoteUri: options.repository, flags: { } }; if ((options.git && options.github)) { return _(new Error("Please run the command with either --git or --github options. Not both.")); } ; return promptForSiteName(__cb(_, __frame, 21, 10, function __$__2() { return determineIfSiteExists(__cb(_, __frame, 22, 10, function __$__2() { return promptForLocation(__cb(_, __frame, 23, 10, function __$__2() { return createSite(__cb(_, __frame, 24, 10, function __$__2() { return (function __$__2(__then) { if ((options.git || options.github)) { if (options.github) { context.lvcClient = LinkedRevisionControl.createClient(cli, "github"); } else { if (options.git) { context.lvcClient = LinkedRevisionControl.createClient(cli, "git"); } ; } ; return context.lvcClient.init(context, __cb(_, __frame, 34, 12, function __$__2() { return copyIisNodeWhenServerJsPresent(__cb(_, __frame, 37, 12, function __$__2() { return updateLocalConfigWithSiteName(__cb(_, __frame, 38, 12, function __$__2() { return initializeRemoteRepo(__cb(_, __frame, 40, 12, function __$__2() { return (function __$__2(__then) { if (options.git) { return addRemoteToLocalGitRepo(__cb(_, __frame, 43, 14, __then, true)); } else { return (function __$__2(__then) { if (options.github) { return ensureRepositoryUri(__cb(_, __frame, 45, 14, __then, true)); } else { __then(); } ; })(__then); } ; })(function __$__2() { return context.lvcClient.deploy(context, __cb(_, __frame, 48, 12, __then, true)); }); }, true)); }, true)); }, true)); }, true)); } else { __then(); } ; })(_); }, true)); }, true)); }, true)); }, true)); }); });
+ return context.site.doSpacesGet(context, __cb(_, __frame, 4, 33, function ___(__0, __2) { context.spaces = __2; __then(); }, true)); } else { __then(); } ; })(__then); }, true)); } else { __then(); } ; })(_); }); }; var __frame = { name: "__2", line: 127 }; return __func(_, this, arguments, __2, 2, __frame, function __$__2() { context = { subscription: cli.category("account").lookupSubscriptionId(options.subscription), git: options.git, site: { name: nameArg, webspace: options.location, hostname: options.hostname }, publishingUser: options.publishingUsername, username: options.username, password: options.pass, remoteUri: options.repository, flags: { } }; if ((options.git && options.github)) { return _(new Error("Please run the command with either --git or --github options. Not both.")); } ; return promptForSiteName(__cb(_, __frame, 21, 10, function __$__2() { return determineIfSiteExists(__cb(_, __frame, 22, 10, function __$__2() { return promptForLocation(__cb(_, __frame, 23, 10, function __$__2() { return createSite(__cb(_, __frame, 24, 10, function __$__2() { return (function __$__2(__then) { if ((options.git || options.github)) { if (options.github) { context.lvcClient = linkedRevisionControl.createClient(cli, "github"); } else { if (options.git) { context.lvcClient = linkedRevisionControl.createClient(cli, "git"); } ; } ; return context.lvcClient.init(context, __cb(_, __frame, 34, 12, function __$__2() { return copyIisNodeWhenServerJsPresent(__cb(_, __frame, 37, 12, function __$__2() { return updateLocalConfigWithSiteName(__cb(_, __frame, 38, 12, function __$__2() { return initializeRemoteRepo(__cb(_, __frame, 40, 12, function __$__2() { return (function __$__2(__then) { if (options.git) { return addRemoteToLocalGitRepo(__cb(_, __frame, 43, 14, __then, true)); } else { return (function __$__2(__then) { if (options.github) { return site.ensureRepositoryUri(context, __cb(_, __frame, 45, 14, __then, true)); } else { __then(); } ; })(__then); } ; })(function __$__2() { return context.lvcClient.deploy(context, __cb(_, __frame, 48, 12, __then, true)); }); }, true)); }, true)); }, true)); }, true)); } else { __then(); } ; })(_); }, true)); }, true)); }, true)); }, true)); }); });
- function portalCreateSiteInstruction(context, _) { var href; var __frame = { name: "portalCreateSiteInstruction", line: 340 }; return __func(_, this, arguments, portalCreateSiteInstruction, 1, __frame, function __$portalCreateSiteInstruction() {
+ function portalCreateSiteInstruction(context, _) { var href; var __frame = { name: "portalCreateSiteInstruction", line: 326 }; return __func(_, this, arguments, portalCreateSiteInstruction, 1, __frame, function __$portalCreateSiteInstruction() {
log.help("You must create your first web site using the Windows Azure portal.");
log.help("Please follow these steps in the portal:");
log.help("1. At the bottom of the page, click on New > Web Site > Quick Create");
@@ -356,7 +342,7 @@ exports.init = function(cli) {
- function getPublishingUser(context, _) { var publishingUsers, filters; var __frame = { name: "getPublishingUser", line: 359 }; return __func(_, this, arguments, getPublishingUser, 1, __frame, function __$getPublishingUser() {
+ function getPublishingUser(context, _) { var publishingUsers, filters; var __frame = { name: "getPublishingUser", line: 345 }; return __func(_, this, arguments, getPublishingUser, 1, __frame, function __$getPublishingUser() {
publishingUsers = toArray(context.publishingUsers);
filters = publishingUsers.filter(function(item) {
return ((typeof item === "string") && (item.length <= 64)); }); return (function __$getPublishingUser(__then) {
@@ -374,7 +360,7 @@ exports.init = function(cli) {
return prompt("Publishing username: ", __cb(_, __frame, 15, 11, _, true)); }); }); };
- function portalGitInitInstruction(context, _) { var href; var __frame = { name: "portalGitInitInstruction", line: 377 }; return __func(_, this, arguments, portalGitInitInstruction, 1, __frame, function __$portalGitInitInstruction() {
+ function portalGitInitInstruction(context, _) { var href; var __frame = { name: "portalGitInitInstruction", line: 363 }; return __func(_, this, arguments, portalGitInitInstruction, 1, __frame, function __$portalGitInitInstruction() {
log.help("You must create your git publishing credentials using the Windows Azure portal.");
log.help("Please follow these steps in the portal:");
log.help("1. In the menu on the left select \"Web Sites\"");
@@ -394,7 +380,7 @@ exports.init = function(cli) {
var location = site.category("location").description("Commands to manage your Azure locations");
- location.command("list").whiteListPowershell().description("List locations available for your account").execute(function __3(options, _) { var context, spaces, s; var __frame = { name: "__3", line: 400 }; return __func(_, this, arguments, __3, 1, __frame, function __$__3() {
+ location.command("list").whiteListPowershell().description("List locations available for your account").execute(function __3(options, _) { var context, spaces, s; var __frame = { name: "__3", line: 386 }; return __func(_, this, arguments, __3, 1, __frame, function __$__3() {
@@ -416,7 +402,7 @@ exports.init = function(cli) {
- site.command("portal [name]").whiteListPowershell().description("Opens the portal in a browser to manage your web sites").option("-r, --realm <realm>", "specifies organization used for login").execute(function __4(name, options, _) { var href; var __frame = { name: "__4", line: 423 }; return __func(_, this, arguments, __4, 2, __frame, function __$__4() {
+ site.command("portal [name]").whiteListPowershell().description("Opens the portal in a browser to manage your web sites").option("-r, --realm <realm>", "specifies organization used for login").execute(function __4(name, options, _) { var href; var __frame = { name: "__4", line: 409 }; return __func(_, this, arguments, __4, 2, __frame, function __$__4() {
@@ -436,7 +422,7 @@ exports.init = function(cli) {
common.launchBrowser(targetUrl); _(); }); });
- site.command("browse [name]").whiteListPowershell().description("Open your web site in a browser.").option("-s, --subscription <id>", "use the subscription id").execute(function __5(name, options, _) { var context, cache, siteData, href; var __frame = { name: "__5", line: 443 }; return __func(_, this, arguments, __5, 2, __frame, function __$__5() {
+ site.command("browse [name]").whiteListPowershell().description("Open your web site in a browser.").option("-s, --subscription <id>", "use the subscription id").execute(function __5(name, options, _) { var context, cache, siteData, href; var __frame = { name: "__5", line: 429 }; return __func(_, this, arguments, __5, 2, __frame, function __$__5() {
@@ -450,14 +436,14 @@ exports.init = function(cli) {
return lookupSiteNameAndWebSpace(context, __cb(_, __frame, 9, 22, function ___(__0, __2) { cache = __2; return (function __$__5(_) {
- var __1 = cache; if (__1) { return _(null, __1); } ; return site.doSiteGet(context, __cb(_, __frame, 10, 40, _, true)); })(__cb(_, __frame, -442, 17, function ___(__0, __3) { siteData = clean(__3);
+ var __1 = cache; if (__1) { return _(null, __1); } ; return site.doSiteGet(context, __cb(_, __frame, 10, 40, _, true)); })(__cb(_, __frame, -428, 17, function ___(__0, __3) { siteData = clean(__3);
href = ("http://" + toArray(siteData.HostNames)[0]);
common.launchBrowser(href); _(); }, true)); }, true)); }); });
- site.command("show [name]").whiteListPowershell().description("Show details for a web site").option("-s, --subscription <id>", "use the subscription id").execute(function __6(name, options, _) { var context, result, repositoryUri, gitUri, settings, data, index; var __frame = { name: "__6", line: 464 }; return __func(_, this, arguments, __6, 2, __frame, function __$__6() {
+ site.command("show [name]").whiteListPowershell().description("Show details for a web site").option("-s, --subscription <id>", "use the subscription id").execute(function __6(name, options, _) { var context, result, repositoryUri, gitUri, settings, data, index; var __frame = { name: "__6", line: 450 }; return __func(_, this, arguments, __6, 2, __frame, function __$__6() {
@@ -474,9 +460,9 @@ exports.init = function(cli) {
log.info("Showing details for site");
log.verbose("Parameters", context);
- return async.parallel([function __1(_) { var __frame = { name: "__1", line: 478 }; return __func(_, this, arguments, __1, 0, __frame, function __$__1() {
+ return async.parallel([function __1(_) { var __frame = { name: "__1", line: 464 }; return __func(_, this, arguments, __1, 0, __frame, function __$__1() {
return site.doSiteGet(context, __cb(_, __frame, 0, 34, _, true)); });
- },function __2(_) { var __frame = { name: "__2", line: 479 }; return __func(_, this, arguments, __2, 0, __frame, function __$__2() { return site.doSiteConfigGet(context, __cb(_, __frame, 0, 34, _, true)); }); },], __cb(_, __frame, 13, 23, function ___(__0, __3) { result = __3;
+ },function __2(_) { var __frame = { name: "__2", line: 465 }; return __func(_, this, arguments, __2, 0, __frame, function __$__2() { return site.doSiteConfigGet(context, __cb(_, __frame, 0, 34, _, true)); }); },], __cb(_, __frame, 13, 23, function ___(__0, __3) { result = __3;
@@ -508,7 +494,7 @@ exports.init = function(cli) {
- function lookupSiteName(context, _) { var cfg; var __frame = { name: "lookupSiteName", line: 511 }; return __func(_, this, arguments, lookupSiteName, 1, __frame, function __$lookupSiteName() {
+ function lookupSiteName(context, _) { var cfg; var __frame = { name: "lookupSiteName", line: 497 }; return __func(_, this, arguments, lookupSiteName, 1, __frame, function __$lookupSiteName() {
if ((context.site.name !== undefined)) { return _(null); } ;
@@ -529,7 +515,7 @@ exports.init = function(cli) {
- function lookupSiteWebSpace(context, _) { var sites, index; var __frame = { name: "lookupSiteWebSpace", line: 532 }; return __func(_, this, arguments, lookupSiteWebSpace, 1, __frame, function __$lookupSiteWebSpace() {
+ function lookupSiteWebSpace(context, _) { var sites, index; var __frame = { name: "lookupSiteWebSpace", line: 518 }; return __func(_, this, arguments, lookupSiteWebSpace, 1, __frame, function __$lookupSiteWebSpace() {
log.verbose("Attempting to locate site ", context.site.name);
return site.doSitesGet(context, __cb(_, __frame, 2, 16, function ___(__0, __1) { sites = __1;
for (index in sites) {
@@ -543,7 +529,7 @@ exports.init = function(cli) {
- function lookupSiteNameAndWebSpace(context, _) { var cache; var __frame = { name: "lookupSiteNameAndWebSpace", line: 546 }; return __func(_, this, arguments, lookupSiteNameAndWebSpace, 1, __frame, function __$lookupSiteNameAndWebSpace() {
+ function lookupSiteNameAndWebSpace(context, _) { var cache; var __frame = { name: "lookupSiteNameAndWebSpace", line: 532 }; return __func(_, this, arguments, lookupSiteNameAndWebSpace, 1, __frame, function __$lookupSiteNameAndWebSpace() {
return lookupSiteName(context, __cb(_, __frame, 1, 4, function __$lookupSiteNameAndWebSpace() {
return cacheUtils.readSite(context, __cb(_, __frame, 2, 16, function ___(__0, __1) { cache = __1;
if ((cache || context.site.webspace)) {
@@ -617,6 +603,20 @@ exports.init = function(cli) {
site.getRepositoryAuth = getRepositoryAuth;
+ function ensureRepositoryUri(context, _) { var siteData, repositoryUri; var __frame = { name: "ensureRepositoryUri", line: 606 }; return __func(_, this, arguments, ensureRepositoryUri, 1, __frame, function __$ensureRepositoryUri() {
+ return site.lookupSiteNameAndWebSpace(context, __cb(_, __frame, 1, 19, function ___(__0, __1) { siteData = __1;
+ repositoryUri = (siteData && site.getRepositoryUri(siteData)); return (function __$ensureRepositoryUri(__then) {
+ if (!repositoryUri) {
+ return site.doSiteGet(context, __cb(_, __frame, 4, 17, function ___(__0, __2) { siteData = __2;
+ repositoryUri = site.getRepositoryUri(siteData); __then(); }, true)); } else { __then(); } ; })(function __$ensureRepositoryUri() {
+
+ if (repositoryUri) {
+ context.repositoryAuth = site.getRepositoryAuth(siteData);
+ return _(null, context.repositoryUri = repositoryUri); } ; _(); }); }, true)); }); };
+
+
+ site.ensureRepositoryUri = ensureRepositoryUri;
+
site.command("delete [name]").whiteListPowershell().description("Delete a web site").option("-s, --subscription <id>", "use the subscription id").option("-q, --quiet", "quiet mode, do not ask for delete confirmation").execute(function __7(name, options, _) { var context, progress, result; var __frame = { name: "__7", line: 625 }; return __func(_, this, arguments, __7, 2, __frame, function __$__7() {
View
36 lib/cli/commands/site_.js
@@ -27,7 +27,7 @@ var utils = require('../utils');
var constants = require('../constants');
var cacheUtils = require('../cacheUtils');
-var LinkedRevisionControl = require('../linkedrevisioncontrol.js');
+var linkedRevisionControl = require('../linkedrevisioncontrol');
exports.init = function (cli) {
@@ -153,9 +153,9 @@ exports.init = function (cli) {
// Init git / github linking
if (options.git || options.github) {
if (options.github) {
- context.lvcClient = LinkedRevisionControl.createClient(cli, 'github');
+ context.lvcClient = linkedRevisionControl.createClient(cli, 'github');
} else if (options.git) {
- context.lvcClient = LinkedRevisionControl.createClient(cli, 'git');
+ context.lvcClient = linkedRevisionControl.createClient(cli, 'git');
}
context.lvcClient.init(context, _);
@@ -169,7 +169,7 @@ exports.init = function (cli) {
if (options.git) {
addRemoteToLocalGitRepo(_);
} else if (options.github) {
- ensureRepositoryUri(_);
+ site.ensureRepositoryUri(context, _);
}
context.lvcClient.deploy(context, _);
@@ -313,20 +313,6 @@ exports.init = function (cli) {
exec('git remote add azure ' + gitUri, _);
}
- function ensureRepositoryUri(_) {
- var siteData = site.lookupSiteNameAndWebSpace(context, _);
- var repositoryUri = siteData && site.getRepositoryUri(siteData);
- if (!repositoryUri) {
- siteData = site.doSiteGet(context, _);
- repositoryUri = site.getRepositoryUri(siteData);
- }
-
- if (repositoryUri) {
- context.repositoryAuth = site.getRepositoryAuth(siteData);
- return context.repositoryUri = repositoryUri;
- }
- }
-
function ensureSpaces(context, _) {
if (!context.spaces) {
context.spaces = cacheUtils.readSpaces(context, _);
@@ -617,6 +603,20 @@ exports.init = function (cli) {
}
site.getRepositoryAuth = getRepositoryAuth;
+ function ensureRepositoryUri(context, _) {
+ var siteData = site.lookupSiteNameAndWebSpace(context, _);
+ var repositoryUri = siteData && site.getRepositoryUri(siteData);
+ if (!repositoryUri) {
+ siteData = site.doSiteGet(context, _);
+ repositoryUri = site.getRepositoryUri(siteData);
+ }
+ if (repositoryUri) {
+ context.repositoryAuth = site.getRepositoryAuth(siteData);
+ return context.repositoryUri = repositoryUri;
+ }
+ }
+ site.ensureRepositoryUri = ensureRepositoryUri;
+
site.command('delete [name]')
.whiteListPowershell()
.description('Delete a web site')

0 comments on commit c7d9844

Please sign in to comment.