Skip to content

Commit

Permalink
Merge pull request #54 from akamai/release/0.7.1
Browse files Browse the repository at this point in the history
Release 0.7.1
  • Loading branch information
SidHeg authored Jun 19, 2020
2 parents 4eefcb0 + c5599eb commit 155374e
Show file tree
Hide file tree
Showing 8 changed files with 549 additions and 382 deletions.
4 changes: 2 additions & 2 deletions cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
{
"name": "property-manager",
"aliases": ["pm", "snippets"],
"version": "0.7.0-RELEASE",
"version": "0.7.1-RELEASE",
"description": "Property Manager CLI for DevOps"
},
{
"name": "pipeline",
"aliases": ["pl", "pd", "proddeploy"],
"version": "0.7.0-RELEASE",
"version": "0.7.1-RELEASE",
"description": "Akamai Pipeline for DevOps"
}
]
Expand Down
500 changes: 309 additions & 191 deletions docs/cli_pm_commands_help.md

Large diffs are not rendered by default.

404 changes: 217 additions & 187 deletions docs/pipeline_commands_help.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cli-promotional-deployment",
"version": "0.7.0-RELEASE",
"version": "0.7.1-RELEASE",
"engines": {
"node": ">=8.0.0",
"npm": ">=6.13.4"
Expand Down
2 changes: 2 additions & 0 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ module.exports = function(cmdArgs = process.argv, procEnv = process.env,
const promote = async function(devops, envName, options) {
let network = commonCli.checkNetworkName(options);
let projectName = devops.extractProjectName(options);
commonCli.handleNotes(options);
let data = await devops.promote(projectName, envName, network, options.emails, options.message, options.force);
let pending = data.pending;
if (devops.devopsSettings.outputFormat === 'table') {
Expand Down Expand Up @@ -808,6 +809,7 @@ module.exports = function(cmdArgs = process.argv, procEnv = process.env,
.option('-e, --emails <emails>', "Comma-separated list of email addresses. Optional if default emails were set using the set-default command.")
.option('-p, --pipeline <pipelineName>', 'Pipeline name. Optional if default pipeline was set using the set-default command.')
.option('-m, --message <message>', "Enter a message describing changes made to the environment.")
.option('--note <message>', "(Alias of --message) Enter a message describing changes made to the environment.")
.requiredOption('-n, --network <network>', "Network, either 'production' or 'staging'. You can shorten 'production' to " + "'prod' or 'p' and 'staging' to 'stage' or 's'.")
.option('-w, --wait-for-activate', "Prevents you from entering more commands until promotion is complete. May take several minutes.")
.option('--force', "Deprecated. Out-of-sequence activations are now allowed by default.")
Expand Down
8 changes: 8 additions & 0 deletions src/common/common_cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,5 +635,13 @@ class CommonCli {
return allowedVarModes.has(mode);
}

handleNotes(options) {
if (options.message && options.note) {
throw new errors.ArgumentError("Cannot use both --message/-m and --note together. --note is an alias of --message", "redundant_options");
} else if (!options.message && options.note) {
options.message = options.note;
}
}

}
module.exports = CommonCli;
3 changes: 2 additions & 1 deletion src/devops.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,10 @@ class DevOps {
}

async activateVersion(propertyInfo, network, emails, message) {
let emailSet = this.createEmailSet(emails);
let versionInfo = await this.getVersionInfo(propertyInfo);
let result = await this.getPAPI().activateProperty(versionInfo.propertyId,
versionInfo.propertyVersion, network, Array.from(emails), message);
versionInfo.propertyVersion, network, Array.from(emailSet), message);
let activationId = Environment._extractActivationId(result);
return {
"propertyId": versionInfo.propertyId,
Expand Down
8 changes: 8 additions & 0 deletions src/pm/property_manager_cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ module.exports = function(cmdArgs = process.argv, procEnv = process.env,
const activate = async function(devops, options) {
let network = commonCli.checkNetworkName(options);
let propertyName = devops.extractProjectName(options);
commonCli.handleNotes(options);
let data = await devops.promote(propertyName, propertyName, network, options.emails, options.message, options.force);
let pending = data.pending;
if (devops.devopsSettings.outputFormat === 'table') {
Expand All @@ -443,6 +444,7 @@ module.exports = function(cmdArgs = process.argv, procEnv = process.env,

const activateVersion = async function(devops, options) {
let property = devops.extractProjectName(options);
commonCli.handleNotes(options);
let propertyInfo = commonCli.checkPropertyIdAndPropertyVersion(property, parseInt(options.propver, 10));
let network = commonCli.checkNetworkName(options);
return devops.activateVersion(propertyInfo, network, options.emails, options.message).then(data => {
Expand Down Expand Up @@ -470,6 +472,7 @@ module.exports = function(cmdArgs = process.argv, procEnv = process.env,
*/
const deactivate = async function(devops, options) {
let runDatv = options.forceDeactivate;
commonCli.handleNotes(options);
let propertyName = devops.extractProjectName(options);
let network = commonCli.checkNetworkName(options);
if (!runDatv) {
Expand Down Expand Up @@ -542,6 +545,7 @@ Are you sure you want to deactivate the property '${propertyName}' on network '$

const deleteProperty = async function(devops, options) {
let runDel = options.forceDelete;
commonCli.handleNotes(options);
if (!runDel) {
var questions = [{
type: 'confirm',
Expand Down Expand Up @@ -869,6 +873,7 @@ Are you sure you want to DELETE the property '${options.property}'?`,
"Activate the latest version of a property. By default, this command also executes the merge and save commands.")
.option('-e, --emails <emails>', "Comma-separated list of email addresses. Optional if default emails were set using the set-default command.")
.option('-m, --message <message>', "Enter a message describing changes made to the property.")
.option('--note <message>', "(Alias of --message) Enter a message describing changes made to the property.")
.requiredOption('-n, --network <network>', "Network, either 'production' or 'staging'. You can shorten 'production' to " + "'prod' or 'p' and 'staging' to 'stage' or 's'.")
.option('-p, --property <propertyName>', 'Property name. Optional if default property was set using the set-default command.')
.option('-w, --wait-for-activate', "Prevents you from entering more commands until activation is complete. May take several minutes.")
Expand All @@ -886,6 +891,7 @@ Are you sure you want to DELETE the property '${options.property}'?`,
"Deactivates a property. Checks if the property is active and then deactivates it.")
.option('-e, --emails <emails>', "Comma-separated list of email addresses. Optional if default emails were set using the set-default command.")
.option('-m, --message <message>', "Enter a message describing the reason for deactivating.")
.option('--note <message>', "(Alias of --message) Enter a message describing the reason for deactivating.")
.requiredOption('-n, --network <network>', "Network, either 'production' or 'staging'. You can shorten 'production' to " + "'prod' or 'p' and 'staging' to 'stage' or 's'.")
.option('-p, --property <propertyName>', 'Property name. Optional if default property was set using the set-default command.')
.option('-w, --wait-for-activate', "Prevents you from entering more commands until deactivation is complete. May take several minutes.")
Expand All @@ -904,6 +910,7 @@ Are you sure you want to DELETE the property '${options.property}'?`,
"Activate a specific version of a property. Activates latest if no version specified.")
.option('-e, --emails <emails>', "Comma-separated list of email addresses. Optional if default emails were previously set with set-default")
.option('-m, --message <message>', "Activation message passed to activation backend")
.option('--note <message>', "(Alias of --message) Activation message passed to activation backend")
.requiredOption('-n, --network <network>', "Network, either 'production' or 'staging'. You can shorten 'production' to " + "'prod' or 'p' and 'staging' to 'stage' or 's'.")
.option('-p, --property <property>', 'Property name or ID, Optional if default property was previously set using set-default.')
.option(' --propver <propver>', "Optional. The property version to activate. Uses latest version if not specified.")
Expand Down Expand Up @@ -961,6 +968,7 @@ Are you sure you want to DELETE the property '${options.property}'?`,
.command("delete", "Permanently deletes a property. You have to deactivate the property on both networks first.")
.requiredOption('-p, --property <property>', 'Property name or ID.')
.requiredOption('-m, --message <message>', "Enter a message describing the reason for the deletion.")
.requiredOption('--note <message>', "(Alias of --message) Enter a message describing the reason for the deletion.")
.option('--force-delete', 'WARNING: This option bypasses the confirmation prompt and automatically deletes your property.')
.on('--help', () => {
consoleLogger.debug(footer);
Expand Down

0 comments on commit 155374e

Please sign in to comment.