clever-tools
Advanced tools
Comparing version 2.6.2-beta.2 to 2.7.0
@@ -480,6 +480,17 @@ #! /usr/bin/env node | ||
}, domain('rm')); | ||
const domainSetFavouriteCommand = cliparse.command('set', { | ||
description: 'Set the favourite domain for a Clever Cloud application', | ||
args: [args.fqdn], | ||
}, domain('setFavourite')); | ||
const domainUnsetFavouriteCommand = cliparse.command('unset', { | ||
description: 'Unset the favourite domain for a Clever Cloud application', | ||
}, domain('unsetFavourite')); | ||
const domainFavouriteCommands = cliparse.command('favourite', { | ||
description: 'Manage Clever Cloud application favourite domain name', | ||
commands: [domainSetFavouriteCommand, domainUnsetFavouriteCommand], | ||
}, domain('getFavourite')); | ||
const domainCommands = cliparse.command('domain', { | ||
description: 'Manage Clever Cloud application domain names', | ||
options: [opts.alias], | ||
commands: [domainCreateCommand, domainRemoveCommand], | ||
commands: [domainCreateCommand, domainFavouriteCommands, domainRemoveCommand], | ||
}, domain('list')); | ||
@@ -486,0 +497,0 @@ |
# clever-tools changelog | ||
## 2.7.0 (2020-08-20) | ||
* Improve `clever deploy` perfs in several cases (partial push, force push...) | ||
* NOTE: Pushing a brand new repo is still slow in some situations | ||
* Add commands for favourite domains (Julien Tanguy) | ||
* `clever domain` now displays a star prefix `*` before the favourite domain in the list | ||
* `clever domain favourite` just displays the favourite domain (no prefix) | ||
* `clever domain favourite set example.com` sets the favourite domain to `example.com` | ||
* `clever domain favourite unset` unsets the favourite domain for this app | ||
* Add a message while waiting for deploy to start `clever deploy` and `clever restart` | ||
* Add shallow detection with appropriate error message for `clever deploy` | ||
* Fix `clever status` typo in output (Clément Delafargue) | ||
* Fix `clever env` error message when JSON input is incorrect (Jean Baptiste Noblot) | ||
* Update dependencies | ||
This is the one with the latest isomorphic-git!!! | ||
## 2.6.1 (2020-05-29) | ||
@@ -4,0 +21,0 @@ |
{ | ||
"name": "clever-tools", | ||
"version": "2.6.2-beta.2", | ||
"version": "2.7.0", | ||
"description": "Command Line Interface for Clever Cloud.", | ||
@@ -29,3 +29,3 @@ "main": "bin/clever.js", | ||
"@clevercloud/client": "^6.0.0", | ||
"@weseek/clf-date": "^0.2.1", | ||
"clf-date": "^0.2.0", | ||
"cliparse": "^0.3.1", | ||
@@ -32,0 +32,0 @@ "colors": "^1.4.0", |
@@ -48,6 +48,6 @@ 'use strict'; | ||
// We on have the commit ID but there in a situation where the last deployment was cancelled, it may have the same commit ID. | ||
// So before pushing, we get the last deployments so we can after the push figure out which deployment is new... | ||
// So before pushing, we get the last deployments so we can after the push figure out which deployment is new… | ||
const knownDeployments = await getAllDeployments({ id: ownerId, appId, limit: 5 }).then(sendToApi); | ||
Logger.println('Pushing source code to Clever Cloud...'); | ||
Logger.println('Pushing source code to Clever Cloud…'); | ||
await git.push(appData.deployUrl, branchRefspec, force) | ||
@@ -54,0 +54,0 @@ .catch(async (e) => { |
@@ -5,5 +5,25 @@ 'use strict'; | ||
const Logger = require('../logger.js'); | ||
const { get: getApp, addDomain, removeDomain } = require('@clevercloud/client/cjs/api/application.js'); | ||
const { | ||
get: getApp, | ||
addDomain, | ||
getFavouriteDomain: getFavouriteDomainWithError, | ||
markFavouriteDomain, | ||
unmarkFavouriteDomain, | ||
removeDomain, | ||
} = require('@clevercloud/client/cjs/api/application.js'); | ||
const { sendToApi } = require('../models/send-to-api.js'); | ||
function getFavouriteDomain ({ ownerId, appId }) { | ||
return getFavouriteDomainWithError({ id: ownerId, appId }) | ||
.then(sendToApi) | ||
.then(({ fqdn }) => fqdn) | ||
.catch((error) => { | ||
if (error.id === 4021) { | ||
// No favourite vhost | ||
return null; | ||
} | ||
throw error; | ||
}); | ||
} | ||
async function list (params) { | ||
@@ -14,3 +34,9 @@ const { alias } = params.options; | ||
const app = await getApp({ id: ownerId, appId }).then(sendToApi); | ||
return app.vhosts.forEach(({ fqdn }) => Logger.println(fqdn)); | ||
const favouriteDomain = await getFavouriteDomain({ ownerId, appId }); | ||
return app.vhosts.forEach(({ fqdn }) => { | ||
const prefix = (fqdn === favouriteDomain) | ||
? '* ' | ||
: ' '; | ||
Logger.println(prefix + fqdn); | ||
}); | ||
} | ||
@@ -28,2 +54,32 @@ | ||
async function getFavourite (params) { | ||
const { alias } = params.options; | ||
const { ownerId, appId } = await AppConfig.getAppDetails({ alias }); | ||
const favouriteDomain = await getFavouriteDomain({ ownerId, appId }); | ||
if (favouriteDomain == null) { | ||
return Logger.println('No favourite domain set'); | ||
} | ||
return Logger.println(favouriteDomain); | ||
} | ||
async function setFavourite (params) { | ||
const [fqdn] = params.args; | ||
const { alias } = params.options; | ||
const { ownerId, appId } = await AppConfig.getAppDetails({ alias }); | ||
await markFavouriteDomain({ id: ownerId, appId }, { fqdn }).then(sendToApi); | ||
Logger.println('Your favourite domain has been successfully set'); | ||
} | ||
async function unsetFavourite (params) { | ||
const { alias } = params.options; | ||
const { ownerId, appId } = await AppConfig.getAppDetails({ alias }); | ||
await unmarkFavouriteDomain({ id: ownerId, appId }).then(sendToApi); | ||
Logger.println('Favourite domain has been successfully unset'); | ||
} | ||
async function rm (params) { | ||
@@ -39,2 +95,2 @@ const [fqdn] = params.args; | ||
module.exports = { list, add, rm }; | ||
module.exports = { list, add, getFavourite, setFavourite, unsetFavourite, rm }; |
'use strict'; | ||
const clfDate = require('@weseek/clf-date'); | ||
const clfDate = require('clf-date'); | ||
@@ -5,0 +5,0 @@ function listAvailableFormats () { |
@@ -51,3 +51,3 @@ 'use strict'; | ||
const deployment = await getDeployment({ id: ownerId, appId, deploymentId }).then(sendToApi); | ||
// If it's not WIP, it means it has ended (OK, FAIL, CANCELLED...) | ||
// If it's not WIP, it means it has ended (OK, FAIL, CANCELLED…) | ||
if (deployment.state !== 'WIP') { | ||
@@ -54,0 +54,0 @@ Logger.debug(`Deployment is finished (state:${deployment.state})`); |
@@ -104,2 +104,3 @@ 'use strict'; | ||
Logger.println('Waiting for deployment to start…'); | ||
const deployment = await waitForDeploymentStart({ ownerId, appId, deploymentId, commitId, knownDeployments }); | ||
@@ -112,3 +113,3 @@ Logger.println(colors.bold.blue(`Deployment started (${deployment.uuid})`)); | ||
if (!quiet) { | ||
// About the deferred... | ||
// About the deferred… | ||
// If displayLiveLogs() throws an error, | ||
@@ -115,0 +116,0 @@ // the async function we're in (watchDeploymentAndDisplayLogs) will stop here and the error will be passed to the parent. |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
188422
3596
0
+ Addedclf-date@^0.2.0
+ Addedclf-date@0.2.1(transitive)
- Removed@weseek/clf-date@^0.2.1
- Removed@weseek/clf-date@0.2.1(transitive)