@firestartr/cli 1.50.1-snapshot-41 → 1.50.1-snapshot-42
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/build/index.js +12 -62
- package/build/packages/importer/index.d.ts +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -303534,7 +303534,14 @@ async function loadInitializers(claim, initializersPath = config_getPath('initia
|
|
|
303534
303534
|
return loadedInitializers;
|
|
303535
303535
|
}
|
|
303536
303536
|
function loadClaimDefaults() {
|
|
303537
|
-
|
|
303537
|
+
try {
|
|
303538
|
+
return catalog_common.io.fromYaml(external_fs_.readFileSync(`${config_getPath('claimsDefaults')}/claims_defaults.yaml`, 'utf-8'));
|
|
303539
|
+
}
|
|
303540
|
+
catch (error) {
|
|
303541
|
+
const errMsg = `Could not read claims defaults file in path ${config_getPath('claimsDefaults')}/claims_defaults.yaml: ${error}`;
|
|
303542
|
+
cdk8s_renderer_src_logger.error(errMsg);
|
|
303543
|
+
throw new Error(`${errMsg}`);
|
|
303544
|
+
}
|
|
303538
303545
|
}
|
|
303539
303546
|
/*
|
|
303540
303547
|
* Using fast-json-patch, compares a claim to its kind's defaults, then patches it.
|
|
@@ -310865,16 +310872,12 @@ function compileReg(value) {
|
|
|
310865
310872
|
// gh-group: 'FirestartrGithubGroup',
|
|
310866
310873
|
// gh-repo: 'FirestartrGithubRepository',
|
|
310867
310874
|
// }
|
|
310868
|
-
async function runImporter(force,
|
|
310875
|
+
async function runImporter(force, skipPlan, claimsPath, crsPath, configPath, claimsDefaultsPath, org, filters, provider = AllowedProviders.all) {
|
|
310869
310876
|
configureProvider(provider);
|
|
310870
310877
|
let generatedFilters = [];
|
|
310871
310878
|
//gh-repo,REGEXP=.*vite.*
|
|
310872
310879
|
cdk8s_renderer.setPath('claimsDefaults', claimsDefaultsPath);
|
|
310873
310880
|
generatedFilters = buildFilters(filters, force, crsPath, generatedFilters);
|
|
310874
|
-
if (generateDefaults) {
|
|
310875
|
-
generateClaimsDefaults(org, claimsDefaultsPath);
|
|
310876
|
-
generateDefaultsFn(org, configPath);
|
|
310877
|
-
}
|
|
310878
310881
|
await importGithubGitopsRepository(org, skipPlan, claimsPath, crsPath, configPath, generatedFilters);
|
|
310879
310882
|
}
|
|
310880
310883
|
function buildFilters(filters, force, crsPath, generatedFilters) {
|
|
@@ -310910,11 +310913,6 @@ function createSkipFilters(filters) {
|
|
|
310910
310913
|
}
|
|
310911
310914
|
return filters;
|
|
310912
310915
|
}
|
|
310913
|
-
function generateDefaultsFn(org, defaultsPath) {
|
|
310914
|
-
generateDefaultsForGithubGroups(org, defaultsPath);
|
|
310915
|
-
generateDefaultsForGithubRepos(org, defaultsPath);
|
|
310916
|
-
generateDefaultsForGithubRepos(org, defaultsPath);
|
|
310917
|
-
}
|
|
310918
310916
|
function generateDefaultsForGithubGroups(org, defaultsPath) {
|
|
310919
310917
|
const defaultGroups = {
|
|
310920
310918
|
name: 'group_base',
|
|
@@ -310924,7 +310922,7 @@ function generateDefaultsForGithubGroups(org, defaultsPath) {
|
|
|
310924
310922
|
org: org,
|
|
310925
310923
|
},
|
|
310926
310924
|
};
|
|
310927
|
-
|
|
310925
|
+
common.io.writeYamlFile('defaults_github_group', defaultGroups, defaultsPath);
|
|
310928
310926
|
}
|
|
310929
310927
|
function generateDefaultsForGithubRepos(org, defaultsPath) {
|
|
310930
310928
|
const defaultRepos = {
|
|
@@ -310952,54 +310950,7 @@ function generateDefaultsForGithubRepos(org, defaultsPath) {
|
|
|
310952
310950
|
},
|
|
310953
310951
|
},
|
|
310954
310952
|
};
|
|
310955
|
-
|
|
310956
|
-
}
|
|
310957
|
-
function generateClaimsDefaults(org, defaultsPath) {
|
|
310958
|
-
const defaultClaims = {
|
|
310959
|
-
ComponentClaim: {
|
|
310960
|
-
version: '1.0',
|
|
310961
|
-
type: 'service',
|
|
310962
|
-
lifecycle: 'production',
|
|
310963
|
-
system: 'system:firestartr-test-system',
|
|
310964
|
-
maintainedBy: [],
|
|
310965
|
-
platformOwner: `group:${org}-all`,
|
|
310966
|
-
providers: {
|
|
310967
|
-
github: {
|
|
310968
|
-
org: org,
|
|
310969
|
-
branchStrategy: {
|
|
310970
|
-
name: 'trunkBasedDevelopment',
|
|
310971
|
-
defaultBranch: 'main',
|
|
310972
|
-
},
|
|
310973
|
-
orgPermissions: 'none',
|
|
310974
|
-
visibility: 'private',
|
|
310975
|
-
technology: {
|
|
310976
|
-
stack: 'none',
|
|
310977
|
-
version: 'none',
|
|
310978
|
-
},
|
|
310979
|
-
features: [],
|
|
310980
|
-
},
|
|
310981
|
-
},
|
|
310982
|
-
},
|
|
310983
|
-
GroupClaim: {
|
|
310984
|
-
providers: {
|
|
310985
|
-
github: {
|
|
310986
|
-
org: org,
|
|
310987
|
-
privacy: 'closed',
|
|
310988
|
-
},
|
|
310989
|
-
},
|
|
310990
|
-
},
|
|
310991
|
-
SystemClaim: {
|
|
310992
|
-
providers: {
|
|
310993
|
-
catalog: null,
|
|
310994
|
-
},
|
|
310995
|
-
},
|
|
310996
|
-
DomainClaim: {
|
|
310997
|
-
providers: {
|
|
310998
|
-
catalog: null,
|
|
310999
|
-
},
|
|
311000
|
-
},
|
|
311001
|
-
};
|
|
311002
|
-
catalog_common.io.writeYamlFile('claims_defaults', defaultClaims, defaultsPath);
|
|
310953
|
+
common.io.writeYamlFile('defaults_github_repository', defaultRepos, defaultsPath);
|
|
311003
310954
|
}
|
|
311004
310955
|
|
|
311005
310956
|
;// CONCATENATED MODULE: ./src/subcommands/importer-subcommands.ts
|
|
@@ -311009,7 +310960,6 @@ const importSubcommand = {
|
|
|
311009
310960
|
requiredEnv: [],
|
|
311010
310961
|
subparameters: [
|
|
311011
310962
|
{ name: 'force', type: Boolean },
|
|
311012
|
-
{ name: 'generateDefaults', type: Boolean },
|
|
311013
310963
|
{ name: 'skipPlan', type: Boolean },
|
|
311014
310964
|
{ name: 'claims', type: String },
|
|
311015
310965
|
{ name: 'crs', type: String },
|
|
@@ -311020,7 +310970,7 @@ const importSubcommand = {
|
|
|
311020
310970
|
],
|
|
311021
310971
|
run: async (options) => {
|
|
311022
310972
|
console.table(options);
|
|
311023
|
-
await runImporter(options.force, options.
|
|
310973
|
+
await runImporter(options.force, options.skipPlan, options.claims, options.crs, options.config, options.claimsDefaults, options.org, options.filters);
|
|
311024
310974
|
},
|
|
311025
310975
|
};
|
|
311026
310976
|
|
|
@@ -6,4 +6,4 @@ declare const _default: {
|
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
8
|
import { AllowedProviders } from 'cdk8s_renderer';
|
|
9
|
-
export declare function runImporter(force: boolean,
|
|
9
|
+
export declare function runImporter(force: boolean, skipPlan: boolean, claimsPath: string, crsPath: string, configPath: string, claimsDefaultsPath: string, org: string, filters: string[], provider?: AllowedProviders): Promise<void>;
|