@catladder/cli 0.0.0-perf-cli-reduce-bundle-size-with-tsconfig-optimization-c14723ff → 0.0.0-perf-cli-reduce-bundle-size-with-tsconfig-optimization-3556aaa4
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/CONTRIBUTING.md +3 -86
- package/README.md +6 -29
- package/dist/bundles/catenv/index.js +40 -32
- package/dist/bundles/cli/index.js +40 -32
- package/dist/pipeline/src/pipeline/generatePipelineFiles.d.ts +38 -0
- package/dist/pipeline/src/pipeline/generatePipelineFiles.js +40 -32
- package/dist/pipeline/src/pipeline/generatePipelineFiles.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -3
package/CONTRIBUTING.md
CHANGED
|
@@ -1,88 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
# Contribution
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[See contribution guide][docs-contribute].
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- Contain exactly one self-contained functional change
|
|
8
|
-
- Not depend on changes in one of your later commits
|
|
9
|
-
- Not create an inconsistent state (such as test errors, linting errors, partial fix, feature with documentation etc…)
|
|
10
|
-
|
|
11
|
-
A complex feature can be broken down into multiple commits as long as each one maintains a consistent state and consists of a self-contained change.
|
|
12
|
-
|
|
13
|
-
#### Commit message format
|
|
14
|
-
|
|
15
|
-
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, a **scope** and a **subject**:
|
|
16
|
-
|
|
17
|
-
```commit
|
|
18
|
-
<type>(<scope>): <subject>
|
|
19
|
-
<BLANK LINE>
|
|
20
|
-
<body>
|
|
21
|
-
<BLANK LINE>
|
|
22
|
-
<footer>
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
The **header** is mandatory and the **scope** of the header is optional.
|
|
26
|
-
|
|
27
|
-
The **footer** can contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages).
|
|
28
|
-
|
|
29
|
-
#### Revert
|
|
30
|
-
|
|
31
|
-
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit.
|
|
32
|
-
In the body, it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
|
|
33
|
-
|
|
34
|
-
#### Type
|
|
35
|
-
|
|
36
|
-
The type must be one of the following:
|
|
37
|
-
|
|
38
|
-
| Type | Description |
|
|
39
|
-
| ------------ | ----------------------------------------------------------------------------------------------------------- |
|
|
40
|
-
| **build** | Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) |
|
|
41
|
-
| **ci** | Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) |
|
|
42
|
-
| **docs** | Documentation only changes |
|
|
43
|
-
| **feat** | A new feature |
|
|
44
|
-
| **fix** | A bug fix |
|
|
45
|
-
| **perf** | A code change that improves performance |
|
|
46
|
-
| **refactor** | A code change that neither fixes a bug nor adds a feature |
|
|
47
|
-
| **style** | Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc) |
|
|
48
|
-
| **test** | Adding missing tests or correcting existing tests |
|
|
49
|
-
|
|
50
|
-
#### Subject
|
|
51
|
-
|
|
52
|
-
The subject contains a succinct description of the change:
|
|
53
|
-
|
|
54
|
-
- use the imperative, present tense: "change" not "changed" nor "changes"
|
|
55
|
-
- don't capitalize the first letter
|
|
56
|
-
- no dot (.) at the end
|
|
57
|
-
|
|
58
|
-
#### Body
|
|
59
|
-
|
|
60
|
-
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
|
|
61
|
-
The body should include the motivation for the change and contrast this with previous behaviour.
|
|
62
|
-
|
|
63
|
-
#### Footer
|
|
64
|
-
|
|
65
|
-
The footer should contain any information about **Breaking Changes** and is also the place to reference GitLab issues that this commit **Closes**.
|
|
66
|
-
|
|
67
|
-
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines.
|
|
68
|
-
The rest of the commit message is then used for this.
|
|
69
|
-
|
|
70
|
-
#### Examples
|
|
71
|
-
|
|
72
|
-
```commit
|
|
73
|
-
`fix(pencil): stop graphite breaking when too much pressure applied`
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
```commit
|
|
77
|
-
`feat(pencil): add 'graphiteWidth' option`
|
|
78
|
-
|
|
79
|
-
Fix #42
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
```commit
|
|
83
|
-
perf(pencil): remove graphiteWidth option`
|
|
84
|
-
|
|
85
|
-
BREAKING CHANGE: The graphiteWidth option has been removed.
|
|
86
|
-
|
|
87
|
-
The default graphite width of 10mm is always used for performance reasons.
|
|
88
|
-
```
|
|
5
|
+
[docs-contribute]: https://catladder.git.panter.biz/catladder/docs/contribute "Contribution guide"
|
package/README.md
CHANGED
|
@@ -1,41 +1,18 @@
|
|
|
1
1
|
# catladder 🐱 🔧
|
|
2
2
|
|
|
3
|
-
Panter cli tool for
|
|
3
|
+
[Panter](https://panter.ch) cli tool for cloud CI/CD and DevOps.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
# yarn users
|
|
9
|
-
yarn global add @catladder/cli
|
|
10
|
-
# npm users
|
|
11
|
-
npm install -g @catladder/cli
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
> **Note**: If you have [@catladder/pipeline](https://www.npmjs.com/package/@catladder/pipeline) installed, upgrade it to >=4.0.0 before installing [@catladder/cli](https://www.npmjs.com/package/@catladder/cli).
|
|
5
|
+
**It just works™**
|
|
15
6
|
|
|
16
7
|
## Getting started
|
|
17
8
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- Google Cloud SDK ([see installation instructions](https://cloud.google.com/sdk/docs/install))
|
|
21
|
-
- Kubectl ([see installation instructions](https://kubernetes.io/docs/tasks/tools/))
|
|
22
|
-
- Cloud SQL Auth proxy ([see installation instructions](https://cloud.google.com/sql/docs/postgres/sql-proxy#install))
|
|
23
|
-
|
|
24
|
-
Afterwards, you need to connect to your cluster, e.g. `gcloud container clusters get-credentials clustername --zone google-zone --project google-project-id`
|
|
25
|
-
In most cases, you'll find the details on the Google Cloud [cluster overview ](https://console.cloud.google.com/kubernetes/list?project=skynet-164509)
|
|
9
|
+
[See the documentation][docs-getting-started].
|
|
26
10
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## Preferences
|
|
30
|
-
|
|
31
|
-
Catladder stores some preferences in `~/.catladder/preferences.yml` in case you want to change settings.
|
|
11
|
+
[docs-getting-started]: https://catladder.git.panter.biz/catladder/docs/getting_started "Getting started"
|
|
32
12
|
|
|
33
13
|
## Contribution
|
|
34
14
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
### Adding packages in cli
|
|
15
|
+
[See contribution guide][docs-contribute].
|
|
38
16
|
|
|
39
|
-
|
|
17
|
+
[docs-contribute]: https://catladder.git.panter.biz/catladder/docs/contribute "Contribution guide"
|
|
40
18
|
|
|
41
|
-
the reason is that we bundle all dependencies in the cli package, so that if you add that to your project, it won't install all @catladder/cli's dependencies.
|
|
@@ -5446,46 +5446,54 @@ function getGitlabRulesForTrigger(trigger) {
|
|
|
5446
5446
|
"use strict";
|
|
5447
5447
|
|
|
5448
5448
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5449
|
-
exports.generatePipelineFiles = void 0;
|
|
5449
|
+
exports.generatePipelineFiles = exports.generateLocalPipelineContent = exports.generateChildPipelineContent = void 0;
|
|
5450
5450
|
const writeFiles_1 = __nccwpck_require__(2228);
|
|
5451
5451
|
const createChildPipeline_1 = __nccwpck_require__(5139);
|
|
5452
5452
|
const createMainPipeline_1 = __nccwpck_require__(9192);
|
|
5453
5453
|
const getPipelineTriggerForGitlabChildPipeline_1 = __nccwpck_require__(7426);
|
|
5454
5454
|
const sortGitLabJobDefProps_1 = __nccwpck_require__(2361);
|
|
5455
|
+
async function generateChildPipelineContent(config, pipelineType) {
|
|
5456
|
+
const trigger = (0, getPipelineTriggerForGitlabChildPipeline_1.getPipelineTriggerForGitlabChildPipeline)();
|
|
5457
|
+
const { jobs, image, stages, variables, workflow, ...pipelineRest } = await (0, createChildPipeline_1.createChildPipeline)(pipelineType, trigger, config);
|
|
5458
|
+
const jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(([jobName, job]) => [
|
|
5459
|
+
jobName,
|
|
5460
|
+
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
5461
|
+
]));
|
|
5462
|
+
return {
|
|
5463
|
+
image,
|
|
5464
|
+
stages,
|
|
5465
|
+
variables,
|
|
5466
|
+
workflow,
|
|
5467
|
+
...pipelineRest,
|
|
5468
|
+
// jobs need to be spread into main YAML, because GitLab pipeline YAML has no jobs key - jobs are top level with their key as their name
|
|
5469
|
+
...jobsWithSortedProps,
|
|
5470
|
+
};
|
|
5471
|
+
}
|
|
5472
|
+
exports.generateChildPipelineContent = generateChildPipelineContent;
|
|
5473
|
+
async function generateLocalPipelineContent(config, pipelineType) {
|
|
5474
|
+
const { jobs, image, stages, variables, workflow, ...pipelineRest } = await (0, createMainPipeline_1.createMainPipeline)(pipelineType, config);
|
|
5475
|
+
const jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(([jobName, job]) => [
|
|
5476
|
+
jobName,
|
|
5477
|
+
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
5478
|
+
]));
|
|
5479
|
+
return {
|
|
5480
|
+
image,
|
|
5481
|
+
stages,
|
|
5482
|
+
variables,
|
|
5483
|
+
workflow,
|
|
5484
|
+
...pipelineRest,
|
|
5485
|
+
// jobs need to be spread into main YAML, because GitLab pipeline YAML has no jobs key - jobs are top level with their key as their name
|
|
5486
|
+
...jobsWithSortedProps,
|
|
5487
|
+
};
|
|
5488
|
+
}
|
|
5489
|
+
exports.generateLocalPipelineContent = generateLocalPipelineContent;
|
|
5455
5490
|
async function generatePipelineFiles(config, pipelineType, mode) {
|
|
5456
5491
|
if (mode === "childpipeline") {
|
|
5457
|
-
const
|
|
5458
|
-
|
|
5459
|
-
const jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(([jobName, job]) => [
|
|
5460
|
-
jobName,
|
|
5461
|
-
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
5462
|
-
]));
|
|
5463
|
-
await (0, writeFiles_1.writeYamlfile)(`__pipeline.yml`, {
|
|
5464
|
-
image,
|
|
5465
|
-
stages,
|
|
5466
|
-
variables,
|
|
5467
|
-
workflow,
|
|
5468
|
-
...pipelineRest,
|
|
5469
|
-
// jobs need to be spread into main YAML, because GitLab pipeline YAML has no jobs key - jobs are top level with their key as their name
|
|
5470
|
-
...jobsWithSortedProps,
|
|
5471
|
-
});
|
|
5472
|
-
}
|
|
5473
|
-
else {
|
|
5474
|
-
const { jobs, image, stages, variables, workflow, ...pipelineRest } = await (0, createMainPipeline_1.createMainPipeline)(pipelineType, config);
|
|
5475
|
-
const jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(([jobName, job]) => [
|
|
5476
|
-
jobName,
|
|
5477
|
-
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
5478
|
-
]));
|
|
5479
|
-
await (0, writeFiles_1.writeYamlfile)(`.gitlab-ci.yml`, {
|
|
5480
|
-
image,
|
|
5481
|
-
stages,
|
|
5482
|
-
variables,
|
|
5483
|
-
workflow,
|
|
5484
|
-
...pipelineRest,
|
|
5485
|
-
// jobs need to be spread into main YAML, because GitLab pipeline YAML has no jobs key - jobs are top level with their key as their name
|
|
5486
|
-
...jobsWithSortedProps,
|
|
5487
|
-
});
|
|
5492
|
+
const pipelineContent = await generateChildPipelineContent(config, pipelineType);
|
|
5493
|
+
return (0, writeFiles_1.writeYamlfile)(`__pipeline.yml`, pipelineContent);
|
|
5488
5494
|
}
|
|
5495
|
+
const pipelineContent = await generateLocalPipelineContent(config, pipelineType);
|
|
5496
|
+
return (0, writeFiles_1.writeYamlfile)(`.gitlab-ci.yml`, pipelineContent);
|
|
5489
5497
|
}
|
|
5490
5498
|
exports.generatePipelineFiles = generatePipelineFiles;
|
|
5491
5499
|
//# sourceMappingURL=generatePipelineFiles.js.map
|
|
@@ -8614,46 +8614,54 @@ function getGitlabRulesForTrigger(trigger) {
|
|
|
8614
8614
|
"use strict";
|
|
8615
8615
|
|
|
8616
8616
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8617
|
-
exports.generatePipelineFiles = void 0;
|
|
8617
|
+
exports.generatePipelineFiles = exports.generateLocalPipelineContent = exports.generateChildPipelineContent = void 0;
|
|
8618
8618
|
const writeFiles_1 = __nccwpck_require__(92228);
|
|
8619
8619
|
const createChildPipeline_1 = __nccwpck_require__(55139);
|
|
8620
8620
|
const createMainPipeline_1 = __nccwpck_require__(39192);
|
|
8621
8621
|
const getPipelineTriggerForGitlabChildPipeline_1 = __nccwpck_require__(7426);
|
|
8622
8622
|
const sortGitLabJobDefProps_1 = __nccwpck_require__(72361);
|
|
8623
|
+
async function generateChildPipelineContent(config, pipelineType) {
|
|
8624
|
+
const trigger = (0, getPipelineTriggerForGitlabChildPipeline_1.getPipelineTriggerForGitlabChildPipeline)();
|
|
8625
|
+
const { jobs, image, stages, variables, workflow, ...pipelineRest } = await (0, createChildPipeline_1.createChildPipeline)(pipelineType, trigger, config);
|
|
8626
|
+
const jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(([jobName, job]) => [
|
|
8627
|
+
jobName,
|
|
8628
|
+
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
8629
|
+
]));
|
|
8630
|
+
return {
|
|
8631
|
+
image,
|
|
8632
|
+
stages,
|
|
8633
|
+
variables,
|
|
8634
|
+
workflow,
|
|
8635
|
+
...pipelineRest,
|
|
8636
|
+
// jobs need to be spread into main YAML, because GitLab pipeline YAML has no jobs key - jobs are top level with their key as their name
|
|
8637
|
+
...jobsWithSortedProps,
|
|
8638
|
+
};
|
|
8639
|
+
}
|
|
8640
|
+
exports.generateChildPipelineContent = generateChildPipelineContent;
|
|
8641
|
+
async function generateLocalPipelineContent(config, pipelineType) {
|
|
8642
|
+
const { jobs, image, stages, variables, workflow, ...pipelineRest } = await (0, createMainPipeline_1.createMainPipeline)(pipelineType, config);
|
|
8643
|
+
const jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(([jobName, job]) => [
|
|
8644
|
+
jobName,
|
|
8645
|
+
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
8646
|
+
]));
|
|
8647
|
+
return {
|
|
8648
|
+
image,
|
|
8649
|
+
stages,
|
|
8650
|
+
variables,
|
|
8651
|
+
workflow,
|
|
8652
|
+
...pipelineRest,
|
|
8653
|
+
// jobs need to be spread into main YAML, because GitLab pipeline YAML has no jobs key - jobs are top level with their key as their name
|
|
8654
|
+
...jobsWithSortedProps,
|
|
8655
|
+
};
|
|
8656
|
+
}
|
|
8657
|
+
exports.generateLocalPipelineContent = generateLocalPipelineContent;
|
|
8623
8658
|
async function generatePipelineFiles(config, pipelineType, mode) {
|
|
8624
8659
|
if (mode === "childpipeline") {
|
|
8625
|
-
const
|
|
8626
|
-
|
|
8627
|
-
const jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(([jobName, job]) => [
|
|
8628
|
-
jobName,
|
|
8629
|
-
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
8630
|
-
]));
|
|
8631
|
-
await (0, writeFiles_1.writeYamlfile)(`__pipeline.yml`, {
|
|
8632
|
-
image,
|
|
8633
|
-
stages,
|
|
8634
|
-
variables,
|
|
8635
|
-
workflow,
|
|
8636
|
-
...pipelineRest,
|
|
8637
|
-
// jobs need to be spread into main YAML, because GitLab pipeline YAML has no jobs key - jobs are top level with their key as their name
|
|
8638
|
-
...jobsWithSortedProps,
|
|
8639
|
-
});
|
|
8640
|
-
}
|
|
8641
|
-
else {
|
|
8642
|
-
const { jobs, image, stages, variables, workflow, ...pipelineRest } = await (0, createMainPipeline_1.createMainPipeline)(pipelineType, config);
|
|
8643
|
-
const jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(([jobName, job]) => [
|
|
8644
|
-
jobName,
|
|
8645
|
-
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
8646
|
-
]));
|
|
8647
|
-
await (0, writeFiles_1.writeYamlfile)(`.gitlab-ci.yml`, {
|
|
8648
|
-
image,
|
|
8649
|
-
stages,
|
|
8650
|
-
variables,
|
|
8651
|
-
workflow,
|
|
8652
|
-
...pipelineRest,
|
|
8653
|
-
// jobs need to be spread into main YAML, because GitLab pipeline YAML has no jobs key - jobs are top level with their key as their name
|
|
8654
|
-
...jobsWithSortedProps,
|
|
8655
|
-
});
|
|
8660
|
+
const pipelineContent = await generateChildPipelineContent(config, pipelineType);
|
|
8661
|
+
return (0, writeFiles_1.writeYamlfile)(`__pipeline.yml`, pipelineContent);
|
|
8656
8662
|
}
|
|
8663
|
+
const pipelineContent = await generateLocalPipelineContent(config, pipelineType);
|
|
8664
|
+
return (0, writeFiles_1.writeYamlfile)(`.gitlab-ci.yml`, pipelineContent);
|
|
8657
8665
|
}
|
|
8658
8666
|
exports.generatePipelineFiles = generatePipelineFiles;
|
|
8659
8667
|
//# sourceMappingURL=generatePipelineFiles.js.map
|
|
@@ -1,2 +1,40 @@
|
|
|
1
1
|
import type { Config, PipelineMode, PipelineType } from "../types";
|
|
2
|
+
export declare function generateChildPipelineContent<T extends PipelineType>(config: Config, pipelineType: T): Promise<{
|
|
3
|
+
image: string;
|
|
4
|
+
stages: string[];
|
|
5
|
+
variables: import("../types/gitlab-ci-yml").JobVariables1;
|
|
6
|
+
workflow: {
|
|
7
|
+
rules: {
|
|
8
|
+
if?: string;
|
|
9
|
+
changes?: import("../types/gitlab-ci-yml").Changes;
|
|
10
|
+
exists?: import("../types/gitlab-ci-yml").Exists;
|
|
11
|
+
variables?: import("../types/gitlab-ci-yml").RulesVariables;
|
|
12
|
+
when?: import("../types/gitlab-ci-yml").When;
|
|
13
|
+
start_in?: string;
|
|
14
|
+
allow_failure?: import("../types/gitlab-ci-yml").AllowFailure;
|
|
15
|
+
needs?: import("../types/gitlab-ci-yml").RulesNeeds;
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
} & Omit<import("../types").Pipeline<T>, "image" | "jobs" | "variables" | "workflow" | "stages"> & {
|
|
19
|
+
[k: string]: import("../types").GitlabJobDef;
|
|
20
|
+
}>;
|
|
21
|
+
export declare function generateLocalPipelineContent<T extends PipelineType>(config: Config, pipelineType: T): Promise<{
|
|
22
|
+
image: string;
|
|
23
|
+
stages: string[];
|
|
24
|
+
variables: import("../types/gitlab-ci-yml").JobVariables1;
|
|
25
|
+
workflow: {
|
|
26
|
+
rules: {
|
|
27
|
+
if?: string;
|
|
28
|
+
changes?: import("../types/gitlab-ci-yml").Changes;
|
|
29
|
+
exists?: import("../types/gitlab-ci-yml").Exists;
|
|
30
|
+
variables?: import("../types/gitlab-ci-yml").RulesVariables;
|
|
31
|
+
when?: import("../types/gitlab-ci-yml").When;
|
|
32
|
+
start_in?: string;
|
|
33
|
+
allow_failure?: import("../types/gitlab-ci-yml").AllowFailure;
|
|
34
|
+
needs?: import("../types/gitlab-ci-yml").RulesNeeds;
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
37
|
+
} & Omit<import("../types").Pipeline<T>, "image" | "jobs" | "variables" | "workflow" | "stages"> & {
|
|
38
|
+
[k: string]: import("../types").GitlabJobDef;
|
|
39
|
+
}>;
|
|
2
40
|
export declare function generatePipelineFiles<T extends PipelineType>(config: Config, pipelineType: T, mode: PipelineMode<T>): Promise<void>;
|
|
@@ -1,45 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generatePipelineFiles = void 0;
|
|
3
|
+
exports.generatePipelineFiles = exports.generateLocalPipelineContent = exports.generateChildPipelineContent = void 0;
|
|
4
4
|
const writeFiles_1 = require("../utils/writeFiles");
|
|
5
5
|
const createChildPipeline_1 = require("./createChildPipeline");
|
|
6
6
|
const createMainPipeline_1 = require("./createMainPipeline");
|
|
7
7
|
const getPipelineTriggerForGitlabChildPipeline_1 = require("./gitlab/getPipelineTriggerForGitlabChildPipeline");
|
|
8
8
|
const sortGitLabJobDefProps_1 = require("./gitlab/sortGitLabJobDefProps");
|
|
9
|
+
async function generateChildPipelineContent(config, pipelineType) {
|
|
10
|
+
const trigger = (0, getPipelineTriggerForGitlabChildPipeline_1.getPipelineTriggerForGitlabChildPipeline)();
|
|
11
|
+
const { jobs, image, stages, variables, workflow, ...pipelineRest } = await (0, createChildPipeline_1.createChildPipeline)(pipelineType, trigger, config);
|
|
12
|
+
const jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(([jobName, job]) => [
|
|
13
|
+
jobName,
|
|
14
|
+
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
15
|
+
]));
|
|
16
|
+
return {
|
|
17
|
+
image,
|
|
18
|
+
stages,
|
|
19
|
+
variables,
|
|
20
|
+
workflow,
|
|
21
|
+
...pipelineRest,
|
|
22
|
+
// jobs need to be spread into main YAML, because GitLab pipeline YAML has no jobs key - jobs are top level with their key as their name
|
|
23
|
+
...jobsWithSortedProps,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
exports.generateChildPipelineContent = generateChildPipelineContent;
|
|
27
|
+
async function generateLocalPipelineContent(config, pipelineType) {
|
|
28
|
+
const { jobs, image, stages, variables, workflow, ...pipelineRest } = await (0, createMainPipeline_1.createMainPipeline)(pipelineType, config);
|
|
29
|
+
const jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(([jobName, job]) => [
|
|
30
|
+
jobName,
|
|
31
|
+
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
32
|
+
]));
|
|
33
|
+
return {
|
|
34
|
+
image,
|
|
35
|
+
stages,
|
|
36
|
+
variables,
|
|
37
|
+
workflow,
|
|
38
|
+
...pipelineRest,
|
|
39
|
+
// jobs need to be spread into main YAML, because GitLab pipeline YAML has no jobs key - jobs are top level with their key as their name
|
|
40
|
+
...jobsWithSortedProps,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
exports.generateLocalPipelineContent = generateLocalPipelineContent;
|
|
9
44
|
async function generatePipelineFiles(config, pipelineType, mode) {
|
|
10
45
|
if (mode === "childpipeline") {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(([jobName, job]) => [
|
|
14
|
-
jobName,
|
|
15
|
-
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
16
|
-
]));
|
|
17
|
-
await (0, writeFiles_1.writeYamlfile)(`__pipeline.yml`, {
|
|
18
|
-
image,
|
|
19
|
-
stages,
|
|
20
|
-
variables,
|
|
21
|
-
workflow,
|
|
22
|
-
...pipelineRest,
|
|
23
|
-
// jobs need to be spread into main YAML, because GitLab pipeline YAML has no jobs key - jobs are top level with their key as their name
|
|
24
|
-
...jobsWithSortedProps,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
const { jobs, image, stages, variables, workflow, ...pipelineRest } = await (0, createMainPipeline_1.createMainPipeline)(pipelineType, config);
|
|
29
|
-
const jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(([jobName, job]) => [
|
|
30
|
-
jobName,
|
|
31
|
-
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
32
|
-
]));
|
|
33
|
-
await (0, writeFiles_1.writeYamlfile)(`.gitlab-ci.yml`, {
|
|
34
|
-
image,
|
|
35
|
-
stages,
|
|
36
|
-
variables,
|
|
37
|
-
workflow,
|
|
38
|
-
...pipelineRest,
|
|
39
|
-
// jobs need to be spread into main YAML, because GitLab pipeline YAML has no jobs key - jobs are top level with their key as their name
|
|
40
|
-
...jobsWithSortedProps,
|
|
41
|
-
});
|
|
46
|
+
const pipelineContent = await generateChildPipelineContent(config, pipelineType);
|
|
47
|
+
return (0, writeFiles_1.writeYamlfile)(`__pipeline.yml`, pipelineContent);
|
|
42
48
|
}
|
|
49
|
+
const pipelineContent = await generateLocalPipelineContent(config, pipelineType);
|
|
50
|
+
return (0, writeFiles_1.writeYamlfile)(`.gitlab-ci.yml`, pipelineContent);
|
|
43
51
|
}
|
|
44
52
|
exports.generatePipelineFiles = generatePipelineFiles;
|
|
45
53
|
//# sourceMappingURL=generatePipelineFiles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePipelineFiles.js","sourceRoot":"","sources":["../../../../../pipeline/src/pipeline/generatePipelineFiles.ts"],"names":[],"mappings":";;;AACA,oDAAoD;AACpD,+DAA4D;AAC5D,6DAA0D;AAC1D,gHAA6G;AAC7G,0EAAuE;
|
|
1
|
+
{"version":3,"file":"generatePipelineFiles.js","sourceRoot":"","sources":["../../../../../pipeline/src/pipeline/generatePipelineFiles.ts"],"names":[],"mappings":";;;AACA,oDAAoD;AACpD,+DAA4D;AAC5D,6DAA0D;AAC1D,gHAA6G;AAC7G,0EAAuE;AAEhE,KAAK,UAAU,4BAA4B,CAChD,MAAc,EACd,YAAe;IAEf,MAAM,OAAO,GAAG,IAAA,mFAAwC,GAAE,CAAC;IAC3D,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,YAAY,EAAE,GACjE,MAAM,IAAA,yCAAmB,EAAC,YAAY,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAE3D,MAAM,mBAAmB,GAAG,MAAM,CAAC,WAAW,CAC5C,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;QAC3C,OAAO;QACP,IAAA,6CAAqB,EAAC,GAAG,CAAC;KAC3B,CAAC,CACH,CAAC;IAEF,OAAO;QACL,KAAK;QACL,MAAM;QACN,SAAS;QACT,QAAQ;QACR,GAAG,YAAY;QACf,wIAAwI;QACxI,GAAG,mBAAmB;KACvB,CAAC;AACJ,CAAC;AAxBD,oEAwBC;AAEM,KAAK,UAAU,4BAA4B,CAChD,MAAc,EACd,YAAe;IAEf,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,YAAY,EAAE,GACjE,MAAM,IAAA,uCAAkB,EAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAEjD,MAAM,mBAAmB,GAAG,MAAM,CAAC,WAAW,CAC5C,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;QAC3C,OAAO;QACP,IAAA,6CAAqB,EAAC,GAAG,CAAC;KAC3B,CAAC,CACH,CAAC;IAEF,OAAO;QACL,KAAK;QACL,MAAM;QACN,SAAS;QACT,QAAQ;QACR,GAAG,YAAY;QACf,wIAAwI;QACxI,GAAG,mBAAmB;KACvB,CAAC;AACJ,CAAC;AAvBD,oEAuBC;AAEM,KAAK,UAAU,qBAAqB,CACzC,MAAc,EACd,YAAe,EACf,IAAqB;IAErB,IAAI,IAAI,KAAK,eAAe,EAAE,CAAC;QAC7B,MAAM,eAAe,GAAG,MAAM,4BAA4B,CACxD,MAAM,EACN,YAAY,CACb,CAAC;QACF,OAAO,IAAA,0BAAa,EAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;IAC1D,CAAC;IACD,MAAM,eAAe,GAAG,MAAM,4BAA4B,CACxD,MAAM,EACN,YAAY,CACb,CAAC;IACF,OAAO,IAAA,0BAAa,EAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;AAC1D,CAAC;AAjBD,sDAiBC"}
|