@scalebun-release/cli 2.5.0
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.
- package/bin/scalebun.js +2 -0
- package/lib/api/client.d.ts +52 -0
- package/lib/api/client.d.ts.map +1 -0
- package/lib/api/client.js +335 -0
- package/lib/api/client.js.map +1 -0
- package/lib/commands/ci-init.d.ts +3 -0
- package/lib/commands/ci-init.d.ts.map +1 -0
- package/lib/commands/ci-init.js +348 -0
- package/lib/commands/ci-init.js.map +1 -0
- package/lib/commands/doctor.d.ts +31 -0
- package/lib/commands/doctor.d.ts.map +1 -0
- package/lib/commands/doctor.js +559 -0
- package/lib/commands/doctor.js.map +1 -0
- package/lib/commands/launch.d.ts +3 -0
- package/lib/commands/launch.d.ts.map +1 -0
- package/lib/commands/launch.js +23 -0
- package/lib/commands/launch.js.map +1 -0
- package/lib/commands/link.d.ts +16 -0
- package/lib/commands/link.d.ts.map +1 -0
- package/lib/commands/link.js +164 -0
- package/lib/commands/link.js.map +1 -0
- package/lib/commands/login.d.ts +12 -0
- package/lib/commands/login.d.ts.map +1 -0
- package/lib/commands/login.js +124 -0
- package/lib/commands/login.js.map +1 -0
- package/lib/commands/migrate-codepush.d.ts +13 -0
- package/lib/commands/migrate-codepush.d.ts.map +1 -0
- package/lib/commands/migrate-codepush.js +98 -0
- package/lib/commands/migrate-codepush.js.map +1 -0
- package/lib/commands/ota-bundle.d.ts +22 -0
- package/lib/commands/ota-bundle.d.ts.map +1 -0
- package/lib/commands/ota-bundle.js +253 -0
- package/lib/commands/ota-bundle.js.map +1 -0
- package/lib/commands/ota-channels.d.ts +3 -0
- package/lib/commands/ota-channels.d.ts.map +1 -0
- package/lib/commands/ota-channels.js +231 -0
- package/lib/commands/ota-channels.js.map +1 -0
- package/lib/commands/ota-delete-bundle.d.ts +16 -0
- package/lib/commands/ota-delete-bundle.d.ts.map +1 -0
- package/lib/commands/ota-delete-bundle.js +96 -0
- package/lib/commands/ota-delete-bundle.js.map +1 -0
- package/lib/commands/ota-inspect.d.ts +3 -0
- package/lib/commands/ota-inspect.d.ts.map +1 -0
- package/lib/commands/ota-inspect.js +258 -0
- package/lib/commands/ota-inspect.js.map +1 -0
- package/lib/commands/ota-keys.d.ts +91 -0
- package/lib/commands/ota-keys.d.ts.map +1 -0
- package/lib/commands/ota-keys.js +765 -0
- package/lib/commands/ota-keys.js.map +1 -0
- package/lib/commands/ota-promote.d.ts +3 -0
- package/lib/commands/ota-promote.d.ts.map +1 -0
- package/lib/commands/ota-promote.js +194 -0
- package/lib/commands/ota-promote.js.map +1 -0
- package/lib/commands/ota-publish.d.ts +26 -0
- package/lib/commands/ota-publish.d.ts.map +1 -0
- package/lib/commands/ota-publish.js +892 -0
- package/lib/commands/ota-publish.js.map +1 -0
- package/lib/commands/ota-rollout.d.ts +3 -0
- package/lib/commands/ota-rollout.d.ts.map +1 -0
- package/lib/commands/ota-rollout.js +265 -0
- package/lib/commands/ota-rollout.js.map +1 -0
- package/lib/commands/ota-sign.d.ts +19 -0
- package/lib/commands/ota-sign.d.ts.map +1 -0
- package/lib/commands/ota-sign.js +245 -0
- package/lib/commands/ota-sign.js.map +1 -0
- package/lib/commands/push-apns.d.ts +3 -0
- package/lib/commands/push-apns.d.ts.map +1 -0
- package/lib/commands/push-apns.js +166 -0
- package/lib/commands/push-apns.js.map +1 -0
- package/lib/commands/quickstart.d.ts +4 -0
- package/lib/commands/quickstart.d.ts.map +1 -0
- package/lib/commands/quickstart.js +672 -0
- package/lib/commands/quickstart.js.map +1 -0
- package/lib/commands/shell.d.ts +28 -0
- package/lib/commands/shell.d.ts.map +1 -0
- package/lib/commands/shell.js +512 -0
- package/lib/commands/shell.js.map +1 -0
- package/lib/commands/tls-pins.d.ts +27 -0
- package/lib/commands/tls-pins.d.ts.map +1 -0
- package/lib/commands/tls-pins.js +209 -0
- package/lib/commands/tls-pins.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +233 -0
- package/lib/index.js.map +1 -0
- package/lib/ui/banner.d.ts +23 -0
- package/lib/ui/banner.d.ts.map +1 -0
- package/lib/ui/banner.js +162 -0
- package/lib/ui/banner.js.map +1 -0
- package/lib/ui/graphics.d.ts +18 -0
- package/lib/ui/graphics.d.ts.map +1 -0
- package/lib/ui/graphics.js +134 -0
- package/lib/ui/graphics.js.map +1 -0
- package/lib/ui/mark.d.ts +4 -0
- package/lib/ui/mark.d.ts.map +1 -0
- package/lib/ui/mark.js +21 -0
- package/lib/ui/mark.js.map +1 -0
- package/lib/ui/menu.d.ts +109 -0
- package/lib/ui/menu.d.ts.map +1 -0
- package/lib/ui/menu.js +314 -0
- package/lib/ui/menu.js.map +1 -0
- package/lib/ui/sixel.d.ts +6 -0
- package/lib/ui/sixel.d.ts.map +1 -0
- package/lib/ui/sixel.js +9 -0
- package/lib/ui/sixel.js.map +1 -0
- package/lib/utils/apps.d.ts +29 -0
- package/lib/utils/apps.d.ts.map +1 -0
- package/lib/utils/apps.js +19 -0
- package/lib/utils/apps.js.map +1 -0
- package/lib/utils/browser.d.ts +9 -0
- package/lib/utils/browser.d.ts.map +1 -0
- package/lib/utils/browser.js +39 -0
- package/lib/utils/browser.js.map +1 -0
- package/lib/utils/bundle.d.ts +153 -0
- package/lib/utils/bundle.d.ts.map +1 -0
- package/lib/utils/bundle.js +459 -0
- package/lib/utils/bundle.js.map +1 -0
- package/lib/utils/bundleStore.d.ts +128 -0
- package/lib/utils/bundleStore.d.ts.map +1 -0
- package/lib/utils/bundleStore.js +250 -0
- package/lib/utils/bundleStore.js.map +1 -0
- package/lib/utils/context.d.ts +88 -0
- package/lib/utils/context.d.ts.map +1 -0
- package/lib/utils/context.js +247 -0
- package/lib/utils/context.js.map +1 -0
- package/lib/utils/credentials.d.ts +59 -0
- package/lib/utils/credentials.d.ts.map +1 -0
- package/lib/utils/credentials.js +147 -0
- package/lib/utils/credentials.js.map +1 -0
- package/lib/utils/guide.d.ts +63 -0
- package/lib/utils/guide.d.ts.map +1 -0
- package/lib/utils/guide.js +191 -0
- package/lib/utils/guide.js.map +1 -0
- package/lib/utils/hash.d.ts +3 -0
- package/lib/utils/hash.d.ts.map +1 -0
- package/lib/utils/hash.js +44 -0
- package/lib/utils/hash.js.map +1 -0
- package/lib/utils/native-id.d.ts +17 -0
- package/lib/utils/native-id.d.ts.map +1 -0
- package/lib/utils/native-id.js +105 -0
- package/lib/utils/native-id.js.map +1 -0
- package/lib/utils/output.d.ts +96 -0
- package/lib/utils/output.d.ts.map +1 -0
- package/lib/utils/output.js +135 -0
- package/lib/utils/output.js.map +1 -0
- package/lib/utils/prompt.d.ts +106 -0
- package/lib/utils/prompt.d.ts.map +1 -0
- package/lib/utils/prompt.js +457 -0
- package/lib/utils/prompt.js.map +1 -0
- package/lib/utils/provenance.d.ts +30 -0
- package/lib/utils/provenance.d.ts.map +1 -0
- package/lib/utils/provenance.js +157 -0
- package/lib/utils/provenance.js.map +1 -0
- package/lib/utils/resolve.d.ts +81 -0
- package/lib/utils/resolve.d.ts.map +1 -0
- package/lib/utils/resolve.js +139 -0
- package/lib/utils/resolve.js.map +1 -0
- package/lib/utils/sdkBin.d.ts +18 -0
- package/lib/utils/sdkBin.d.ts.map +1 -0
- package/lib/utils/sdkBin.js +76 -0
- package/lib/utils/sdkBin.js.map +1 -0
- package/lib/utils/signer.d.ts +94 -0
- package/lib/utils/signer.d.ts.map +1 -0
- package/lib/utils/signer.js +230 -0
- package/lib/utils/signer.js.map +1 -0
- package/lib/utils/signing.d.ts +102 -0
- package/lib/utils/signing.d.ts.map +1 -0
- package/lib/utils/signing.js +229 -0
- package/lib/utils/signing.js.map +1 -0
- package/lib/utils/transportSecurity.d.ts +36 -0
- package/lib/utils/transportSecurity.d.ts.map +1 -0
- package/lib/utils/transportSecurity.js +74 -0
- package/lib/utils/transportSecurity.js.map +1 -0
- package/lib/utils/trustAnchor.d.ts +109 -0
- package/lib/utils/trustAnchor.d.ts.map +1 -0
- package/lib/utils/trustAnchor.js +169 -0
- package/lib/utils/trustAnchor.js.map +1 -0
- package/lib/utils/ui.d.ts +12 -0
- package/lib/utils/ui.d.ts.map +1 -0
- package/lib/utils/ui.js +60 -0
- package/lib/utils/ui.js.map +1 -0
- package/lib/utils/validate.d.ts +62 -0
- package/lib/utils/validate.d.ts.map +1 -0
- package/lib/utils/validate.js +189 -0
- package/lib/utils/validate.js.map +1 -0
- package/lib/vendor/ota-protocol/base64.d.ts +11 -0
- package/lib/vendor/ota-protocol/base64.d.ts.map +1 -0
- package/lib/vendor/ota-protocol/base64.js +39 -0
- package/lib/vendor/ota-protocol/base64.js.map +1 -0
- package/lib/vendor/ota-protocol/codec.d.ts +26 -0
- package/lib/vendor/ota-protocol/codec.d.ts.map +1 -0
- package/lib/vendor/ota-protocol/codec.js +349 -0
- package/lib/vendor/ota-protocol/codec.js.map +1 -0
- package/lib/vendor/ota-protocol/hex.d.ts +8 -0
- package/lib/vendor/ota-protocol/hex.d.ts.map +1 -0
- package/lib/vendor/ota-protocol/hex.js +31 -0
- package/lib/vendor/ota-protocol/hex.js.map +1 -0
- package/lib/vendor/ota-protocol/index.d.ts +17 -0
- package/lib/vendor/ota-protocol/index.d.ts.map +1 -0
- package/lib/vendor/ota-protocol/index.js +41 -0
- package/lib/vendor/ota-protocol/index.js.map +1 -0
- package/lib/vendor/ota-protocol/limits.d.ts +39 -0
- package/lib/vendor/ota-protocol/limits.d.ts.map +1 -0
- package/lib/vendor/ota-protocol/limits.js +42 -0
- package/lib/vendor/ota-protocol/limits.js.map +1 -0
- package/lib/vendor/ota-protocol/types.d.ts +73 -0
- package/lib/vendor/ota-protocol/types.d.ts.map +1 -0
- package/lib/vendor/ota-protocol/types.js +24 -0
- package/lib/vendor/ota-protocol/types.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.registerCiInitCommand = registerCiInitCommand;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const credentials_1 = require("../utils/credentials");
|
|
40
|
+
const client_1 = require("../api/client");
|
|
41
|
+
const resolve_1 = require("../utils/resolve");
|
|
42
|
+
/**
|
|
43
|
+
* `scalebun ci init` — generate working CI/CD pipelines for OTA publishing.
|
|
44
|
+
*
|
|
45
|
+
* Credentials in CI are environment variables, no login step:
|
|
46
|
+
* SCALEBUN_API_TOKEN a personal access token (scalebun_pat_…) — create one in
|
|
47
|
+
* the dashboard (OTA Settings → Access Tokens) or via
|
|
48
|
+
* `scalebun login` locally and copy from the output.
|
|
49
|
+
* (SCALEBUN_TOKEN is still accepted for back-compat.)
|
|
50
|
+
* SCALEBUN_API_URL optional — defaults to https://api.scalebun.com/api/v1
|
|
51
|
+
* (only set it to target a self-hosted backend).
|
|
52
|
+
*
|
|
53
|
+
* Signing (a signature-enforcing app) also reads, straight from the env:
|
|
54
|
+
* SCALEBUN_SIGNING_PRIVATE_KEY RSA private-key PEM — signs in the runner,
|
|
55
|
+
* never sent to ScaleBun
|
|
56
|
+
* SCALEBUN_SIGNING_KEY_PASSPHRASE passphrase, only if the key is encrypted
|
|
57
|
+
* SCALEBUN_KEY_ID the signing key id
|
|
58
|
+
*
|
|
59
|
+
* `readCredentials()` + `resolveSigningMaterial()` pick these up automatically, so
|
|
60
|
+
* every command that works locally works headless: publish, rollout, pause,
|
|
61
|
+
* rollback — signed, with no key file written in CI.
|
|
62
|
+
*/
|
|
63
|
+
const GITHUB_ACTIONS_WORKFLOW = `name: Scalebun OTA
|
|
64
|
+
|
|
65
|
+
on:
|
|
66
|
+
push:
|
|
67
|
+
branches: [main]
|
|
68
|
+
# Manual controls from the Actions tab — staged rollout without a laptop.
|
|
69
|
+
workflow_dispatch:
|
|
70
|
+
inputs:
|
|
71
|
+
action:
|
|
72
|
+
description: What to do
|
|
73
|
+
type: choice
|
|
74
|
+
options: [publish, rollout, pause, rollback]
|
|
75
|
+
default: publish
|
|
76
|
+
percent:
|
|
77
|
+
description: Rollout percent (rollout action only)
|
|
78
|
+
default: '100'
|
|
79
|
+
|
|
80
|
+
env:
|
|
81
|
+
# Add these as repository secrets (Settings -> Secrets and variables -> Actions).
|
|
82
|
+
# SCALEBUN_API_TOKEN is a scalebun_pat_... token from the dashboard (OTA Settings
|
|
83
|
+
# -> Access Tokens). Session JWTs expire in minutes - always use a PAT here.
|
|
84
|
+
SCALEBUN_API_TOKEN: \${{ secrets.SCALEBUN_API_TOKEN }}
|
|
85
|
+
SCALEBUN_APP_ID: \${{ secrets.SCALEBUN_APP_ID }}
|
|
86
|
+
# Signing — the private key signs locally in the runner and NEVER reaches
|
|
87
|
+
# ScaleBun; only the signature it produces is uploaded. A signature-enforcing
|
|
88
|
+
# app rejects unsigned releases, so --require-signing below fails the job rather
|
|
89
|
+
# than shipping a release no device will install. Omit these three for an
|
|
90
|
+
# unsigned (SHA-256-only) app.
|
|
91
|
+
SCALEBUN_SIGNING_PRIVATE_KEY: \${{ secrets.SCALEBUN_SIGNING_PRIVATE_KEY }}
|
|
92
|
+
SCALEBUN_SIGNING_KEY_PASSPHRASE: \${{ secrets.SCALEBUN_SIGNING_KEY_PASSPHRASE }}
|
|
93
|
+
SCALEBUN_KEY_ID: \${{ secrets.SCALEBUN_KEY_ID }}
|
|
94
|
+
# Required by --sourcemap: without it the map uploads but is never
|
|
95
|
+
# registered for symbolication, so production stack traces stay minified.
|
|
96
|
+
SCALEBUN_SDK_SECRET: \${{ secrets.SCALEBUN_SDK_SECRET }}
|
|
97
|
+
|
|
98
|
+
jobs:
|
|
99
|
+
ota:
|
|
100
|
+
runs-on: ubuntu-latest
|
|
101
|
+
steps:
|
|
102
|
+
- uses: actions/checkout@v4
|
|
103
|
+
|
|
104
|
+
- uses: actions/setup-node@v4
|
|
105
|
+
with:
|
|
106
|
+
node-version: 20
|
|
107
|
+
cache: npm
|
|
108
|
+
|
|
109
|
+
- name: Install dependencies
|
|
110
|
+
run: npm ci
|
|
111
|
+
|
|
112
|
+
# ── Publish (push to main, or manual "publish") ──────────────────────
|
|
113
|
+
# Starts at 10%, NOT 100: a staged rollout is the whole point of OTA.
|
|
114
|
+
# Widen it with the manual "rollout" action once health looks clean.
|
|
115
|
+
# NOTE: the channel must already exist - a typo'd channel name is
|
|
116
|
+
# rejected rather than silently created.
|
|
117
|
+
- name: Publish OTA update
|
|
118
|
+
if: github.event_name == 'push' || inputs.action == 'publish'
|
|
119
|
+
# The commit message is UNTRUSTED input. Interpolating \${{ }} straight
|
|
120
|
+
# into run: splices it into the shell — a message with a quote breaks the
|
|
121
|
+
# job, and one with ";cmd;" executes with SCALEBUN_API_TOKEN in scope.
|
|
122
|
+
# Passing it through env keeps it data.
|
|
123
|
+
env:
|
|
124
|
+
COMMIT_MESSAGE: \${{ github.event.head_commit.message || 'Manual publish' }}
|
|
125
|
+
run: |
|
|
126
|
+
npx scalebun ota publish \\
|
|
127
|
+
--app-id "$SCALEBUN_APP_ID" \\
|
|
128
|
+
--channel production \\
|
|
129
|
+
--platform android \\
|
|
130
|
+
--hermes \\
|
|
131
|
+
--sourcemap \\
|
|
132
|
+
--require-signing \\
|
|
133
|
+
--rollout 10 \\
|
|
134
|
+
--release-note "$COMMIT_MESSAGE"
|
|
135
|
+
|
|
136
|
+
# ── Manual controls ──────────────────────────────────────────────────
|
|
137
|
+
- name: Widen rollout
|
|
138
|
+
if: inputs.action == 'rollout'
|
|
139
|
+
# Same rule as COMMIT_MESSAGE above: workflow inputs are attacker-typed
|
|
140
|
+
# strings, and \${{ }} inside run: splices them into the shell with
|
|
141
|
+
# SCALEBUN_API_TOKEN in scope. env keeps the value data. (The CLI validates
|
|
142
|
+
# 0-100 anyway, but validation there is no reason to splice here.)
|
|
143
|
+
env:
|
|
144
|
+
ROLLOUT_PERCENT: \${{ inputs.percent }}
|
|
145
|
+
run: npx scalebun ota rollout --app-id "$SCALEBUN_APP_ID" --percent "$ROLLOUT_PERCENT"
|
|
146
|
+
|
|
147
|
+
- name: Pause release
|
|
148
|
+
if: inputs.action == 'pause'
|
|
149
|
+
run: npx scalebun ota pause --app-id "$SCALEBUN_APP_ID"
|
|
150
|
+
|
|
151
|
+
- name: Roll back release
|
|
152
|
+
if: inputs.action == 'rollback'
|
|
153
|
+
run: npx scalebun ota rollback --app-id "$SCALEBUN_APP_ID" --yes
|
|
154
|
+
`;
|
|
155
|
+
const GITLAB_CI_TEMPLATE = `# Scalebun OTA — GitLab CI
|
|
156
|
+
#
|
|
157
|
+
# Set these CI/CD variables (Settings -> CI/CD -> Variables):
|
|
158
|
+
# SCALEBUN_API_TOKEN scalebun_pat_... (dashboard -> OTA Settings -> Access Tokens)
|
|
159
|
+
# SCALEBUN_APP_ID your application id
|
|
160
|
+
# SCALEBUN_SIGNING_PRIVATE_KEY RSA private-key PEM — signs locally, never sent to ScaleBun
|
|
161
|
+
# SCALEBUN_SIGNING_KEY_PASSPHRASE passphrase for the key (only if it is encrypted)
|
|
162
|
+
# SCALEBUN_KEY_ID the signing key id
|
|
163
|
+
#
|
|
164
|
+
# Session JWTs expire in minutes - always use a scalebun_pat_... token in CI.
|
|
165
|
+
# For an unsigned (SHA-256-only) app, omit the three SIGNING_/KEY_ID vars and
|
|
166
|
+
# drop --require-signing below.
|
|
167
|
+
|
|
168
|
+
stages: [ota]
|
|
169
|
+
|
|
170
|
+
.ota-base:
|
|
171
|
+
stage: ota
|
|
172
|
+
image: node:20
|
|
173
|
+
before_script:
|
|
174
|
+
- npm ci
|
|
175
|
+
|
|
176
|
+
# Publishes on every push to the default branch, staged at 10%.
|
|
177
|
+
ota-publish:
|
|
178
|
+
extends: .ota-base
|
|
179
|
+
rules:
|
|
180
|
+
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
181
|
+
script:
|
|
182
|
+
- npx scalebun ota publish
|
|
183
|
+
--app-id "$SCALEBUN_APP_ID"
|
|
184
|
+
--channel production
|
|
185
|
+
--platform android
|
|
186
|
+
--hermes
|
|
187
|
+
--sourcemap
|
|
188
|
+
--require-signing
|
|
189
|
+
--rollout 10
|
|
190
|
+
--release-note "$CI_COMMIT_TITLE"
|
|
191
|
+
|
|
192
|
+
# Manual jobs — run from the pipeline UI once health looks clean (or bad).
|
|
193
|
+
ota-rollout-100:
|
|
194
|
+
extends: .ota-base
|
|
195
|
+
rules: [{ when: manual }]
|
|
196
|
+
script:
|
|
197
|
+
- npx scalebun ota rollout --app-id "$SCALEBUN_APP_ID" --percent 100
|
|
198
|
+
|
|
199
|
+
ota-pause:
|
|
200
|
+
extends: .ota-base
|
|
201
|
+
rules: [{ when: manual }]
|
|
202
|
+
script:
|
|
203
|
+
- npx scalebun ota pause --app-id "$SCALEBUN_APP_ID"
|
|
204
|
+
|
|
205
|
+
ota-rollback:
|
|
206
|
+
extends: .ota-base
|
|
207
|
+
rules: [{ when: manual }]
|
|
208
|
+
script:
|
|
209
|
+
- npx scalebun ota rollback --app-id "$SCALEBUN_APP_ID" --yes
|
|
210
|
+
`;
|
|
211
|
+
async function fetchSetup(appIdOpt) {
|
|
212
|
+
const creds = (0, credentials_1.readCredentials)();
|
|
213
|
+
if (!creds)
|
|
214
|
+
return null;
|
|
215
|
+
try {
|
|
216
|
+
const appId = await (0, resolve_1.resolveAppId)({ appId: appIdOpt, nonInteractive: true });
|
|
217
|
+
const api = new client_1.ApiClient(creds);
|
|
218
|
+
return await api.get(`/saas/apps/${appId}/ota/ci-setup`);
|
|
219
|
+
}
|
|
220
|
+
catch {
|
|
221
|
+
// Every failure here is recoverable: the caller falls back to the local
|
|
222
|
+
// template. Nothing about setting up CI should require the network.
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function channelNames(setup) {
|
|
227
|
+
return (setup.channels ?? [])
|
|
228
|
+
.map((c) => (typeof c === 'string' ? c : c?.name ?? ''))
|
|
229
|
+
.filter(Boolean);
|
|
230
|
+
}
|
|
231
|
+
function printSetupFacts(setup) {
|
|
232
|
+
console.log('');
|
|
233
|
+
console.log(` Rendered for ${setup.appName} (${setup.appId})`);
|
|
234
|
+
const plats = setup.platforms?.length ? setup.platforms.join(', ') : 'none published yet';
|
|
235
|
+
const chans = channelNames(setup);
|
|
236
|
+
console.log(` Platforms ${plats}`);
|
|
237
|
+
console.log(` Channels ${chans.length ? chans.join(', ') : 'none yet — create one before the first run'}`);
|
|
238
|
+
if (setup.secrets?.length) {
|
|
239
|
+
console.log('');
|
|
240
|
+
console.log(' Secrets to add to your CI:');
|
|
241
|
+
for (const sec of setup.secrets) {
|
|
242
|
+
// A value the server legitimately knows is printed so it can be pasted;
|
|
243
|
+
// a token is never echoed by this endpoint and is not invented here.
|
|
244
|
+
const rhs = sec.value ? sec.value : 'you supply this';
|
|
245
|
+
console.log(` ${sec.name.padEnd(20)} ${rhs}`);
|
|
246
|
+
if (sec.why)
|
|
247
|
+
console.log(` ${' '.repeat(20)} ${sec.why}`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
function writeTemplate(targetPath, content) {
|
|
252
|
+
if (fs.existsSync(targetPath)) {
|
|
253
|
+
console.error(`❌ ${path.relative(process.cwd(), targetPath)} already exists — refusing to overwrite.\n` +
|
|
254
|
+
' Delete it first if you want a fresh template.');
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
fs.mkdirSync(path.dirname(targetPath), { recursive: true });
|
|
258
|
+
fs.writeFileSync(targetPath, content, 'utf-8');
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
261
|
+
function printNextSteps(provider, file) {
|
|
262
|
+
console.log(`✅ ${provider} pipeline generated: ${file}`);
|
|
263
|
+
console.log('');
|
|
264
|
+
console.log('Next steps:');
|
|
265
|
+
console.log(' 1. Create an access token: dashboard → Settings → Access Tokens');
|
|
266
|
+
console.log(' (or run `scalebun login` locally and copy the scalebun_pat_… it prints)');
|
|
267
|
+
console.log(' 2. Add these CI secrets: SCALEBUN_API_TOKEN, SCALEBUN_APP_ID,');
|
|
268
|
+
console.log(' and (for a signed app) SCALEBUN_SIGNING_PRIVATE_KEY, SCALEBUN_KEY_ID');
|
|
269
|
+
console.log(' (+ SCALEBUN_SIGNING_KEY_PASSPHRASE if the key is encrypted).');
|
|
270
|
+
console.log(' 3. Make sure the target channel exists (`scalebun ota channels --app-id <id>`).');
|
|
271
|
+
console.log(' 4. Push — the release goes out staged at 10%; widen it from the CI UI.');
|
|
272
|
+
}
|
|
273
|
+
function registerCiInitCommand(program) {
|
|
274
|
+
const ci = program.command('ci').description('CI/CD integration setup');
|
|
275
|
+
ci.command('init')
|
|
276
|
+
.description('Generate a CI/CD pipeline for OTA publishing (publish / rollout / pause / rollback)')
|
|
277
|
+
.option('--provider <name>', 'CI provider: github | gitlab', 'github')
|
|
278
|
+
.option('--app-id <id>', 'Scalebun app ID (resolved from scalebun.json when omitted)')
|
|
279
|
+
.option('--offline', 'Skip the server and write the generic template')
|
|
280
|
+
.action(async (opts) => {
|
|
281
|
+
const provider = opts.provider.toLowerCase();
|
|
282
|
+
// Ask the server for a workflow that knows this app's real platforms and
|
|
283
|
+
// channels. Falls back silently — see fetchSetup.
|
|
284
|
+
const setup = opts.offline ? null : await fetchSetup(opts.appId);
|
|
285
|
+
if (provider === 'github') {
|
|
286
|
+
const target = path.join(process.cwd(), '.github', 'workflows', 'scalebun-ota.yml');
|
|
287
|
+
const rendered = setup?.workflow?.content;
|
|
288
|
+
if (rendered) {
|
|
289
|
+
const at = setup?.workflow?.path
|
|
290
|
+
? path.join(process.cwd(), setup.workflow.path)
|
|
291
|
+
: target;
|
|
292
|
+
if (!writeTemplate(at, rendered))
|
|
293
|
+
process.exit(1);
|
|
294
|
+
console.log(`✅ GitHub Actions pipeline generated: ${path.relative(process.cwd(), at)}`);
|
|
295
|
+
printSetupFacts(setup);
|
|
296
|
+
console.log('');
|
|
297
|
+
console.log('Next steps:');
|
|
298
|
+
console.log(' 1. Create an access token: dashboard → Settings → Access Tokens');
|
|
299
|
+
console.log(' (or run `scalebun login` locally and copy the scalebun_pat_… it prints)');
|
|
300
|
+
console.log(' 2. Add the secrets above to your repository.');
|
|
301
|
+
console.log(' 3. Push — the workflow publishes, then rollout / pause / rollback run on demand.');
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
if (writeTemplate(target, GITHUB_ACTIONS_WORKFLOW)) {
|
|
305
|
+
printNextSteps('GitHub Actions', path.relative(process.cwd(), target));
|
|
306
|
+
// Say WHICH pipeline this is. A generic template that silently claims
|
|
307
|
+
// to be app-specific is how you end up publishing to a channel that
|
|
308
|
+
// does not exist and blaming the CLI.
|
|
309
|
+
console.log('');
|
|
310
|
+
console.log(' ℹ️ Generic template — the channel and platform in it are defaults,');
|
|
311
|
+
console.log(" not this app's. Sign in and re-run for one rendered from your");
|
|
312
|
+
console.log(' real channels and platforms.');
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
process.exit(1);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
else if (provider === 'gitlab') {
|
|
319
|
+
const target = path.join(process.cwd(), '.gitlab-ci.scalebun-ota.yml');
|
|
320
|
+
if (writeTemplate(target, GITLAB_CI_TEMPLATE)) {
|
|
321
|
+
printNextSteps('GitLab CI', path.relative(process.cwd(), target));
|
|
322
|
+
console.log('');
|
|
323
|
+
console.log(" Include it from your .gitlab-ci.yml:");
|
|
324
|
+
console.log(" include:");
|
|
325
|
+
console.log(" - local: .gitlab-ci.scalebun-ota.yml");
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
process.exit(1);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
// Any other system: the commands are plain npx calls over env-var
|
|
333
|
+
// credentials, so print the recipe instead of pretending to support it.
|
|
334
|
+
console.log(`ℹ️ No template for "${provider}" — but any CI works. Set these env vars:`);
|
|
335
|
+
console.log(' SCALEBUN_API_TOKEN (scalebun_pat_… from the dashboard)');
|
|
336
|
+
console.log(' SCALEBUN_SIGNING_PRIVATE_KEY (RSA private-key PEM — signed app only)');
|
|
337
|
+
console.log(' SCALEBUN_KEY_ID (the signing key id — signed app only)');
|
|
338
|
+
console.log(' SCALEBUN_SIGNING_KEY_PASSPHRASE (only if the key is encrypted)');
|
|
339
|
+
console.log('');
|
|
340
|
+
console.log(' Then script the commands directly:');
|
|
341
|
+
console.log(' npx scalebun ota publish --app-id $APP_ID --channel production --hermes --require-signing --rollout 10');
|
|
342
|
+
console.log(' npx scalebun ota rollout --app-id $APP_ID --percent 100');
|
|
343
|
+
console.log(' npx scalebun ota pause --app-id $APP_ID');
|
|
344
|
+
console.log(' npx scalebun ota rollback --app-id $APP_ID --yes');
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
//# sourceMappingURL=ci-init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci-init.js","sourceRoot":"","sources":["../../src/commands/ci-init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyRA,sDAwEC;AAjWD,uCAAyB;AACzB,2CAA6B;AAE7B,sDAAuD;AACvD,0CAA0C;AAC1C,8CAAgD;AAEhD;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2F/B,CAAC;AAEF,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuD1B,CAAC;AAsCF,KAAK,UAAU,UAAU,CAAC,QAAiB;IACzC,MAAM,KAAK,GAAG,IAAA,6BAAe,GAAE,CAAC;IAChC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,IAAA,sBAAY,EAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5E,MAAM,GAAG,GAAG,IAAI,kBAAS,CAAC,KAAK,CAAC,CAAC;QACjC,OAAO,MAAM,GAAG,CAAC,GAAG,CAAU,cAAc,KAAK,eAAe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OAAO,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;QACvE,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* iOS app sources that build the React host with a STATIC bundle URL.
|
|
4
|
+
*
|
|
5
|
+
* RCTHost DOES re-resolve on reload — `_reloadWithShouldRestartSurfaces` calls
|
|
6
|
+
* `_bundleURLProvider()` again — but only through the provider it was handed.
|
|
7
|
+
* `initWithBundleURL:` wraps a constant in a block returning that same constant
|
|
8
|
+
* forever (RCTRootViewFactory.mm), so a host built that way can never see a
|
|
9
|
+
* bundle that did not exist at launch.
|
|
10
|
+
*
|
|
11
|
+
* The symptom is precise and very confusing: the update downloads, verifies,
|
|
12
|
+
* applies, `restartApp()` runs, every OTA metric reports success — and the app
|
|
13
|
+
* comes back on the OLD bundle, while a cold start loads it correctly.
|
|
14
|
+
*
|
|
15
|
+
* Matched on whole-file text, not per line, because these initialisers are
|
|
16
|
+
* routinely wrapped across lines. Only the STATIC forms match:
|
|
17
|
+
* `initWithBundleURLBlock:` / `initWithBundleURLProvider:` / `bundleURLProvider:`
|
|
18
|
+
* are the dynamic ones, and the trailing colon keeps them out.
|
|
19
|
+
*/
|
|
20
|
+
export declare function findStaticHostConstruction(iosDir: string): {
|
|
21
|
+
file: string;
|
|
22
|
+
line: number;
|
|
23
|
+
text: string;
|
|
24
|
+
}[];
|
|
25
|
+
export declare function registerDoctorCommand(program: Command): void;
|
|
26
|
+
/**
|
|
27
|
+
* All doctor checks as a reusable step (`quickstart` runs it inline).
|
|
28
|
+
* Same contract as the command: exits the process on a blocking failure.
|
|
29
|
+
*/
|
|
30
|
+
export declare function runDoctor(): Promise<void>;
|
|
31
|
+
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+DpC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,GACb;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,CAiDhD;AAmFD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAM5D;AAED;;;GAGG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CA6X/C"}
|