Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOP-4033]: Replicate shared.mk steps within Autobuilder code #917

Merged
merged 56 commits into from
Oct 26, 2023
Merged
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
9878242
[DOP-4033]: Add initial commands
branberry Sep 21, 2023
902a357
[DOP-4033]: Create helpers for cli commands
branberry Sep 21, 2023
534084b
[DOP-4033]: Add default args
branberry Sep 21, 2023
8995249
[DOP-4033]: Move directories
branberry Sep 21, 2023
1ccbad7
[DOP-4033]: Update spawn to work async and add code for getPatchId co…
branberry Sep 22, 2023
5281b13
[DOP-4033]: Refactor executeCliCommand
branberry Sep 22, 2023
dce8dd7
[DOP-4033]: Wrap up nextgenparse refactor
branberry Sep 22, 2023
7324870
[DOP-4033]: Move commands directory out of enhanced
branberry Sep 22, 2023
ab09876
[DOP-4033]: Add next gen html command
branberry Sep 22, 2023
18ff8d8
[DOP-4033]: Use correct arg for createEnvProdFile
branberry Sep 22, 2023
8e03ca2
[DOP-4033]: Add git hash
branberry Sep 25, 2023
3566e9a
[DOP-4033]: Move commands into shared directory
branberry Sep 26, 2023
7d4dca6
[DOP-4033]: Refactor
branberry Sep 26, 2023
43efb54
[DOP-4033]: Create base job for standard builds ie jobs with makefile…
branberry Sep 26, 2023
6a39606
[DOP-4033]: Add the ability to append to file using executeCliCommand
branberry Sep 26, 2023
e27bae3
[DOP-4033]: Add logic to write to .env.production file
branberry Sep 26, 2023
6b9df11
[DOP-4033]: Add more logic to write to files and start working creati…
branberry Sep 27, 2023
3ae00e3
[DOP-4033]: Add local testing app and make test build faster
branberry Sep 27, 2023
32f7dc6
[DOP-4033]: Add test code to confirm commands work, and remove base d…
branberry Sep 27, 2023
8b9519d
[DOP-4033]: Add next-gen-stage, and add support for arm64 dockerfile
branberry Sep 29, 2023
4518c13
[DOP-4033]: Remove extra args from dockerfile
branberry Sep 29, 2023
a9ae14a
[DOP-4033]: Add oas-page-build and persistence module
branberry Sep 29, 2023
c5037fd
[DOP-4033]: Add bundle path for oaspagebuild
branberry Sep 29, 2023
9f3cd88
[DOP-4033]: Work on logic for deploy and ability to pipe output from …
branberry Oct 2, 2023
4b5a432
[DOP-4033]: Work on logic for deploy and ability to pipe output from …
branberry Oct 2, 2023
1a635d1
[DOP-4033]: Work on logic for deploy and ability to pipe output from …
branberry Oct 3, 2023
82872a0
[DOP-4033]: Finish up pipe logic
branberry Oct 3, 2023
d6798e3
[DOP-4033]: Add next-gen-deploy
branberry Oct 3, 2023
66bd820
[DOP-4033]: Remove unused imports
branberry Oct 3, 2023
dcc7e62
[DOP-4033]: Remove standard job handler
branberry Oct 3, 2023
24b4c00
[DOP-4033]: Add execution helper
branberry Oct 3, 2023
c5d6680
[DOP-4033]: Refactor localApp
branberry Oct 3, 2023
17830fb
[DOP-4033]: Add stage job
branberry Oct 4, 2023
ff2aeb0
Merge branch 'master' into DOP-4033
branberry Oct 4, 2023
d2c6f13
[DOP-4033]: Update persistence module
branberry Oct 5, 2023
4827b01
[DOP-4033]: Add next-gen-deploy
branberry Oct 6, 2023
9b28c5d
Merge branch 'master' into DOP-4033
branberry Oct 6, 2023
5c44115
[DOP-4033]: Update next-gen-deploy to work
branberry Oct 6, 2023
42753cf
[DOP-4033]: Add comments
branberry Oct 11, 2023
6749b66
[DOP-4033]: Add more comments
branberry Oct 11, 2023
dc492ac
[DOP-4033]: Remove index.ts
branberry Oct 12, 2023
3adf633
[DOP-4033]: Refactor to use index file
branberry Oct 12, 2023
de8ae8c
Merge branch 'master' into DOP-4033
branberry Oct 12, 2023
b2bc784
[DOP-4033]: Use correct values for nextgenstage
branberry Oct 16, 2023
bdacf2d
[DOP-4033]: Respond to review comments
branberry Oct 16, 2023
1f0328b
[DOP-4033]: Use PATH_PREFIX
branberry Oct 16, 2023
f5497f9
[DOP-4033]: Remove param0
branberry Oct 16, 2023
fbb0256
[DOP-4033]: Respond to review feedback
branberry Oct 17, 2023
80f4e2f
[DOP-4033]: Respond to review feedback
branberry Oct 17, 2023
a06ebe1
[DOP-4033]: Remove extra log
branberry Oct 17, 2023
99ad2e1
[DOP-4033]: Add empty string to join to remove commas
branberry Oct 17, 2023
079fe47
[DOP-4033]: Use console.log
branberry Oct 17, 2023
0d63308
[DOP-4033]: Check array length
branberry Oct 19, 2023
234c843
[DOP-4033]: Add error handling for dependency helper
branberry Oct 19, 2023
759689a
Merge branch 'master' into DOP-4033
branberry Oct 20, 2023
e442448
Merge branch 'master' into DOP-4033
branberry Oct 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[DOP-4033]: Create helpers for cli commands
branberry committed Sep 21, 2023
commit 902a357725a38dfac4397cbe42c8b26721543aaf
21 changes: 21 additions & 0 deletions src/enhanced/utils/commands/helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { spawn } from 'child_process';

export class ExecuteCommandError extends Error {
data: unknown;
constructor(message: string, data: unknown) {
super(message);
this.data = data;
}
}
export async function executeCliCommand<T = unknown>(command: string, args?: readonly string[]): Promise<T> {
const executedCommand = spawn(command, args);
return new Promise((resolve, reject) => {
executedCommand.stdout.on('data', (data) => {
resolve(data as T);
});

executedCommand.stderr.on('data', (data) => {
reject(new ExecuteCommandError('The command failed', data));
});
});
}
7 changes: 5 additions & 2 deletions src/enhanced/utils/commands/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import simpleGit from 'simple-git';
import fs from 'fs';
import path from 'path';
import { executeCliCommand } from './helpers';

function getPatchId(): string | undefined {
async function getPatchId(): Promise<string | undefined> {
if (!fs.existsSync(path.join(__dirname, 'myPatch.patch'))) return;

const gitPatchId = await executeCliCommand('git', ['patch-id']);
}

export function nextGenParse() {
export async function nextGenParse() {
getPatchId();
}