@faable/faable 4.18.3 → 4.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import openBrowser from 'open';
|
|
2
2
|
import { requireApi } from '../../../api/context.js';
|
|
3
|
+
import { dashboardAppUrl } from '../../../lib/dashboard_url.js';
|
|
3
4
|
import { log } from '../../../log.js';
|
|
4
5
|
import { resolve_app_id } from '../resolve_app_id.js';
|
|
5
6
|
|
|
@@ -25,7 +26,7 @@ const open_app = {
|
|
|
25
26
|
const app_id = await resolve_app_id(args.app, ctx.appId, ctx.api);
|
|
26
27
|
const app = await ctx.api.getApp(app_id);
|
|
27
28
|
const url = args.dashboard
|
|
28
|
-
?
|
|
29
|
+
? dashboardAppUrl(String(app.team), app.id)
|
|
29
30
|
: `https://${app.url}`;
|
|
30
31
|
log.info(`🌍 Opening ${url}`);
|
|
31
32
|
await openBrowser(url).catch(() => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { requireApi } from '../../../api/context.js';
|
|
2
|
+
import { dashboardAppUrl } from '../../../lib/dashboard_url.js';
|
|
2
3
|
import { print_json, json_option } from '../../../lib/listing.js';
|
|
3
4
|
import { log } from '../../../log.js';
|
|
4
5
|
import { resolve_app_id } from '../resolve_app_id.js';
|
|
@@ -55,7 +56,7 @@ const trigger = {
|
|
|
55
56
|
if (result.deployment_id) {
|
|
56
57
|
log.info(`Follow the build: faable deploy logs --build -d ${result.deployment_id} -a ${app.id} --follow`);
|
|
57
58
|
}
|
|
58
|
-
log.info(`Track it with: faable deploy status -a ${app.id} · or in the dashboard:
|
|
59
|
+
log.info(`Track it with: faable deploy status -a ${app.id} · or in the dashboard: ${dashboardAppUrl(String(app.team), app.id)}`);
|
|
59
60
|
}
|
|
60
61
|
};
|
|
61
62
|
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { requireApi } from '../../api/context.js';
|
|
2
|
+
import { requireProject } from '../../api/project.js';
|
|
2
3
|
import { Configuration } from '../../lib/Configuration.js';
|
|
4
|
+
import { dashboardAppUrl } from '../../lib/dashboard_url.js';
|
|
3
5
|
import { CliError } from '../../lib/errors.js';
|
|
4
6
|
import { is_non_interactive, confirm } from '../../lib/interactive.js';
|
|
5
7
|
import { print_json } from '../../lib/listing.js';
|
|
6
8
|
import { log } from '../../log.js';
|
|
7
|
-
import {
|
|
9
|
+
import { assert_name_free } from './apps/name_free.js';
|
|
8
10
|
import { git_context } from './git_context.js';
|
|
9
11
|
import { show_deploy_help } from './help.js';
|
|
10
12
|
import { reachable_timeout_ms, wait_reachable } from './reachable.js';
|
|
11
13
|
import { propose_release } from './release_version.js';
|
|
12
|
-
import { assert_name_free } from './apps/name_free.js';
|
|
13
14
|
import { deploy_remote } from './remote/index.js';
|
|
14
15
|
import { collect_manifest } from './remote/manifest.js';
|
|
15
16
|
import { find_app_id } from './resolve_app_id.js';
|
|
@@ -142,7 +143,10 @@ const launch = {
|
|
|
142
143
|
// Propose the release version (--release > FAABLE_RELEASE > git tag).
|
|
143
144
|
// Optional: when absent the platform injects no FAABLE_RELEASE and the
|
|
144
145
|
// app falls back to its own version source.
|
|
145
|
-
const proposed = await propose_release({
|
|
146
|
+
const proposed = await propose_release({
|
|
147
|
+
workdir,
|
|
148
|
+
explicit: args.release
|
|
149
|
+
});
|
|
146
150
|
if (proposed) {
|
|
147
151
|
log.info(`🏷️ Release: ${proposed.release} (from ${proposed.source})`);
|
|
148
152
|
}
|
|
@@ -165,7 +169,7 @@ const launch = {
|
|
|
165
169
|
deployment_started = true;
|
|
166
170
|
}
|
|
167
171
|
});
|
|
168
|
-
const dashboard_url =
|
|
172
|
+
const dashboard_url = dashboardAppUrl(String(app.team), app.id);
|
|
169
173
|
log.info(`Preparing to deploy in faable cloud · ${deployment.id}`);
|
|
170
174
|
log.info(`📊 View it in the dashboard -> ${dashboard_url}`);
|
|
171
175
|
// Wait (up to 5 minutes) for the deployment to be promoted (live)
|
|
@@ -253,7 +257,10 @@ const launch = {
|
|
|
253
257
|
phase: failure.phase,
|
|
254
258
|
reason: failure.reason,
|
|
255
259
|
...(fault
|
|
256
|
-
? {
|
|
260
|
+
? {
|
|
261
|
+
fault_owner: fault.fault_owner,
|
|
262
|
+
error_code: fault.error_code
|
|
263
|
+
}
|
|
257
264
|
: {})
|
|
258
265
|
}
|
|
259
266
|
: {}),
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Dashboard links to an app, in the canonical `project_` form.
|
|
2
|
+
//
|
|
3
|
+
// The api returns `app.team` as `team_<hex>`. The dashboard accepts it, but a
|
|
4
|
+
// session that lands on a `team_` URL keeps navigating with it and pays a 400
|
|
5
|
+
// on `/project-favorites/recents` each time — so links leave as `project_`
|
|
6
|
+
// (same rule as the api's emails, arch backlog §387).
|
|
7
|
+
const DASHBOARD = 'https://dashboard.faable.com';
|
|
8
|
+
const toProjectId = (team) => team.replace(/^team_/, 'project_');
|
|
9
|
+
const dashboardAppUrl = (team, app_id) => `${DASHBOARD}/deploy/${toProjectId(team)}/app/${app_id}`;
|
|
10
|
+
|
|
11
|
+
export { dashboardAppUrl, toProjectId };
|