@docupace/pipeline 1.0.78 → 1.0.79
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/package.json +1 -1
- package/src/next/deploy.js +40 -7
package/package.json
CHANGED
package/src/next/deploy.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
1
2
|
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
3
|
import yaml from 'js-yaml';
|
|
4
|
-
import { $ } from 'zx';
|
|
5
4
|
import lodash from 'lodash';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import semver from 'semver';
|
|
7
|
+
import { $ } from 'zx';
|
|
6
8
|
import { appInfo, environmentConfig, getRepUrl } from './config.js';
|
|
7
9
|
import { copy2 } from './copy.js';
|
|
8
|
-
import axios from 'axios';
|
|
9
|
-
import { deployConnect, deployCore } from './jenkins.js';
|
|
10
10
|
import { gitDescribeToSemver } from './git-to-semver.js';
|
|
11
|
-
import
|
|
11
|
+
import { deployConnect, deployCore } from './jenkins.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Clone the repository, read the YAML file, and return the parsed data and file paths.
|
|
@@ -367,6 +367,35 @@ export async function deployAppWithTag(application, env, site, deployTag) {
|
|
|
367
367
|
console.log(`Using deployment tag: ${deployTag}`);
|
|
368
368
|
const appDetails = appInfo[application];
|
|
369
369
|
|
|
370
|
+
const repoPath = await cloneEnvRepository(env);
|
|
371
|
+
const { deployConfigFilePath: valuesFilePath } = getConfigPath(
|
|
372
|
+
application,
|
|
373
|
+
env,
|
|
374
|
+
site,
|
|
375
|
+
'values',
|
|
376
|
+
);
|
|
377
|
+
const { deployConfigFilePath: appFilePath } = getConfigPath(
|
|
378
|
+
application,
|
|
379
|
+
env,
|
|
380
|
+
site,
|
|
381
|
+
'app',
|
|
382
|
+
);
|
|
383
|
+
|
|
384
|
+
if (!fs.existsSync(valuesFilePath) || !fs.existsSync(appFilePath)) {
|
|
385
|
+
const missingFiles = [];
|
|
386
|
+
if (!fs.existsSync(valuesFilePath))
|
|
387
|
+
missingFiles.push(`${application}.values.yaml`);
|
|
388
|
+
if (!fs.existsSync(appFilePath))
|
|
389
|
+
missingFiles.push(`${application}.app.yaml`);
|
|
390
|
+
console.log(
|
|
391
|
+
`⚠️ Skipping deployment to ${site}: config file(s) missing: ${missingFiles.join(', ')}`,
|
|
392
|
+
);
|
|
393
|
+
console.log(
|
|
394
|
+
` This site may not be configured for ${application} application`,
|
|
395
|
+
);
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
|
|
370
399
|
if (env !== 'dev') {
|
|
371
400
|
await copy2(
|
|
372
401
|
appDetails.repositoryName,
|
|
@@ -377,8 +406,12 @@ export async function deployAppWithTag(application, env, site, deployTag) {
|
|
|
377
406
|
);
|
|
378
407
|
}
|
|
379
408
|
|
|
380
|
-
const {
|
|
381
|
-
|
|
409
|
+
const { deployConfig, deployConfigFilePath } = await readDeployConfig(
|
|
410
|
+
application,
|
|
411
|
+
env,
|
|
412
|
+
site,
|
|
413
|
+
'values',
|
|
414
|
+
);
|
|
382
415
|
const updatedConfigData = setTag(deployConfig, deployTag);
|
|
383
416
|
|
|
384
417
|
const {
|