pypeline 1.1.7 → 1.2.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/lib/commands/pypeline/build.d.ts +18 -0
- package/lib/commands/pypeline/build.js +85 -0
- package/lib/commands/pypeline/build.js.map +1 -0
- package/lib/commands/pypeline/deploy/training.d.ts +15 -0
- package/lib/commands/pypeline/deploy/training.js +62 -0
- package/lib/commands/pypeline/deploy/training.js.map +1 -0
- package/lib/commands/pypeline/init.d.ts +13 -0
- package/lib/commands/pypeline/init.js +149 -0
- package/lib/commands/pypeline/init.js.map +1 -0
- package/lib/commands/pypeline/package.d.ts +11 -0
- package/lib/commands/pypeline/package.js +27 -0
- package/lib/commands/pypeline/package.js.map +1 -0
- package/lib/commands/pypeline/quickdeploy.d.ts +18 -0
- package/lib/commands/pypeline/quickdeploy.js +116 -0
- package/lib/commands/pypeline/quickdeploy.js.map +1 -0
- package/lib/commands/pypeline/run.d.ts +19 -0
- package/lib/commands/pypeline/run.js +179 -0
- package/lib/commands/pypeline/run.js.map +1 -0
- package/lib/commands/pypeline/validate/prd.d.ts +16 -0
- package/lib/commands/pypeline/validate/prd.js +78 -0
- package/lib/commands/pypeline/validate/prd.js.map +1 -0
- package/lib/config.d.ts +23 -0
- package/lib/config.js +65 -0
- package/lib/config.js.map +1 -0
- package/lib/fileUtils.d.ts +2 -0
- package/lib/fileUtils.js +78 -0
- package/lib/fileUtils.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/messages/pypeline.init.md +19 -0
- package/oclif.manifest.json +458 -1
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export type PypelineBuildResult = {
|
|
3
|
+
commitHash: string;
|
|
4
|
+
novoBaseline: string;
|
|
5
|
+
added: string[];
|
|
6
|
+
modified: string[];
|
|
7
|
+
deleted: string[];
|
|
8
|
+
};
|
|
9
|
+
export default class PypelineBuild extends SfCommand<PypelineBuildResult> {
|
|
10
|
+
static readonly summary: string;
|
|
11
|
+
static readonly description: string;
|
|
12
|
+
static readonly examples: string[];
|
|
13
|
+
static readonly flags: {
|
|
14
|
+
branch: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<PypelineBuildResult>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { execSync, spawnSync } from 'node:child_process';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
5
|
+
import { Messages } from '@salesforce/core';
|
|
6
|
+
import { BASELINE_FILE, BRANCH, BUILD_DIR, PROJECT_DIR, PROJECT_NAME, SCRIPT_DIR, fileExists, readFileTrimmed, writeFile, gitDiffFiles, } from '../../config.js';
|
|
7
|
+
import { copyFile } from '../../fileUtils.js';
|
|
8
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
9
|
+
const messages = Messages.loadMessages('pypeline', 'pypeline.build');
|
|
10
|
+
export default class PypelineBuild extends SfCommand {
|
|
11
|
+
static summary = messages.getMessage('summary');
|
|
12
|
+
static description = messages.getMessage('description');
|
|
13
|
+
static examples = messages.getMessages('examples');
|
|
14
|
+
static flags = {
|
|
15
|
+
branch: Flags.string({
|
|
16
|
+
char: 'b',
|
|
17
|
+
summary: messages.getMessage('flags.branch.summary'),
|
|
18
|
+
default: BRANCH,
|
|
19
|
+
}),
|
|
20
|
+
'dry-run': Flags.boolean({
|
|
21
|
+
summary: messages.getMessage('flags.dry-run.summary'),
|
|
22
|
+
default: false,
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
async run() {
|
|
26
|
+
const { flags } = await this.parse(PypelineBuild);
|
|
27
|
+
const branch = flags['branch'] ?? BRANCH;
|
|
28
|
+
const dryRun = flags['dry-run'];
|
|
29
|
+
this.log(`SCRIPT_DIR : ${SCRIPT_DIR}`);
|
|
30
|
+
this.log(`PROJECT_DIR : ${PROJECT_DIR()}`);
|
|
31
|
+
if (!dryRun) {
|
|
32
|
+
const gen = spawnSync('sf', ['project', 'generate', '--name', PROJECT_NAME, '--output-dir', PROJECT_DIR()], { encoding: 'utf8', stdio: 'inherit' });
|
|
33
|
+
if (gen.status !== 0)
|
|
34
|
+
this.error('Falha ao gerar estrutura do projeto sf.');
|
|
35
|
+
}
|
|
36
|
+
if (!fileExists(BASELINE_FILE()))
|
|
37
|
+
this.error('baseline.txt não encontrado!');
|
|
38
|
+
const commitHash = readFileTrimmed(BASELINE_FILE());
|
|
39
|
+
this.log(`Baseline : ${commitHash}`);
|
|
40
|
+
if (!dryRun) {
|
|
41
|
+
for (const cmd of [
|
|
42
|
+
['git', 'checkout', branch],
|
|
43
|
+
['git', 'fetch'],
|
|
44
|
+
['git', 'pull'],
|
|
45
|
+
]) {
|
|
46
|
+
const r = spawnSync(cmd[0], cmd.slice(1), { stdio: 'inherit' });
|
|
47
|
+
if (r.status !== 0)
|
|
48
|
+
this.error(`Falha ao executar: ${cmd.join(' ')}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const commits = execSync(`git rev-list ${commitHash}..HEAD --oneline`, { encoding: 'utf8' });
|
|
52
|
+
writeFile(path.join(PROJECT_DIR(), 'commitlist.txt'), commits);
|
|
53
|
+
if (fs.existsSync(BUILD_DIR()))
|
|
54
|
+
fs.rmSync(BUILD_DIR(), { recursive: true, force: true });
|
|
55
|
+
fs.mkdirSync(BUILD_DIR(), { recursive: true });
|
|
56
|
+
const diff = gitDiffFiles(commitHash);
|
|
57
|
+
writeFile(path.join(PROJECT_DIR(), 'lista_arquivos_naodeletados.txt'), diff.notDeleted.join('\n'));
|
|
58
|
+
writeFile(path.join(PROJECT_DIR(), 'lista_arquivos_deletados.txt'), diff.deleted.join('\n'));
|
|
59
|
+
writeFile(path.join(PROJECT_DIR(), 'lista_arquivos_adicionados.txt'), diff.added.join('\n'));
|
|
60
|
+
writeFile(path.join(PROJECT_DIR(), 'lista_arquivos_modificados.txt'), diff.modified.join('\n'));
|
|
61
|
+
this.log('Arquivos modificados ou adicionados:');
|
|
62
|
+
for (const file of diff.notDeleted) {
|
|
63
|
+
this.log(` Arquivo a ser avaliado: ${file}`);
|
|
64
|
+
if (!dryRun) {
|
|
65
|
+
try {
|
|
66
|
+
copyFile(file, BUILD_DIR());
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
this.warn(`Erro ao copiar '${file}': ${err.message}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// Calcula o novo baseline (HEAD atual após git pull)
|
|
74
|
+
const novoBaseline = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim();
|
|
75
|
+
this.log(`[INFO] Novo baseline calculado: ${novoBaseline}`);
|
|
76
|
+
this.log('[INFO] baseline.txt será atualizado pelo run após validate PRD com sucesso.');
|
|
77
|
+
// Persiste o novo baseline para o run.ts ler depois
|
|
78
|
+
process.env['PYPELINE_NOVO_BASELINE'] = novoBaseline;
|
|
79
|
+
const branchInfo = execSync('git branch', { encoding: 'utf8' });
|
|
80
|
+
this.log(`Branches:\n${branchInfo}`);
|
|
81
|
+
this.log(`Build project criado em ${BUILD_DIR()}.`);
|
|
82
|
+
return { commitHash, novoBaseline, added: diff.added, modified: diff.modified, deleted: diff.deleted };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/commands/pypeline/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACzD,O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/sf-plugins-core';
|
|
2
|
+
export type PypelineDeployTrainingResult = {
|
|
3
|
+
success: boolean;
|
|
4
|
+
logPath: string;
|
|
5
|
+
};
|
|
6
|
+
export default class PypelineDeployTraining extends SfCommand<PypelineDeployTrainingResult> {
|
|
7
|
+
static readonly summary: string;
|
|
8
|
+
static readonly description: string;
|
|
9
|
+
static readonly examples: string[];
|
|
10
|
+
static readonly flags: {
|
|
11
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
wait: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<PypelineDeployTrainingResult>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
4
|
+
import { Messages } from '@salesforce/core';
|
|
5
|
+
import { LOG_TRAINING, SOURCE_DIR, unlinkIfExists } from '../../../config.js';
|
|
6
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
7
|
+
const messages = Messages.loadMessages('pypeline', 'pypeline.deploy.training');
|
|
8
|
+
export default class PypelineDeployTraining extends SfCommand {
|
|
9
|
+
static summary = messages.getMessage('summary');
|
|
10
|
+
static description = messages.getMessage('description');
|
|
11
|
+
static examples = messages.getMessages('examples');
|
|
12
|
+
static flags = {
|
|
13
|
+
'target-org': Flags.string({
|
|
14
|
+
summary: messages.getMessage('flags.target-org.summary'),
|
|
15
|
+
default: 'treino',
|
|
16
|
+
}),
|
|
17
|
+
wait: Flags.integer({
|
|
18
|
+
char: 'w',
|
|
19
|
+
summary: messages.getMessage('flags.wait.summary'),
|
|
20
|
+
default: 240,
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
async run() {
|
|
24
|
+
const { flags } = await this.parse(PypelineDeployTraining);
|
|
25
|
+
const logPath = LOG_TRAINING();
|
|
26
|
+
const sourceDir = SOURCE_DIR();
|
|
27
|
+
unlinkIfExists(logPath);
|
|
28
|
+
this.log('Iniciando deploy em Training...');
|
|
29
|
+
const cmd = [
|
|
30
|
+
'project', 'deploy', 'start',
|
|
31
|
+
'--source-dir', sourceDir,
|
|
32
|
+
'--target-org', flags['target-org'] ?? 'treino',
|
|
33
|
+
'--test-level', 'RunLocalTests',
|
|
34
|
+
'-w', String(flags['wait'] ?? 240),
|
|
35
|
+
'--ignore-conflicts',
|
|
36
|
+
'--verbose',
|
|
37
|
+
];
|
|
38
|
+
const exitCode = await new Promise((resolve) => {
|
|
39
|
+
const proc = spawn('sf', cmd, { stdio: ['inherit', 'pipe', 'pipe'] });
|
|
40
|
+
const log = fs.createWriteStream(logPath, { flags: 'a' });
|
|
41
|
+
if (proc.stdout)
|
|
42
|
+
proc.stdout.on('data', (chunk) => {
|
|
43
|
+
const text = chunk.toString();
|
|
44
|
+
process.stdout.write(text);
|
|
45
|
+
log.write(text);
|
|
46
|
+
});
|
|
47
|
+
if (proc.stderr)
|
|
48
|
+
proc.stderr.on('data', (chunk) => {
|
|
49
|
+
const text = chunk.toString();
|
|
50
|
+
process.stderr.write(text);
|
|
51
|
+
log.write(text);
|
|
52
|
+
});
|
|
53
|
+
proc.on('close', (code) => { log.close(); resolve(code ?? 1); });
|
|
54
|
+
});
|
|
55
|
+
if (exitCode !== 0) {
|
|
56
|
+
this.error(`Deploy em Training falhou com exit code ${exitCode}.`);
|
|
57
|
+
}
|
|
58
|
+
this.log('Deploy em Training concluído com sucesso.');
|
|
59
|
+
return { success: true, logPath };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=training.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"training.js","sourceRoot":"","sources":["../../../../src/commands/pypeline/deploy/training.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAq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,KAAK,CAAC,IAAI,CAAC,CAAC;gBAClB,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAmB,EAAE,EAAE,GAAG,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClF,CAAC,CAAC,CAAC;QAEH,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;YACnB,IAAI,CAAC,KAAK,CAAC,2CAA2C,QAAQ,GAAG,CAAC,CAAC;QACrE,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;QACtD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IACpC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export type InitResult = {
|
|
3
|
+
baselineCreated: boolean;
|
|
4
|
+
gitignoreUpdated: boolean;
|
|
5
|
+
orgsFound: string[];
|
|
6
|
+
orgsMissing: string[];
|
|
7
|
+
};
|
|
8
|
+
export default class Init extends SfCommand<InitResult> {
|
|
9
|
+
static readonly summary: string;
|
|
10
|
+
static readonly description: string;
|
|
11
|
+
static readonly examples: string[];
|
|
12
|
+
run(): Promise<InitResult>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, readFileSync, writeFileSync, appendFileSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { Messages } from '@salesforce/core';
|
|
5
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
6
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
7
|
+
const messages = Messages.loadMessages('pypeline', 'pypeline.init');
|
|
8
|
+
const GITIGNORE_BLOCK = `
|
|
9
|
+
# ── pypeline — arquivos gerados pelo pipeline ────────────────────────────────
|
|
10
|
+
baseline.txt
|
|
11
|
+
build_deploy/
|
|
12
|
+
lista_arquivos_adicionados.txt
|
|
13
|
+
lista_arquivos_modificados.txt
|
|
14
|
+
lista_arquivos_deletados.txt
|
|
15
|
+
lista_arquivos_naodeletados.txt
|
|
16
|
+
prd_job_id.txt
|
|
17
|
+
deploy_prd_output.log
|
|
18
|
+
deploy_training_output.log
|
|
19
|
+
`;
|
|
20
|
+
const PYPELINE_ENTRIES = [
|
|
21
|
+
'baseline.txt',
|
|
22
|
+
'build_deploy/',
|
|
23
|
+
'lista_arquivos_adicionados.txt',
|
|
24
|
+
'lista_arquivos_modificados.txt',
|
|
25
|
+
'lista_arquivos_deletados.txt',
|
|
26
|
+
'lista_arquivos_naodeletados.txt',
|
|
27
|
+
'prd_job_id.txt',
|
|
28
|
+
'deploy_prd_output.log',
|
|
29
|
+
'deploy_training_output.log',
|
|
30
|
+
];
|
|
31
|
+
const DEFAULT_ORGS = ['devops', 'treino'];
|
|
32
|
+
export default class Init extends SfCommand {
|
|
33
|
+
static summary = messages.getMessage('summary');
|
|
34
|
+
static description = messages.getMessage('description');
|
|
35
|
+
static examples = messages.getMessages('examples');
|
|
36
|
+
async run() {
|
|
37
|
+
const cwd = process.cwd();
|
|
38
|
+
const result = {
|
|
39
|
+
baselineCreated: false,
|
|
40
|
+
gitignoreUpdated: false,
|
|
41
|
+
orgsFound: [],
|
|
42
|
+
orgsMissing: [],
|
|
43
|
+
};
|
|
44
|
+
this.log('\n── pypeline init ───────────────────────────────────────────\n');
|
|
45
|
+
// ── 1. baseline.txt ────────────────────────────────────────────────────
|
|
46
|
+
const baselinePath = join(cwd, 'baseline.txt');
|
|
47
|
+
if (existsSync(baselinePath)) {
|
|
48
|
+
const hash = readFileSync(baselinePath, 'utf8').trim();
|
|
49
|
+
this.log(`✔ baseline.txt já existe (${hash.slice(0, 8)}...)`);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
const confirm = await this.confirm({
|
|
53
|
+
message: 'baseline.txt não encontrado. Criar agora com o commit HEAD atual?',
|
|
54
|
+
defaultAnswer: true,
|
|
55
|
+
});
|
|
56
|
+
if (confirm) {
|
|
57
|
+
try {
|
|
58
|
+
const hash = execSync('git rev-parse HEAD', { encoding: 'utf8', cwd }).trim();
|
|
59
|
+
writeFileSync(baselinePath, hash + '\n', 'utf8');
|
|
60
|
+
result.baselineCreated = true;
|
|
61
|
+
this.log(`✔ baseline.txt criado → ${hash.slice(0, 8)}...`);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
this.warn('Não foi possível obter o commit HEAD. Certifique-se de estar em um repositório git.');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.log(' baseline.txt ignorado. Crie manualmente com: git rev-parse HEAD > baseline.txt');
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// ── 2. .gitignore ──────────────────────────────────────────────────────
|
|
72
|
+
this.log('');
|
|
73
|
+
const gitignorePath = join(cwd, '.gitignore');
|
|
74
|
+
if (!existsSync(gitignorePath)) {
|
|
75
|
+
const confirm = await this.confirm({
|
|
76
|
+
message: '.gitignore não encontrado. Criar com as entradas do pypeline?',
|
|
77
|
+
defaultAnswer: true,
|
|
78
|
+
});
|
|
79
|
+
if (confirm) {
|
|
80
|
+
writeFileSync(gitignorePath, GITIGNORE_BLOCK.trimStart(), 'utf8');
|
|
81
|
+
result.gitignoreUpdated = true;
|
|
82
|
+
this.log('✔ .gitignore criado com entradas do pypeline.');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
const content = readFileSync(gitignorePath, 'utf8');
|
|
87
|
+
const missing = PYPELINE_ENTRIES.filter((entry) => !content.includes(entry));
|
|
88
|
+
if (missing.length === 0) {
|
|
89
|
+
this.log('✔ .gitignore já contém todas as entradas do pypeline.');
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
this.log(` Entradas ausentes no .gitignore:\n${missing.map((e) => ` - ${e}`).join('\n')}`);
|
|
93
|
+
const confirm = await this.confirm({
|
|
94
|
+
message: 'Adicionar entradas do pypeline ao .gitignore?',
|
|
95
|
+
defaultAnswer: true,
|
|
96
|
+
});
|
|
97
|
+
if (confirm) {
|
|
98
|
+
appendFileSync(gitignorePath, GITIGNORE_BLOCK, 'utf8');
|
|
99
|
+
result.gitignoreUpdated = true;
|
|
100
|
+
this.log('✔ Entradas adicionadas ao .gitignore.');
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
this.log(' .gitignore não foi alterado.');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// ── 3. Orgs autenticadas ───────────────────────────────────────────────
|
|
108
|
+
this.log('');
|
|
109
|
+
this.log('Verificando orgs autenticadas...');
|
|
110
|
+
try {
|
|
111
|
+
const output = execSync('sf org list --json', { encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] });
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
113
|
+
const parsed = JSON.parse(output);
|
|
114
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
115
|
+
const nonScratch = (parsed?.result?.nonScratchOrgs ?? []);
|
|
116
|
+
const aliases = nonScratch.map((o) => o.alias).filter(Boolean);
|
|
117
|
+
for (const alias of DEFAULT_ORGS) {
|
|
118
|
+
if (aliases.includes(alias)) {
|
|
119
|
+
result.orgsFound.push(alias);
|
|
120
|
+
this.log(`✔ Org '${alias}' autenticada.`);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
result.orgsMissing.push(alias);
|
|
124
|
+
this.warn(`Org '${alias}' não encontrada. Execute: sf org login web --alias ${alias}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
this.warn('Não foi possível verificar as orgs. Execute "sf org list" para checar manualmente.');
|
|
130
|
+
}
|
|
131
|
+
// ── Resumo ─────────────────────────────────────────────────────────────
|
|
132
|
+
this.log('\n────────────────────────────────────────────────────────────');
|
|
133
|
+
if (result.orgsMissing.length === 0 && existsSync(baselinePath)) {
|
|
134
|
+
this.log('✔ Workspace pronto. Execute sf pypeline run para iniciar o pipeline.\n');
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
this.log(' Alguns itens precisam de atenção antes de rodar o pipeline:');
|
|
138
|
+
if (!existsSync(baselinePath)) {
|
|
139
|
+
this.log(' - Crie o baseline.txt: git rev-parse HEAD > baseline.txt');
|
|
140
|
+
}
|
|
141
|
+
for (const alias of result.orgsMissing) {
|
|
142
|
+
this.log(` - Autentique a org: sf org login web --alias ${alias}`);
|
|
143
|
+
}
|
|
144
|
+
this.log('');
|
|
145
|
+
}
|
|
146
|
+
return result;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/commands/pypeline/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;AASpE,MAAM,eAAe,GAAG;;;;;;;;;;;CAWvB,CAAC;AAEF,MAAM,gBAAgB,GAAG;IACvB,cAAc;IACd,eAAe;IACf,gCAAgC;IAChC,g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,GAAG,CAAC,EAAE,CAAC,CAAC;QACf,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export type PypelinePackageResult = {
|
|
3
|
+
success: boolean;
|
|
4
|
+
buildDir: string;
|
|
5
|
+
};
|
|
6
|
+
export default class PypelinePackage extends SfCommand<PypelinePackageResult> {
|
|
7
|
+
static readonly summary: string;
|
|
8
|
+
static readonly description: string;
|
|
9
|
+
static readonly examples: string[];
|
|
10
|
+
run(): Promise<PypelinePackageResult>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { Messages } from '@salesforce/core';
|
|
4
|
+
import { BUILD_DIR } from '../../config.js';
|
|
5
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
6
|
+
const messages = Messages.loadMessages('pypeline', 'pypeline.package');
|
|
7
|
+
export default class PypelinePackage extends SfCommand {
|
|
8
|
+
static summary = messages.getMessage('summary');
|
|
9
|
+
static description = messages.getMessage('description');
|
|
10
|
+
static examples = messages.getMessages('examples');
|
|
11
|
+
async run() {
|
|
12
|
+
const buildDir = BUILD_DIR();
|
|
13
|
+
this.log('Gerando package.xml...');
|
|
14
|
+
const exitCode = await new Promise((resolve) => {
|
|
15
|
+
const proc = spawn('sf', ['project', 'generate', 'manifest', '--source-dir', buildDir], {
|
|
16
|
+
stdio: 'inherit',
|
|
17
|
+
});
|
|
18
|
+
proc.on('close', (code) => resolve(code ?? 1));
|
|
19
|
+
});
|
|
20
|
+
if (exitCode !== 0) {
|
|
21
|
+
this.error('Falha ao gerar package.xml.');
|
|
22
|
+
}
|
|
23
|
+
this.log('package.xml gerado com sucesso.');
|
|
24
|
+
return { success: true, buildDir };
|
|
25
|
+
}
|
|
26
|
+
}
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CAAC,CAAC,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;QAEH,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;YACnB,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAC5C,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;QAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IACrC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export type PypelineQuickdeployResult = {
|
|
3
|
+
success: boolean;
|
|
4
|
+
jobId: string;
|
|
5
|
+
logPath: string;
|
|
6
|
+
};
|
|
7
|
+
export default class PypelineQuickdeploy extends SfCommand<PypelineQuickdeployResult> {
|
|
8
|
+
static readonly summary: string;
|
|
9
|
+
static readonly description: string;
|
|
10
|
+
static readonly examples: string[];
|
|
11
|
+
static readonly flags: {
|
|
12
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'job-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
wait: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'no-prompt': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<PypelineQuickdeployResult>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
4
|
+
import { Messages } from '@salesforce/core';
|
|
5
|
+
import { JOB_ID_FILE, LOG_QUICK_DEPLOY, fileExists, readFileTrimmed, unlinkIfExists, } from '../../config.js';
|
|
6
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
7
|
+
const messages = Messages.loadMessages('pypeline', 'pypeline.quickdeploy');
|
|
8
|
+
const JOB_ID_FORMAT = /^0Af[0-9A-Za-z]{15}$/;
|
|
9
|
+
const ERROR_PATTERN = /deploy failed|error|exception/i;
|
|
10
|
+
export default class PypelineQuickdeploy extends SfCommand {
|
|
11
|
+
static summary = messages.getMessage('summary');
|
|
12
|
+
static description = messages.getMessage('description');
|
|
13
|
+
static examples = messages.getMessages('examples');
|
|
14
|
+
static flags = {
|
|
15
|
+
'target-org': Flags.string({
|
|
16
|
+
summary: messages.getMessage('flags.target-org.summary'),
|
|
17
|
+
default: 'devops',
|
|
18
|
+
}),
|
|
19
|
+
'job-id': Flags.string({
|
|
20
|
+
char: 'j',
|
|
21
|
+
summary: messages.getMessage('flags.job-id.summary'),
|
|
22
|
+
}),
|
|
23
|
+
wait: Flags.integer({
|
|
24
|
+
char: 'w',
|
|
25
|
+
summary: messages.getMessage('flags.wait.summary'),
|
|
26
|
+
default: 240,
|
|
27
|
+
}),
|
|
28
|
+
'no-prompt': Flags.boolean({
|
|
29
|
+
summary: messages.getMessage('flags.no-prompt.summary'),
|
|
30
|
+
default: false,
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
async run() {
|
|
34
|
+
const { flags } = await this.parse(PypelineQuickdeploy);
|
|
35
|
+
const jobIdFile = JOB_ID_FILE();
|
|
36
|
+
const logPath = LOG_QUICK_DEPLOY();
|
|
37
|
+
this.log('');
|
|
38
|
+
this.log('╔══════════════════════════════════════════════╗');
|
|
39
|
+
this.log('║ QUICK DEPLOY EM PRODUÇÃO ║');
|
|
40
|
+
this.log('╚══════════════════════════════════════════════╝');
|
|
41
|
+
this.log('');
|
|
42
|
+
let jobId = flags['job-id'];
|
|
43
|
+
if (!jobId) {
|
|
44
|
+
if (!fileExists(jobIdFile)) {
|
|
45
|
+
this.error('prd_job_id.txt não encontrado. Execute sf pypeline run (ou sf pypeline validate prd) antes.');
|
|
46
|
+
}
|
|
47
|
+
jobId = readFileTrimmed(jobIdFile);
|
|
48
|
+
}
|
|
49
|
+
if (!jobId)
|
|
50
|
+
this.error('Job ID vazio. Nenhum Job ID disponível.');
|
|
51
|
+
if (!JOB_ID_FORMAT.test(jobId)) {
|
|
52
|
+
this.error(`Job ID com formato inválido: ${jobId}\nEsperado: 18 caracteres começando com 0Af`);
|
|
53
|
+
}
|
|
54
|
+
this.log(`[INFO] Job ID: ${jobId}`);
|
|
55
|
+
this.log('[INFO] Validate expira em 10 horas após a geração.');
|
|
56
|
+
this.log('');
|
|
57
|
+
this.log(` Org alvo : ${flags['target-org'] ?? 'devops'}`);
|
|
58
|
+
this.log(` Job ID : ${jobId}`);
|
|
59
|
+
this.log('');
|
|
60
|
+
if (!flags['no-prompt']) {
|
|
61
|
+
const confirmed = await this.confirm({ message: 'Confirma o quick deploy em PRODUÇÃO?' });
|
|
62
|
+
if (!confirmed) {
|
|
63
|
+
this.log('[CANCELADO] Quick deploy não executado.');
|
|
64
|
+
return { success: false, jobId, logPath };
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
unlinkIfExists(logPath);
|
|
68
|
+
this.log('[INFO] Iniciando quick deploy em PRD...');
|
|
69
|
+
const cmd = [
|
|
70
|
+
'project', 'deploy', 'quick',
|
|
71
|
+
'--job-id', jobId,
|
|
72
|
+
'--target-org', flags['target-org'] ?? 'devops',
|
|
73
|
+
'-w', String(flags['wait'] ?? 240),
|
|
74
|
+
'--verbose',
|
|
75
|
+
];
|
|
76
|
+
const exitCode = await new Promise((resolve) => {
|
|
77
|
+
const proc = spawn('sf', cmd, { stdio: ['inherit', 'pipe', 'pipe'] });
|
|
78
|
+
const log = fs.createWriteStream(logPath, { flags: 'a' });
|
|
79
|
+
const handle = (chunk, isErr = false) => {
|
|
80
|
+
const text = chunk.toString();
|
|
81
|
+
(isErr ? process.stderr : process.stdout).write(text);
|
|
82
|
+
log.write(text);
|
|
83
|
+
};
|
|
84
|
+
if (proc.stdout)
|
|
85
|
+
proc.stdout.on('data', (c) => handle(c));
|
|
86
|
+
if (proc.stderr)
|
|
87
|
+
proc.stderr.on('data', (c) => handle(c, true));
|
|
88
|
+
proc.on('close', (code) => { log.close(); resolve(code ?? 1); });
|
|
89
|
+
});
|
|
90
|
+
this.log('');
|
|
91
|
+
if (exitCode === 0) {
|
|
92
|
+
const logContent = fs.readFileSync(logPath, 'utf8');
|
|
93
|
+
if (ERROR_PATTERN.test(logContent)) {
|
|
94
|
+
this.log('╔══════════════════════════════════════════════╗');
|
|
95
|
+
this.log('║ [AVISO] Deploy concluído com warnings. ║');
|
|
96
|
+
this.log(`║ Verifique : ${logPath.split('/').pop()?.padEnd(32) ?? ''}║`);
|
|
97
|
+
this.log('╚══════════════════════════════════════════════╝');
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
unlinkIfExists(jobIdFile);
|
|
101
|
+
this.log('╔══════════════════════════════════════════════╗');
|
|
102
|
+
this.log('║ QUICK DEPLOY EM PRD CONCLUÍDO COM SUCESSO ║');
|
|
103
|
+
this.log('║ prd_job_id.txt removido (evita reuso) ║');
|
|
104
|
+
this.log('╚══════════════════════════════════════════════╝');
|
|
105
|
+
}
|
|
106
|
+
return { success: true, jobId, logPath };
|
|
107
|
+
}
|
|
108
|
+
this.log('╔══════════════════════════════════════════════╗');
|
|
109
|
+
this.log('║ [ERRO] Quick deploy falhou. ║');
|
|
110
|
+
this.log(`║ Exit code : ${String(exitCode).padEnd(32)}║`);
|
|
111
|
+
this.log(`║ Verifique : ${logPath.split('/').pop()?.padEnd(32) ?? ''}║`);
|
|
112
|
+
this.log('╚══════════════════════════════════════════════╝');
|
|
113
|
+
this.error(`Quick deploy falhou com exit code ${exitCode}.`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=quickdeploy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quickdeploy.js","sourceRoot":"","sources":["../../../src/commands/pype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ineUpdated: string | null;
|
|
6
|
+
};
|
|
7
|
+
export default class PypelineRun extends SfCommand<PypelineRunResult> {
|
|
8
|
+
static readonly summary: string;
|
|
9
|
+
static readonly description: string;
|
|
10
|
+
static readonly examples: string[];
|
|
11
|
+
static readonly flags: {
|
|
12
|
+
branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
training: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
'prd-org': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'training-org': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<PypelineRunResult>;
|
|
19
|
+
}
|