@pwrdrvr/microapps-publish 0.0.20 → 0.0.24
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/run +5 -0
- package/dist/commands/nextjs-docker-auto.d.ts +42 -0
- package/dist/commands/nextjs-docker-auto.d.ts.map +1 -0
- package/dist/commands/nextjs-docker-auto.js +448 -0
- package/dist/commands/nextjs-docker-auto.js.map +1 -0
- package/dist/commands/nextjs-version-restore.d.ts +14 -0
- package/dist/commands/nextjs-version-restore.d.ts.map +1 -0
- package/dist/commands/nextjs-version-restore.js +57 -0
- package/dist/commands/nextjs-version-restore.js.map +1 -0
- package/dist/commands/nextjs-version.d.ts +16 -0
- package/dist/commands/nextjs-version.d.ts.map +1 -0
- package/dist/commands/nextjs-version.js +93 -0
- package/dist/commands/nextjs-version.js.map +1 -0
- package/dist/commands/preflight.d.ts +15 -0
- package/dist/commands/preflight.d.ts.map +1 -0
- package/dist/commands/preflight.js +111 -0
- package/dist/commands/preflight.js.map +1 -0
- package/dist/commands/publish-static.d.ts +18 -0
- package/dist/commands/publish-static.d.ts.map +1 -0
- package/dist/commands/publish-static.js +256 -0
- package/dist/commands/publish-static.js.map +1 -0
- package/dist/commands/publish.d.ts +25 -0
- package/dist/commands/publish.d.ts.map +1 -0
- package/dist/commands/publish.js +316 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/config/Config.d.ts +0 -2
- package/dist/config/Config.d.ts.map +1 -1
- package/dist/config/Config.js +0 -5
- package/dist/config/Config.js.map +1 -1
- package/dist/index.d.ts +1 -64
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -480
- package/dist/index.js.map +1 -1
- package/dist/{DeployClient.d.ts → lib/DeployClient.d.ts} +14 -6
- package/dist/lib/DeployClient.d.ts.map +1 -0
- package/dist/{DeployClient.js → lib/DeployClient.js} +17 -6
- package/dist/lib/DeployClient.js.map +1 -0
- package/dist/{S3TransferUtility.d.ts → lib/S3TransferUtility.d.ts} +0 -0
- package/dist/lib/S3TransferUtility.d.ts.map +1 -0
- package/dist/{S3TransferUtility.js → lib/S3TransferUtility.js} +0 -0
- package/dist/lib/S3TransferUtility.js.map +1 -0
- package/dist/{S3Uploader.d.ts → lib/S3Uploader.d.ts} +1 -1
- package/dist/lib/S3Uploader.d.ts.map +1 -0
- package/dist/{S3Uploader.js → lib/S3Uploader.js} +10 -10
- package/dist/lib/S3Uploader.js.map +1 -0
- package/dist/lib/Versions.d.ts +27 -0
- package/dist/lib/Versions.d.ts.map +1 -0
- package/dist/lib/Versions.js +76 -0
- package/dist/lib/Versions.js.map +1 -0
- package/package.json +11 -3
- package/src/commands/nextjs-docker-auto.ts +538 -0
- package/src/commands/nextjs-version-restore.ts +74 -0
- package/src/commands/nextjs-version.ts +114 -0
- package/src/commands/preflight.ts +122 -0
- package/src/commands/publish-static.ts +302 -0
- package/src/commands/publish.ts +381 -0
- package/src/config/Config.ts +0 -4
- package/src/index.ts +1 -596
- package/src/{DeployClient.ts → lib/DeployClient.ts} +24 -13
- package/src/{S3TransferUtility.ts → lib/S3TransferUtility.ts} +0 -0
- package/src/{S3Uploader.ts → lib/S3Uploader.ts} +3 -3
- package/src/lib/Versions.ts +95 -0
- package/dist/DeployClient.d.ts.map +0 -1
- package/dist/DeployClient.js.map +0 -1
- package/dist/S3TransferUtility.d.ts.map +0 -1
- package/dist/S3TransferUtility.js.map +0 -1
- package/dist/S3Uploader.d.ts.map +0 -1
- package/dist/S3Uploader.js.map +0 -1
- package/dist/config/FileStore.d.ts +0 -7
- package/dist/config/FileStore.d.ts.map +0 -1
- package/dist/config/FileStore.js +0 -17
- package/dist/config/FileStore.js.map +0 -1
- package/src/config/FileStore.ts +0 -14
package/bin/run
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { Command, flags as flagsParser } from '@oclif/command';
|
|
3
|
+
export declare class DockerAutoCommand extends Command {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
version: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
|
|
8
|
+
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
|
|
9
|
+
deployerLambdaName: flagsParser.IOptionFlag<string>;
|
|
10
|
+
newVersion: flagsParser.IOptionFlag<string>;
|
|
11
|
+
repoName: flagsParser.IOptionFlag<string>;
|
|
12
|
+
leaveCopy: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
13
|
+
appLambdaName: flagsParser.IOptionFlag<string>;
|
|
14
|
+
appName: flagsParser.IOptionFlag<string>;
|
|
15
|
+
staticAssetsPath: flagsParser.IOptionFlag<string>;
|
|
16
|
+
defaultFile: flagsParser.IOptionFlag<string>;
|
|
17
|
+
};
|
|
18
|
+
private VersionAndAlias;
|
|
19
|
+
private IMAGE_TAG;
|
|
20
|
+
private IMAGE_URI;
|
|
21
|
+
private FILES_TO_MODIFY;
|
|
22
|
+
private _restoreFilesStarted;
|
|
23
|
+
run(): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Login to ECR for Lambda Docker functions
|
|
26
|
+
* @param config
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
private loginToECR;
|
|
30
|
+
/**
|
|
31
|
+
* Publish to ECR for Lambda Docker function
|
|
32
|
+
* @param config
|
|
33
|
+
*/
|
|
34
|
+
private publishToECR;
|
|
35
|
+
/**
|
|
36
|
+
* Publish an app version to Lambda
|
|
37
|
+
* @param config
|
|
38
|
+
* @param versions
|
|
39
|
+
*/
|
|
40
|
+
private deployToLambda;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=nextjs-docker-auto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextjs-docker-auto.d.ts","sourceRoot":"","sources":["../../src/commands/nextjs-docker-auto.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAM1B,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAgC/D,qBAAa,iBAAkB,SAAQ,OAAO;IAC5C,MAAM,CAAC,WAAW,SACwF;IAE1G,MAAM,CAAC,QAAQ,WAeb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;MAuDV;IAEF,OAAO,CAAC,eAAe,CAAY;IACnC,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,oBAAoB,CAAS;IAE/B,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA8T1B;;;;OAIG;YACW,UAAU;IAexB;;;OAGG;YACW,YAAY;IAW1B;;;;OAIG;YACW,cAAc;CAyD7B"}
|
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DockerAutoCommand = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
require("reflect-metadata");
|
|
6
|
+
const child_process_1 = require("child_process");
|
|
7
|
+
const util = tslib_1.__importStar(require("util"));
|
|
8
|
+
const lambda = tslib_1.__importStar(require("@aws-sdk/client-lambda"));
|
|
9
|
+
const s3 = tslib_1.__importStar(require("@aws-sdk/client-s3"));
|
|
10
|
+
const sts = tslib_1.__importStar(require("@aws-sdk/client-sts"));
|
|
11
|
+
const command_1 = require("@oclif/command");
|
|
12
|
+
const path = tslib_1.__importStar(require("path"));
|
|
13
|
+
const fs_extra_1 = require("fs-extra");
|
|
14
|
+
const listr2_1 = require("listr2");
|
|
15
|
+
const Config_1 = require("../config/Config");
|
|
16
|
+
const DeployClient_1 = tslib_1.__importDefault(require("../lib/DeployClient"));
|
|
17
|
+
const S3Uploader_1 = tslib_1.__importDefault(require("../lib/S3Uploader"));
|
|
18
|
+
const S3TransferUtility_1 = tslib_1.__importDefault(require("../lib/S3TransferUtility"));
|
|
19
|
+
const lib_storage_1 = require("@aws-sdk/lib-storage");
|
|
20
|
+
const mime_types_1 = require("mime-types");
|
|
21
|
+
const Versions_1 = require("../lib/Versions");
|
|
22
|
+
const asyncSetTimeout = util.promisify(setTimeout);
|
|
23
|
+
const asyncExec = util.promisify(child_process_1.exec);
|
|
24
|
+
const lambdaClient = new lambda.LambdaClient({
|
|
25
|
+
maxAttempts: 8,
|
|
26
|
+
});
|
|
27
|
+
class DockerAutoCommand extends command_1.Command {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments);
|
|
30
|
+
this.IMAGE_TAG = '';
|
|
31
|
+
this.IMAGE_URI = '';
|
|
32
|
+
this._restoreFilesStarted = false;
|
|
33
|
+
}
|
|
34
|
+
async run() {
|
|
35
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
36
|
+
const config = Config_1.Config.instance;
|
|
37
|
+
// const RUNNING_TEXT = ' RUNS ';
|
|
38
|
+
// const RUNNING = chalk.reset.inverse.yellow.bold(RUNNING_TEXT) + ' ';
|
|
39
|
+
const RUNNING = ''; //chalk.reset.inverse.yellow.bold(RUNNING_TEXT) + ' ';
|
|
40
|
+
const { flags: parsedFlags } = this.parse(DockerAutoCommand);
|
|
41
|
+
const appLambdaName = (_a = parsedFlags.appLambdaName) !== null && _a !== void 0 ? _a : config.app.lambdaName;
|
|
42
|
+
const appName = (_b = parsedFlags.appName) !== null && _b !== void 0 ? _b : config.app.name;
|
|
43
|
+
const leaveFiles = parsedFlags.leaveCopy;
|
|
44
|
+
const deployerLambdaName = (_c = parsedFlags.deployerLambdaName) !== null && _c !== void 0 ? _c : config.deployer.lambdaName;
|
|
45
|
+
const semVer = (_d = parsedFlags.newVersion) !== null && _d !== void 0 ? _d : config.app.semVer;
|
|
46
|
+
const ecrRepo = (_e = parsedFlags.repoName) !== null && _e !== void 0 ? _e : config.app.ecrRepoName;
|
|
47
|
+
const staticAssetsPath = (_f = parsedFlags.staticAssetsPath) !== null && _f !== void 0 ? _f : config.app.staticAssetsPath;
|
|
48
|
+
const defaultFile = (_g = parsedFlags.defaultFile) !== null && _g !== void 0 ? _g : config.app.defaultFile;
|
|
49
|
+
// Override the config value
|
|
50
|
+
config.deployer.lambdaName = deployerLambdaName;
|
|
51
|
+
config.app.lambdaName = appLambdaName;
|
|
52
|
+
config.app.name = appName;
|
|
53
|
+
config.app.semVer = semVer;
|
|
54
|
+
config.app.staticAssetsPath = staticAssetsPath;
|
|
55
|
+
config.app.defaultFile = defaultFile;
|
|
56
|
+
// Get the account ID and region from STS
|
|
57
|
+
// TODO: Move this to the right place
|
|
58
|
+
if (config.app.awsAccountID === 0 || config.app.awsRegion === '') {
|
|
59
|
+
const stsClient = new sts.STSClient({
|
|
60
|
+
maxAttempts: 8,
|
|
61
|
+
});
|
|
62
|
+
const stsResponse = await stsClient.send(new sts.GetCallerIdentityCommand({}));
|
|
63
|
+
if (config.app.awsAccountID === 0) {
|
|
64
|
+
config.app.awsAccountID = parseInt(stsResponse.Account, 10);
|
|
65
|
+
}
|
|
66
|
+
if (config.app.awsRegion === '') {
|
|
67
|
+
config.app.awsRegion = stsClient.config.region;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (config.app.ecrHost === '') {
|
|
71
|
+
config.app.ecrHost = `${config.app.awsAccountID}.dkr.ecr.${config.app.awsRegion}.amazonaws.com`;
|
|
72
|
+
}
|
|
73
|
+
if (ecrRepo) {
|
|
74
|
+
config.app.ecrRepoName = ecrRepo;
|
|
75
|
+
}
|
|
76
|
+
else if (config.app.ecrRepoName === '') {
|
|
77
|
+
config.app.ecrRepoName = `microapps-app-${config.app.name}${Config_1.Config.envLevel}-repo`;
|
|
78
|
+
}
|
|
79
|
+
this.VersionAndAlias = Versions_1.createVersions(semVer);
|
|
80
|
+
const versionOnly = { version: this.VersionAndAlias.version };
|
|
81
|
+
this.FILES_TO_MODIFY = [
|
|
82
|
+
{ path: 'package.json', versions: versionOnly },
|
|
83
|
+
{ path: 'next.config.js', versions: versionOnly },
|
|
84
|
+
];
|
|
85
|
+
// Install handler to ensure that we restore files
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
87
|
+
process.on('SIGINT', async () => {
|
|
88
|
+
if (this._restoreFilesStarted) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
this._restoreFilesStarted = true;
|
|
93
|
+
}
|
|
94
|
+
this.log('Caught Ctrl-C, restoring files');
|
|
95
|
+
await S3Uploader_1.default.removeTempDirIfExists();
|
|
96
|
+
await Versions_1.restoreFiles(this.FILES_TO_MODIFY);
|
|
97
|
+
});
|
|
98
|
+
if (config === undefined) {
|
|
99
|
+
this.error('Failed to load the config file');
|
|
100
|
+
}
|
|
101
|
+
if (config.app.staticAssetsPath === undefined) {
|
|
102
|
+
this.error('StaticAssetsPath must be specified in the config file');
|
|
103
|
+
}
|
|
104
|
+
//
|
|
105
|
+
// Setup Tasks
|
|
106
|
+
//
|
|
107
|
+
const tasks = new listr2_1.Listr([
|
|
108
|
+
{
|
|
109
|
+
title: 'Logging into ECR',
|
|
110
|
+
task: async (ctx, task) => {
|
|
111
|
+
const origTitle = task.title;
|
|
112
|
+
task.title = RUNNING + origTitle;
|
|
113
|
+
await this.loginToECR(config);
|
|
114
|
+
task.title = origTitle;
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
title: 'Modifying Config Files',
|
|
119
|
+
task: async (ctx, task) => {
|
|
120
|
+
const origTitle = task.title;
|
|
121
|
+
task.title = RUNNING + origTitle;
|
|
122
|
+
// Modify the existing files with the new version
|
|
123
|
+
for (const fileToModify of this.FILES_TO_MODIFY) {
|
|
124
|
+
task.output = `Patching version (${this.VersionAndAlias.version}) into ${fileToModify.path}`;
|
|
125
|
+
if (!(await Versions_1.writeNewVersions(fileToModify.path, fileToModify.versions, leaveFiles))) {
|
|
126
|
+
task.output = `Failed modifying file: ${fileToModify.path}`;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
task.title = origTitle;
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
title: 'Preflight Version Check',
|
|
134
|
+
task: async (ctx, task) => {
|
|
135
|
+
const origTitle = task.title;
|
|
136
|
+
task.title = RUNNING + origTitle;
|
|
137
|
+
// Confirm the Version Does Not Exist in Published State
|
|
138
|
+
task.output = `Checking if deployed app/version already exists for ${config.app.name}/${semVer}`;
|
|
139
|
+
ctx.preflightResult = await DeployClient_1.default.DeployVersionPreflight({
|
|
140
|
+
config,
|
|
141
|
+
output: (message) => (task.output = message),
|
|
142
|
+
});
|
|
143
|
+
if (ctx.preflightResult.exists) {
|
|
144
|
+
task.output = `Warning: App/Version already exists: ${config.app.name}/${config.app.semVer}`;
|
|
145
|
+
}
|
|
146
|
+
task.title = origTitle;
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
title: 'Serverless Next.js Build',
|
|
151
|
+
task: async (ctx, task) => {
|
|
152
|
+
const origTitle = task.title;
|
|
153
|
+
task.title = RUNNING + origTitle;
|
|
154
|
+
task.output = `Invoking serverless next.js build for ${config.app.name}/${semVer}`;
|
|
155
|
+
// Run the serverless next.js build
|
|
156
|
+
await asyncExec('serverless');
|
|
157
|
+
if (config.app.serverlessNextRouterPath !== undefined) {
|
|
158
|
+
task.output = 'Copying Serverless Next.js router to build output directory';
|
|
159
|
+
await fs_extra_1.promises.copyFile(config.app.serverlessNextRouterPath, './.serverless_nextjs/index.js');
|
|
160
|
+
}
|
|
161
|
+
task.title = origTitle;
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
title: 'Publish to ECR',
|
|
166
|
+
task: async (ctx, task) => {
|
|
167
|
+
const origTitle = task.title;
|
|
168
|
+
task.title = RUNNING + origTitle;
|
|
169
|
+
// Docker, build, tag, push to ECR
|
|
170
|
+
// Note: Need to already have AWS env vars set
|
|
171
|
+
await this.publishToECR(config, task);
|
|
172
|
+
task.title = origTitle;
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
title: 'Deploy to Lambda',
|
|
177
|
+
task: async (ctx, task) => {
|
|
178
|
+
const origTitle = task.title;
|
|
179
|
+
task.title = RUNNING + origTitle;
|
|
180
|
+
// Update the Lambda function
|
|
181
|
+
await this.deployToLambda(config, this.VersionAndAlias, task);
|
|
182
|
+
task.title = origTitle;
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
title: 'Confirm Static Assets Folder Exists',
|
|
187
|
+
task: async (ctx, task) => {
|
|
188
|
+
const origTitle = task.title;
|
|
189
|
+
task.title = RUNNING + origTitle;
|
|
190
|
+
// Check that Static Assets Folder exists
|
|
191
|
+
if (!(await fs_extra_1.pathExists(config.app.staticAssetsPath))) {
|
|
192
|
+
this.error(`Static asset path does not exist: ${config.app.staticAssetsPath}`);
|
|
193
|
+
}
|
|
194
|
+
task.title = origTitle;
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
title: 'Copy Static Files to Local Upload Dir',
|
|
199
|
+
task: async (ctx, task) => {
|
|
200
|
+
const origTitle = task.title;
|
|
201
|
+
task.title = RUNNING + origTitle;
|
|
202
|
+
// Copy files to local dir to be uploaded
|
|
203
|
+
await S3Uploader_1.default.CopyToUploadDir(config, ctx.preflightResult.response.s3UploadUrl);
|
|
204
|
+
task.title = origTitle;
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
title: 'Enumerate Files to Upload to S3',
|
|
209
|
+
task: async (ctx, task) => {
|
|
210
|
+
const origTitle = task.title;
|
|
211
|
+
task.title = RUNNING + origTitle;
|
|
212
|
+
ctx.files = (await S3TransferUtility_1.default.GetFiles(S3Uploader_1.default.TempDir));
|
|
213
|
+
task.title = origTitle;
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
title: 'Upload Static Files to S3',
|
|
218
|
+
task: (ctx, task) => {
|
|
219
|
+
const origTitle = task.title;
|
|
220
|
+
task.title = RUNNING + origTitle;
|
|
221
|
+
const { bucketName, destinationPrefix } = S3Uploader_1.default.ParseUploadPath(ctx.preflightResult.response.s3UploadUrl);
|
|
222
|
+
// Use temp credentials for S3
|
|
223
|
+
const s3Client = new s3.S3Client({
|
|
224
|
+
maxAttempts: 16,
|
|
225
|
+
credentials: {
|
|
226
|
+
accessKeyId: ctx.preflightResult.response.awsCredentials.accessKeyId,
|
|
227
|
+
secretAccessKey: ctx.preflightResult.response.awsCredentials.secretAccessKey,
|
|
228
|
+
sessionToken: ctx.preflightResult.response.awsCredentials.sessionToken,
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
const pathWithoutAppAndVer = path.join(S3Uploader_1.default.TempDir, destinationPrefix);
|
|
232
|
+
const tasks = ctx.files.map((filePath) => ({
|
|
233
|
+
task: async (ctx, subtask) => {
|
|
234
|
+
const relFilePath = path.relative(pathWithoutAppAndVer, filePath);
|
|
235
|
+
const origTitle = relFilePath;
|
|
236
|
+
subtask.title = RUNNING + origTitle;
|
|
237
|
+
const upload = new lib_storage_1.Upload({
|
|
238
|
+
client: s3Client,
|
|
239
|
+
leavePartsOnError: false,
|
|
240
|
+
params: {
|
|
241
|
+
Bucket: bucketName,
|
|
242
|
+
Key: path.relative(S3Uploader_1.default.TempDir, filePath),
|
|
243
|
+
Body: fs_extra_1.createReadStream(filePath),
|
|
244
|
+
ContentType: mime_types_1.contentType(path.basename(filePath)) || 'application/octet-stream',
|
|
245
|
+
CacheControl: 'max-age=86400; public',
|
|
246
|
+
},
|
|
247
|
+
});
|
|
248
|
+
await upload.done();
|
|
249
|
+
subtask.title = origTitle;
|
|
250
|
+
},
|
|
251
|
+
}));
|
|
252
|
+
task.title = origTitle;
|
|
253
|
+
return task.newListr(tasks, {
|
|
254
|
+
concurrent: 8,
|
|
255
|
+
rendererOptions: {
|
|
256
|
+
clearOutput: false,
|
|
257
|
+
showErrorMessage: true,
|
|
258
|
+
showTimer: true,
|
|
259
|
+
},
|
|
260
|
+
});
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
title: `Creating MicroApp Application: ${config.app.name}`,
|
|
265
|
+
task: async (ctx, task) => {
|
|
266
|
+
const origTitle = task.title;
|
|
267
|
+
task.title = RUNNING + origTitle;
|
|
268
|
+
// Call Deployer to Create App if Not Exists
|
|
269
|
+
await DeployClient_1.default.CreateApp(config);
|
|
270
|
+
task.title = origTitle;
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
title: `Creating MicroApp Version: ${config.app.semVer}`,
|
|
275
|
+
task: async (ctx, task) => {
|
|
276
|
+
const origTitle = task.title;
|
|
277
|
+
task.title = RUNNING + origTitle;
|
|
278
|
+
// Call Deployer to Deploy AppName/Version
|
|
279
|
+
await DeployClient_1.default.DeployVersion(config, 'lambda', (message) => (task.output = message));
|
|
280
|
+
task.title = origTitle;
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
], {
|
|
284
|
+
rendererOptions: {
|
|
285
|
+
showTimer: true,
|
|
286
|
+
},
|
|
287
|
+
});
|
|
288
|
+
try {
|
|
289
|
+
await tasks.run();
|
|
290
|
+
// this.log(`Published: ${config.app.name}/${config.app.semVer}`);
|
|
291
|
+
}
|
|
292
|
+
catch (error) {
|
|
293
|
+
this.log(`Caught exception: ${error.message}`);
|
|
294
|
+
}
|
|
295
|
+
finally {
|
|
296
|
+
await S3Uploader_1.default.removeTempDirIfExists();
|
|
297
|
+
await Versions_1.restoreFiles(this.FILES_TO_MODIFY);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Login to ECR for Lambda Docker functions
|
|
302
|
+
* @param config
|
|
303
|
+
* @returns
|
|
304
|
+
*/
|
|
305
|
+
async loginToECR(config) {
|
|
306
|
+
this.IMAGE_TAG = `${config.app.ecrRepoName}:${this.VersionAndAlias.version}`;
|
|
307
|
+
this.IMAGE_URI = `${config.app.ecrHost}/${this.IMAGE_TAG}`;
|
|
308
|
+
try {
|
|
309
|
+
await asyncExec(`aws ecr get-login-password --region ${config.app.awsRegion} | docker login --username AWS --password-stdin ${config.app.ecrHost}`);
|
|
310
|
+
}
|
|
311
|
+
catch (error) {
|
|
312
|
+
throw new Error(`ECR Login Failed: ${error.message}`);
|
|
313
|
+
}
|
|
314
|
+
return true;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Publish to ECR for Lambda Docker function
|
|
318
|
+
* @param config
|
|
319
|
+
*/
|
|
320
|
+
async publishToECR(config, task) {
|
|
321
|
+
task.output = 'Starting Docker build';
|
|
322
|
+
await asyncExec(`docker build -f Dockerfile -t ${this.IMAGE_TAG} .`);
|
|
323
|
+
await asyncExec(`docker tag ${this.IMAGE_TAG} ${config.app.ecrHost}/${this.IMAGE_TAG}`);
|
|
324
|
+
task.output = 'Starting Docker push to ECR';
|
|
325
|
+
await asyncExec(`docker push ${config.app.ecrHost}/${this.IMAGE_TAG}`);
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Publish an app version to Lambda
|
|
329
|
+
* @param config
|
|
330
|
+
* @param versions
|
|
331
|
+
*/
|
|
332
|
+
async deployToLambda(config, versions, task) {
|
|
333
|
+
var _a;
|
|
334
|
+
// Create Lambda version
|
|
335
|
+
task.output = 'Updating Lambda code to point to new Docker image';
|
|
336
|
+
const resultUpdate = await lambdaClient.send(new lambda.UpdateFunctionCodeCommand({
|
|
337
|
+
FunctionName: config.app.lambdaName,
|
|
338
|
+
ImageUri: this.IMAGE_URI,
|
|
339
|
+
Publish: true,
|
|
340
|
+
}));
|
|
341
|
+
// await lambdaClient.send(
|
|
342
|
+
// new lambda.PublishVersionCommand({
|
|
343
|
+
// FunctionName: config.app.lambdaName,
|
|
344
|
+
// }),
|
|
345
|
+
// );
|
|
346
|
+
const lambdaVersion = resultUpdate.Version;
|
|
347
|
+
task.output = `Lambda version created: ${resultUpdate.Version}`;
|
|
348
|
+
let lastUpdateStatus = resultUpdate.LastUpdateStatus;
|
|
349
|
+
for (let i = 0; i < 5; i++) {
|
|
350
|
+
// When the function is created the status will be "Pending"
|
|
351
|
+
// and we have to wait until it's done creating
|
|
352
|
+
// before we can point an alias to it
|
|
353
|
+
if (lastUpdateStatus === 'Successful') {
|
|
354
|
+
task.output = `Lambda function updated, version: ${lambdaVersion}`;
|
|
355
|
+
break;
|
|
356
|
+
}
|
|
357
|
+
// If it didn't work, wait and try again
|
|
358
|
+
await asyncSetTimeout(1000 * i);
|
|
359
|
+
const resultGet = await lambdaClient.send(new lambda.GetFunctionCommand({
|
|
360
|
+
FunctionName: config.app.lambdaName,
|
|
361
|
+
Qualifier: lambdaVersion,
|
|
362
|
+
}));
|
|
363
|
+
// Save the last update status so we can check on re-loop
|
|
364
|
+
lastUpdateStatus = (_a = resultGet === null || resultGet === void 0 ? void 0 : resultGet.Configuration) === null || _a === void 0 ? void 0 : _a.LastUpdateStatus;
|
|
365
|
+
}
|
|
366
|
+
// Create Lambda alias point
|
|
367
|
+
task.output = `Creating the lambda alias for the new version: ${lambdaVersion}`;
|
|
368
|
+
const resultLambdaAlias = await lambdaClient.send(new lambda.CreateAliasCommand({
|
|
369
|
+
FunctionName: config.app.lambdaName,
|
|
370
|
+
Name: versions.alias,
|
|
371
|
+
FunctionVersion: lambdaVersion,
|
|
372
|
+
}));
|
|
373
|
+
task.output = `Lambda alias created, name: ${resultLambdaAlias.Name}`;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
exports.DockerAutoCommand = DockerAutoCommand;
|
|
377
|
+
DockerAutoCommand.description = 'Fully automatic publishing of Docker-based Lambda function using Next.js and serverless-nextjs-router';
|
|
378
|
+
DockerAutoCommand.examples = [
|
|
379
|
+
`$ microapps-publish nextjs-docker-auto -d microapps-deployer-dev -n 0.0.14 -r microapps-app-release-dev-repo
|
|
380
|
+
✔ Logging into ECR [2s]
|
|
381
|
+
✔ Modifying Config Files [0.0s]
|
|
382
|
+
✔ Preflight Version Check [1s]
|
|
383
|
+
✔ Serverless Next.js Build [1m16s]
|
|
384
|
+
✔ Publish to ECR [32s]
|
|
385
|
+
✔ Deploy to Lambda [11s]
|
|
386
|
+
✔ Confirm Static Assets Folder Exists [0.0s]
|
|
387
|
+
✔ Copy Static Files to Local Upload Dir [0.0s]
|
|
388
|
+
✔ Enumerate Files to Upload to S3 [0.0s]
|
|
389
|
+
✔ Upload Static Files to S3 [1s]
|
|
390
|
+
✔ Creating MicroApp Application: release [0.2s]
|
|
391
|
+
✔ Creating MicroApp Version: 0.0.14 [1s]
|
|
392
|
+
`,
|
|
393
|
+
];
|
|
394
|
+
DockerAutoCommand.flags = {
|
|
395
|
+
version: command_1.flags.version({
|
|
396
|
+
char: 'v',
|
|
397
|
+
}),
|
|
398
|
+
help: command_1.flags.help(),
|
|
399
|
+
deployerLambdaName: command_1.flags.string({
|
|
400
|
+
char: 'd',
|
|
401
|
+
multiple: false,
|
|
402
|
+
required: true,
|
|
403
|
+
description: 'Name of the deployer lambda function',
|
|
404
|
+
}),
|
|
405
|
+
newVersion: command_1.flags.string({
|
|
406
|
+
char: 'n',
|
|
407
|
+
multiple: false,
|
|
408
|
+
required: true,
|
|
409
|
+
description: 'New semantic version to apply',
|
|
410
|
+
}),
|
|
411
|
+
repoName: command_1.flags.string({
|
|
412
|
+
char: 'r',
|
|
413
|
+
multiple: false,
|
|
414
|
+
required: true,
|
|
415
|
+
description: 'Name (not URI) of the Docker repo for the app',
|
|
416
|
+
}),
|
|
417
|
+
leaveCopy: command_1.flags.boolean({
|
|
418
|
+
char: 'f',
|
|
419
|
+
default: false,
|
|
420
|
+
required: false,
|
|
421
|
+
description: 'Leave a copy of the modifed files as .modified',
|
|
422
|
+
}),
|
|
423
|
+
appLambdaName: command_1.flags.string({
|
|
424
|
+
char: 'l',
|
|
425
|
+
multiple: false,
|
|
426
|
+
required: false,
|
|
427
|
+
description: 'Name of the application lambda function',
|
|
428
|
+
}),
|
|
429
|
+
appName: command_1.flags.string({
|
|
430
|
+
char: 'a',
|
|
431
|
+
multiple: false,
|
|
432
|
+
required: false,
|
|
433
|
+
description: 'MicroApps app name',
|
|
434
|
+
}),
|
|
435
|
+
staticAssetsPath: command_1.flags.string({
|
|
436
|
+
char: 's',
|
|
437
|
+
multiple: false,
|
|
438
|
+
required: false,
|
|
439
|
+
description: 'Path to files to be uploaded to S3 static bucket at app/version/ path. Do include app/version/ in path if files are already "rooted" under that path locally.',
|
|
440
|
+
}),
|
|
441
|
+
defaultFile: command_1.flags.string({
|
|
442
|
+
char: 'i',
|
|
443
|
+
multiple: false,
|
|
444
|
+
required: false,
|
|
445
|
+
description: 'Default file to return when the app is loaded via the router without a version (e.g. when app/ is requested).',
|
|
446
|
+
}),
|
|
447
|
+
};
|
|
448
|
+
//# sourceMappingURL=nextjs-docker-auto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextjs-docker-auto.js","sourceRoot":"","sources":["../../src/commands/nextjs-docker-auto.ts"],"names":[],"mappings":";;;;AAAA,4BAA0B;AAC1B,iDAAqC;AACrC,mDAA6B;AAC7B,uEAAiD;AACjD,+DAAyC;AACzC,iEAA2C;AAC3C,4CAA+D;AAE/D,mDAA6B;AAC7B,uCAAwE;AACxE,mCAA0C;AAC1C,6CAAmD;AACnD,+EAAkF;AAClF,2EAA2C;AAC3C,yFAAyD;AACzD,sDAA8C;AAC9C,2CAAyC;AAGzC,8CAMyB;AACzB,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACnD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,oBAAI,CAAC,CAAC;AAEvC,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC;IAC3C,WAAW,EAAE,CAAC;CACf,CAAC,CAAC;AAOH,MAAa,iBAAkB,SAAQ,iBAAO;IAA9C;;QA+EU,cAAS,GAAG,EAAE,CAAC;QACf,cAAS,GAAG,EAAE,CAAC;Q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K,CAAC;IACF,WAAW,EAAE,eAAW,CAAC,MAAM,CAAC;QAC9B,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;QACf,WAAW,EACT,+GAA+G;KAClH,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { Command } from '@oclif/command';
|
|
3
|
+
export declare class NextJSVersionRestoreCommand extends Command {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
version: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
|
|
8
|
+
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
|
|
9
|
+
};
|
|
10
|
+
private VersionAndAlias;
|
|
11
|
+
private FILES_TO_MODIFY;
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=nextjs-version-restore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextjs-version-restore.d.ts","sourceRoot":"","sources":["../../src/commands/nextjs-version-restore.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAwB,MAAM,gBAAgB,CAAC;AAK/D,qBAAa,2BAA4B,SAAQ,OAAO;IACtD,MAAM,CAAC,WAAW,SAA4B;IAE9C,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;MAKV;IAEF,OAAO,CAAC,eAAe,CAAY;IACnC,OAAO,CAAC,eAAe,CAGnB;IAEE,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA6C3B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NextJSVersionRestoreCommand = void 0;
|
|
4
|
+
require("reflect-metadata");
|
|
5
|
+
const command_1 = require("@oclif/command");
|
|
6
|
+
const listr2_1 = require("listr2");
|
|
7
|
+
const Versions_1 = require("../lib/Versions");
|
|
8
|
+
class NextJSVersionRestoreCommand extends command_1.Command {
|
|
9
|
+
async run() {
|
|
10
|
+
// const RUNNING_TEXT = ' RUNS ';
|
|
11
|
+
// const RUNNING = chalk.reset.inverse.yellow.bold(RUNNING_TEXT) + ' ';
|
|
12
|
+
const RUNNING = ''; //chalk.reset.inverse.yellow.bold(RUNNING_TEXT) + ' ';
|
|
13
|
+
const { flags: parsedFlags } = this.parse(NextJSVersionRestoreCommand);
|
|
14
|
+
this.VersionAndAlias = Versions_1.createVersions('0.0.0');
|
|
15
|
+
const versionOnly = { version: this.VersionAndAlias.version };
|
|
16
|
+
this.FILES_TO_MODIFY = [{ path: 'next.config.js', versions: versionOnly }];
|
|
17
|
+
// TODO: Pick and validate the appname/semver from the config and flags
|
|
18
|
+
//
|
|
19
|
+
// Setup Tasks
|
|
20
|
+
//
|
|
21
|
+
const tasks = new listr2_1.Listr([
|
|
22
|
+
{
|
|
23
|
+
title: 'Restoring Modified Config Files',
|
|
24
|
+
task: async (ctx, task) => {
|
|
25
|
+
const origTitle = task.title;
|
|
26
|
+
task.title = RUNNING + origTitle;
|
|
27
|
+
await Versions_1.restoreFiles(this.FILES_TO_MODIFY);
|
|
28
|
+
task.title = origTitle;
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
], {
|
|
32
|
+
rendererOptions: {
|
|
33
|
+
showTimer: true,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
try {
|
|
37
|
+
await tasks.run();
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
this.log(`Caught exception: ${error.message}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.NextJSVersionRestoreCommand = NextJSVersionRestoreCommand;
|
|
45
|
+
NextJSVersionRestoreCommand.description = 'Restore next.config.js';
|
|
46
|
+
NextJSVersionRestoreCommand.examples = [
|
|
47
|
+
`$ microapps-publish nextjs-version-restore
|
|
48
|
+
✔ Restoring Modified Config Files [0.0s]
|
|
49
|
+
`,
|
|
50
|
+
];
|
|
51
|
+
NextJSVersionRestoreCommand.flags = {
|
|
52
|
+
version: command_1.flags.version({
|
|
53
|
+
char: 'v',
|
|
54
|
+
}),
|
|
55
|
+
help: command_1.flags.help(),
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=nextjs-version-restore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextjs-version-restore.js","sourceRoot":"","sources":["../../src/commands/nextjs-version-restore.ts"],"names":[],"mappings":";;;AAAA,4BAA0B;AAC1B,4CAA+D;AAE/D,mCAA+B;AAC/B,8CAA0E;AAE1E,MAAa,2BAA4B,SAAQ,iBAAO;IAsBtD,KAAK,CAAC,GAAG;QACP,iCAAiC;QACjC,uEAAuE;QACvE,MAAM,OAAO,GAAG,EAAE,CAAC,CAAC,sDAAsD;QAE1E,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAEvE,IAAI,CAAC,eAAe,GAAG,yBAAc,CAAC,OAAO,CAAC,CAAC;QAC/C,MAAM,WAAW,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;QAE9D,IAAI,CAAC,eAAe,GAAG,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;QAE3E,uEAAuE;QAEvE,EAAE;QACF,cAAc;QACd,EAAE;QAEF,MAAM,KAAK,GAAG,IAAI,cAAK,CACrB;YACE;gBACE,KAAK,EAAE,iCAAiC;gBACxC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;oBACxB,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC;oBAC7B,IAAI,CAAC,KAAK,GAAG,OAAO,GAAG,SAAS,CAAC;oBAEjC,MAAM,uBAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;oBAEzC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;gBACzB,CAAC;aACF;SACF,EACD;YACE,eAAe,EAAE;gBACf,SAAS,EAAE,IAAI;aAChB;SACF,CACF,CAAC;QAEF,IAAI;YACF,MAAM,KAAK,CAAC,GAAG,EAAE,CAAC;SACnB;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,GAAG,CAAC,qBAAqB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;SAChD;IACH,CAAC;;AAlEH,kEAmEC;AAlEQ,uCAAW,GAAG,wBAAwB,CAAC;AAEvC,oCAAQ,GAAG;IAChB;;CAEH;CACE,CAAC;AAEK,iCAAK,GAAG;IACb,OAAO,EAAE,eAAW,CAAC,OAAO,CAAC;QAC3B,IAAI,EAAE,GAAG;KACV,CAAC;IACF,IAAI,EAAE,eAAW,CAAC,IAAI,EAAE;CACzB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { Command, flags as flagsParser } from '@oclif/command';
|
|
3
|
+
export declare class NextJSVersionCommand extends Command {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
version: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
|
|
8
|
+
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
|
|
9
|
+
newVersion: flagsParser.IOptionFlag<string>;
|
|
10
|
+
leaveCopy: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
private VersionAndAlias;
|
|
13
|
+
private FILES_TO_MODIFY;
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=nextjs-version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextjs-version.d.ts","sourceRoot":"","sources":["../../src/commands/nextjs-version.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAM/D,qBAAa,oBAAqB,SAAQ,OAAO;IAC/C,MAAM,CAAC,WAAW,SAAkE;IAEpF,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;;;MAiBV;IAEF,OAAO,CAAC,eAAe,CAAY;IACnC,OAAO,CAAC,eAAe,CAGnB;IAEE,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAwE3B"}
|