@catladder/cli 0.0.0-fix-resolve-secrets-type-557efb2a → 0.0.0-fix-test-name-b238fb82
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 +41 -19
- package/dist/bundles/cli/index.js +41 -19
- package/dist/pipeline/src/build/types.d.ts +6 -0
- package/dist/pipeline/src/build/types.js.map +1 -1
- package/dist/pipeline/src/pipeline/generatePipelineFiles.d.ts +38 -0
- package/dist/pipeline/src/pipeline/generatePipelineFiles.js +41 -19
- 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.
|
|
@@ -8511,23 +8511,22 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
8511
8511
|
return ar;
|
|
8512
8512
|
};
|
|
8513
8513
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8514
|
-
exports.generatePipelineFiles = void 0;
|
|
8514
|
+
exports.generatePipelineFiles = exports.generateLocalPipelineContent = exports.generateChildPipelineContent = void 0;
|
|
8515
8515
|
var writeFiles_1 = __nccwpck_require__(2228);
|
|
8516
8516
|
var createChildPipeline_1 = __nccwpck_require__(5139);
|
|
8517
8517
|
var createMainPipeline_1 = __nccwpck_require__(9192);
|
|
8518
8518
|
var getPipelineTriggerForGitlabChildPipeline_1 = __nccwpck_require__(7426);
|
|
8519
8519
|
var sortGitLabJobDefProps_1 = __nccwpck_require__(2361);
|
|
8520
|
-
function
|
|
8520
|
+
function generateChildPipelineContent(config, pipelineType) {
|
|
8521
8521
|
return __awaiter(this, void 0, void 0, function () {
|
|
8522
|
-
var trigger, _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps
|
|
8523
|
-
return __generator(this, function (
|
|
8524
|
-
switch (
|
|
8522
|
+
var trigger, _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps;
|
|
8523
|
+
return __generator(this, function (_b) {
|
|
8524
|
+
switch (_b.label) {
|
|
8525
8525
|
case 0:
|
|
8526
|
-
if (!(mode === "childpipeline")) return [3 /*break*/, 3];
|
|
8527
8526
|
trigger = (0, getPipelineTriggerForGitlabChildPipeline_1.getPipelineTriggerForGitlabChildPipeline)();
|
|
8528
8527
|
return [4 /*yield*/, (0, createChildPipeline_1.createChildPipeline)(pipelineType, trigger, config)];
|
|
8529
8528
|
case 1:
|
|
8530
|
-
_a =
|
|
8529
|
+
_a = _b.sent(), jobs = _a.jobs, image = _a.image, stages = _a.stages, variables = _a.variables, workflow = _a.workflow, pipelineRest = __rest(_a, ["jobs", "image", "stages", "variables", "workflow"]);
|
|
8531
8530
|
jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(function (_a) {
|
|
8532
8531
|
var _b = __read(_a, 2), jobName = _b[0], job = _b[1];
|
|
8533
8532
|
return [
|
|
@@ -8535,13 +8534,20 @@ function generatePipelineFiles(config, pipelineType, mode) {
|
|
|
8535
8534
|
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
8536
8535
|
];
|
|
8537
8536
|
}));
|
|
8538
|
-
return [
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8537
|
+
return [2 /*return*/, __assign(__assign({ image: image, stages: stages, variables: variables, workflow: workflow }, pipelineRest), jobsWithSortedProps)];
|
|
8538
|
+
}
|
|
8539
|
+
});
|
|
8540
|
+
});
|
|
8541
|
+
}
|
|
8542
|
+
exports.generateChildPipelineContent = generateChildPipelineContent;
|
|
8543
|
+
function generateLocalPipelineContent(config, pipelineType) {
|
|
8544
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8545
|
+
var _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps;
|
|
8546
|
+
return __generator(this, function (_b) {
|
|
8547
|
+
switch (_b.label) {
|
|
8548
|
+
case 0: return [4 /*yield*/, (0, createMainPipeline_1.createMainPipeline)(pipelineType, config)];
|
|
8549
|
+
case 1:
|
|
8550
|
+
_a = _b.sent(), jobs = _a.jobs, image = _a.image, stages = _a.stages, variables = _a.variables, workflow = _a.workflow, pipelineRest = __rest(_a, ["jobs", "image", "stages", "variables", "workflow"]);
|
|
8545
8551
|
jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(function (_a) {
|
|
8546
8552
|
var _b = __read(_a, 2), jobName = _b[0], job = _b[1];
|
|
8547
8553
|
return [
|
|
@@ -8549,11 +8555,27 @@ function generatePipelineFiles(config, pipelineType, mode) {
|
|
|
8549
8555
|
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
8550
8556
|
];
|
|
8551
8557
|
}));
|
|
8552
|
-
return [
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8556
|
-
|
|
8558
|
+
return [2 /*return*/, __assign(__assign({ image: image, stages: stages, variables: variables, workflow: workflow }, pipelineRest), jobsWithSortedProps)];
|
|
8559
|
+
}
|
|
8560
|
+
});
|
|
8561
|
+
});
|
|
8562
|
+
}
|
|
8563
|
+
exports.generateLocalPipelineContent = generateLocalPipelineContent;
|
|
8564
|
+
function generatePipelineFiles(config, pipelineType, mode) {
|
|
8565
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8566
|
+
var pipelineContent_1, pipelineContent;
|
|
8567
|
+
return __generator(this, function (_a) {
|
|
8568
|
+
switch (_a.label) {
|
|
8569
|
+
case 0:
|
|
8570
|
+
if (!(mode === "childpipeline")) return [3 /*break*/, 2];
|
|
8571
|
+
return [4 /*yield*/, generateChildPipelineContent(config, pipelineType)];
|
|
8572
|
+
case 1:
|
|
8573
|
+
pipelineContent_1 = _a.sent();
|
|
8574
|
+
return [2 /*return*/, (0, writeFiles_1.writeYamlfile)("__pipeline.yml", pipelineContent_1)];
|
|
8575
|
+
case 2: return [4 /*yield*/, generateLocalPipelineContent(config, pipelineType)];
|
|
8576
|
+
case 3:
|
|
8577
|
+
pipelineContent = _a.sent();
|
|
8578
|
+
return [2 /*return*/, (0, writeFiles_1.writeYamlfile)(".gitlab-ci.yml", pipelineContent)];
|
|
8557
8579
|
}
|
|
8558
8580
|
});
|
|
8559
8581
|
});
|
|
@@ -15992,23 +15992,22 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
15992
15992
|
return ar;
|
|
15993
15993
|
};
|
|
15994
15994
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
15995
|
-
exports.generatePipelineFiles = void 0;
|
|
15995
|
+
exports.generatePipelineFiles = exports.generateLocalPipelineContent = exports.generateChildPipelineContent = void 0;
|
|
15996
15996
|
var writeFiles_1 = __nccwpck_require__(92228);
|
|
15997
15997
|
var createChildPipeline_1 = __nccwpck_require__(55139);
|
|
15998
15998
|
var createMainPipeline_1 = __nccwpck_require__(39192);
|
|
15999
15999
|
var getPipelineTriggerForGitlabChildPipeline_1 = __nccwpck_require__(7426);
|
|
16000
16000
|
var sortGitLabJobDefProps_1 = __nccwpck_require__(72361);
|
|
16001
|
-
function
|
|
16001
|
+
function generateChildPipelineContent(config, pipelineType) {
|
|
16002
16002
|
return __awaiter(this, void 0, void 0, function () {
|
|
16003
|
-
var trigger, _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps
|
|
16004
|
-
return __generator(this, function (
|
|
16005
|
-
switch (
|
|
16003
|
+
var trigger, _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps;
|
|
16004
|
+
return __generator(this, function (_b) {
|
|
16005
|
+
switch (_b.label) {
|
|
16006
16006
|
case 0:
|
|
16007
|
-
if (!(mode === "childpipeline")) return [3 /*break*/, 3];
|
|
16008
16007
|
trigger = (0, getPipelineTriggerForGitlabChildPipeline_1.getPipelineTriggerForGitlabChildPipeline)();
|
|
16009
16008
|
return [4 /*yield*/, (0, createChildPipeline_1.createChildPipeline)(pipelineType, trigger, config)];
|
|
16010
16009
|
case 1:
|
|
16011
|
-
_a =
|
|
16010
|
+
_a = _b.sent(), jobs = _a.jobs, image = _a.image, stages = _a.stages, variables = _a.variables, workflow = _a.workflow, pipelineRest = __rest(_a, ["jobs", "image", "stages", "variables", "workflow"]);
|
|
16012
16011
|
jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(function (_a) {
|
|
16013
16012
|
var _b = __read(_a, 2), jobName = _b[0], job = _b[1];
|
|
16014
16013
|
return [
|
|
@@ -16016,13 +16015,20 @@ function generatePipelineFiles(config, pipelineType, mode) {
|
|
|
16016
16015
|
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
16017
16016
|
];
|
|
16018
16017
|
}));
|
|
16019
|
-
return [
|
|
16020
|
-
|
|
16021
|
-
|
|
16022
|
-
|
|
16023
|
-
|
|
16024
|
-
|
|
16025
|
-
|
|
16018
|
+
return [2 /*return*/, __assign(__assign({ image: image, stages: stages, variables: variables, workflow: workflow }, pipelineRest), jobsWithSortedProps)];
|
|
16019
|
+
}
|
|
16020
|
+
});
|
|
16021
|
+
});
|
|
16022
|
+
}
|
|
16023
|
+
exports.generateChildPipelineContent = generateChildPipelineContent;
|
|
16024
|
+
function generateLocalPipelineContent(config, pipelineType) {
|
|
16025
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
16026
|
+
var _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps;
|
|
16027
|
+
return __generator(this, function (_b) {
|
|
16028
|
+
switch (_b.label) {
|
|
16029
|
+
case 0: return [4 /*yield*/, (0, createMainPipeline_1.createMainPipeline)(pipelineType, config)];
|
|
16030
|
+
case 1:
|
|
16031
|
+
_a = _b.sent(), jobs = _a.jobs, image = _a.image, stages = _a.stages, variables = _a.variables, workflow = _a.workflow, pipelineRest = __rest(_a, ["jobs", "image", "stages", "variables", "workflow"]);
|
|
16026
16032
|
jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(function (_a) {
|
|
16027
16033
|
var _b = __read(_a, 2), jobName = _b[0], job = _b[1];
|
|
16028
16034
|
return [
|
|
@@ -16030,11 +16036,27 @@ function generatePipelineFiles(config, pipelineType, mode) {
|
|
|
16030
16036
|
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
16031
16037
|
];
|
|
16032
16038
|
}));
|
|
16033
|
-
return [
|
|
16034
|
-
|
|
16035
|
-
|
|
16036
|
-
|
|
16037
|
-
|
|
16039
|
+
return [2 /*return*/, __assign(__assign({ image: image, stages: stages, variables: variables, workflow: workflow }, pipelineRest), jobsWithSortedProps)];
|
|
16040
|
+
}
|
|
16041
|
+
});
|
|
16042
|
+
});
|
|
16043
|
+
}
|
|
16044
|
+
exports.generateLocalPipelineContent = generateLocalPipelineContent;
|
|
16045
|
+
function generatePipelineFiles(config, pipelineType, mode) {
|
|
16046
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
16047
|
+
var pipelineContent_1, pipelineContent;
|
|
16048
|
+
return __generator(this, function (_a) {
|
|
16049
|
+
switch (_a.label) {
|
|
16050
|
+
case 0:
|
|
16051
|
+
if (!(mode === "childpipeline")) return [3 /*break*/, 2];
|
|
16052
|
+
return [4 /*yield*/, generateChildPipelineContent(config, pipelineType)];
|
|
16053
|
+
case 1:
|
|
16054
|
+
pipelineContent_1 = _a.sent();
|
|
16055
|
+
return [2 /*return*/, (0, writeFiles_1.writeYamlfile)("__pipeline.yml", pipelineContent_1)];
|
|
16056
|
+
case 2: return [4 /*yield*/, generateLocalPipelineContent(config, pipelineType)];
|
|
16057
|
+
case 3:
|
|
16058
|
+
pipelineContent = _a.sent();
|
|
16059
|
+
return [2 /*return*/, (0, writeFiles_1.writeYamlfile)(".gitlab-ci.yml", pipelineContent)];
|
|
16038
16060
|
}
|
|
16039
16061
|
});
|
|
16040
16062
|
});
|
|
@@ -98,6 +98,9 @@ export type BuildConfigNode = {
|
|
|
98
98
|
docker?: Omit<BuildConfigDockerBuiltInNode, "type"> | BuildConfigDocker;
|
|
99
99
|
} & BuildConfigNodeBase;
|
|
100
100
|
export type BuildConfigNodeStatic = BuildConfigNodeBase & {
|
|
101
|
+
/**
|
|
102
|
+
* @deprecated use type: "node" and docker: { type: "nginx" } instead
|
|
103
|
+
*/
|
|
101
104
|
type: "node-static";
|
|
102
105
|
startCommand?: never;
|
|
103
106
|
docker?: Omit<BuildConfigDockerBuiltInNgninx, "type"> | BuildConfigDocker;
|
|
@@ -221,6 +224,9 @@ export type BuildConfigRails = BuildConfigBase & {
|
|
|
221
224
|
};
|
|
222
225
|
};
|
|
223
226
|
export type BuildConfigStorybook = BuildConfigNodeBase & {
|
|
227
|
+
/**
|
|
228
|
+
* @deprecated use type: "node" and docker: { type: "nginx" } instead
|
|
229
|
+
*/
|
|
224
230
|
type: "storybook";
|
|
225
231
|
startCommand?: never;
|
|
226
232
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../pipeline/src/build/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../pipeline/src/build/types.ts"],"names":[],"mappings":";;;AAsTO,IAAM,uBAAuB,GAAG,UACrC,CAAsB;IAEtB,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrB,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;AACxB,CAAC,CAAC;AALW,QAAA,uBAAuB,2BAKlC;AAEK,IAAM,aAAa,GAAG,UAC3B,CAAc;IACd,eAAW;SAAX,UAAW,EAAX,qBAAW,EAAX,IAAW;QAAX,8BAAW;;IAEX,IAAI,CAAC,IAAA,+BAAuB,EAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9C,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB"}
|
|
@@ -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>;
|
|
@@ -74,23 +74,22 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
74
74
|
return ar;
|
|
75
75
|
};
|
|
76
76
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
77
|
-
exports.generatePipelineFiles = void 0;
|
|
77
|
+
exports.generatePipelineFiles = exports.generateLocalPipelineContent = exports.generateChildPipelineContent = void 0;
|
|
78
78
|
var writeFiles_1 = require("../utils/writeFiles");
|
|
79
79
|
var createChildPipeline_1 = require("./createChildPipeline");
|
|
80
80
|
var createMainPipeline_1 = require("./createMainPipeline");
|
|
81
81
|
var getPipelineTriggerForGitlabChildPipeline_1 = require("./gitlab/getPipelineTriggerForGitlabChildPipeline");
|
|
82
82
|
var sortGitLabJobDefProps_1 = require("./gitlab/sortGitLabJobDefProps");
|
|
83
|
-
function
|
|
83
|
+
function generateChildPipelineContent(config, pipelineType) {
|
|
84
84
|
return __awaiter(this, void 0, void 0, function () {
|
|
85
|
-
var trigger, _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps
|
|
86
|
-
return __generator(this, function (
|
|
87
|
-
switch (
|
|
85
|
+
var trigger, _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps;
|
|
86
|
+
return __generator(this, function (_b) {
|
|
87
|
+
switch (_b.label) {
|
|
88
88
|
case 0:
|
|
89
|
-
if (!(mode === "childpipeline")) return [3 /*break*/, 3];
|
|
90
89
|
trigger = (0, getPipelineTriggerForGitlabChildPipeline_1.getPipelineTriggerForGitlabChildPipeline)();
|
|
91
90
|
return [4 /*yield*/, (0, createChildPipeline_1.createChildPipeline)(pipelineType, trigger, config)];
|
|
92
91
|
case 1:
|
|
93
|
-
_a =
|
|
92
|
+
_a = _b.sent(), jobs = _a.jobs, image = _a.image, stages = _a.stages, variables = _a.variables, workflow = _a.workflow, pipelineRest = __rest(_a, ["jobs", "image", "stages", "variables", "workflow"]);
|
|
94
93
|
jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(function (_a) {
|
|
95
94
|
var _b = __read(_a, 2), jobName = _b[0], job = _b[1];
|
|
96
95
|
return [
|
|
@@ -98,13 +97,20 @@ function generatePipelineFiles(config, pipelineType, mode) {
|
|
|
98
97
|
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
99
98
|
];
|
|
100
99
|
}));
|
|
101
|
-
return [
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
return [2 /*return*/, __assign(__assign({ image: image, stages: stages, variables: variables, workflow: workflow }, pipelineRest), jobsWithSortedProps)];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
exports.generateChildPipelineContent = generateChildPipelineContent;
|
|
106
|
+
function generateLocalPipelineContent(config, pipelineType) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
108
|
+
var _a, jobs, image, stages, variables, workflow, pipelineRest, jobsWithSortedProps;
|
|
109
|
+
return __generator(this, function (_b) {
|
|
110
|
+
switch (_b.label) {
|
|
111
|
+
case 0: return [4 /*yield*/, (0, createMainPipeline_1.createMainPipeline)(pipelineType, config)];
|
|
112
|
+
case 1:
|
|
113
|
+
_a = _b.sent(), jobs = _a.jobs, image = _a.image, stages = _a.stages, variables = _a.variables, workflow = _a.workflow, pipelineRest = __rest(_a, ["jobs", "image", "stages", "variables", "workflow"]);
|
|
108
114
|
jobsWithSortedProps = Object.fromEntries(Object.entries(jobs).map(function (_a) {
|
|
109
115
|
var _b = __read(_a, 2), jobName = _b[0], job = _b[1];
|
|
110
116
|
return [
|
|
@@ -112,11 +118,27 @@ function generatePipelineFiles(config, pipelineType, mode) {
|
|
|
112
118
|
(0, sortGitLabJobDefProps_1.sortGitLabJobDefProps)(job),
|
|
113
119
|
];
|
|
114
120
|
}));
|
|
115
|
-
return [
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
return [2 /*return*/, __assign(__assign({ image: image, stages: stages, variables: variables, workflow: workflow }, pipelineRest), jobsWithSortedProps)];
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
exports.generateLocalPipelineContent = generateLocalPipelineContent;
|
|
127
|
+
function generatePipelineFiles(config, pipelineType, mode) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
129
|
+
var pipelineContent_1, pipelineContent;
|
|
130
|
+
return __generator(this, function (_a) {
|
|
131
|
+
switch (_a.label) {
|
|
132
|
+
case 0:
|
|
133
|
+
if (!(mode === "childpipeline")) return [3 /*break*/, 2];
|
|
134
|
+
return [4 /*yield*/, generateChildPipelineContent(config, pipelineType)];
|
|
135
|
+
case 1:
|
|
136
|
+
pipelineContent_1 = _a.sent();
|
|
137
|
+
return [2 /*return*/, (0, writeFiles_1.writeYamlfile)("__pipeline.yml", pipelineContent_1)];
|
|
138
|
+
case 2: return [4 /*yield*/, generateLocalPipelineContent(config, pipelineType)];
|
|
139
|
+
case 3:
|
|
140
|
+
pipelineContent = _a.sent();
|
|
141
|
+
return [2 /*return*/, (0, writeFiles_1.writeYamlfile)(".gitlab-ci.yml", pipelineContent)];
|
|
120
142
|
}
|
|
121
143
|
});
|
|
122
144
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePipelineFiles.js","sourceRoot":"","sources":["../../../../../pipeline/src/pipeline/generatePipelineFiles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoD;AACpD,6DAA4D;AAC5D,2DAA0D;AAC1D,8GAA6G;AAC7G,wEAAuE;
|
|
1
|
+
{"version":3,"file":"generatePipelineFiles.js","sourceRoot":"","sources":["../../../../../pipeline/src/pipeline/generatePipelineFiles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoD;AACpD,6DAA4D;AAC5D,2DAA0D;AAC1D,8GAA6G;AAC7G,wEAAuE;AAEvE,SAAsB,4BAA4B,CAChD,MAAc,EACd,YAAe;;;;;;oBAET,OAAO,GAAG,IAAA,mFAAwC,GAAE,CAAC;oBAEzD,qBAAM,IAAA,yCAAmB,EAAC,YAAY,EAAE,OAAO,EAAE,MAAM,CAAC,EAAA;;oBADpD,KACJ,SAAwD,EADlD,IAAI,UAAA,EAAE,KAAK,WAAA,EAAE,MAAM,YAAA,EAAE,SAAS,eAAA,EAAE,QAAQ,cAAA,EAAK,YAAY,cAA3D,oDAA6D,CAAF;oBAG3D,mBAAmB,GAAG,MAAM,CAAC,WAAW,CAC5C,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,UAAC,EAAc;4BAAd,KAAA,aAAc,EAAb,OAAO,QAAA,EAAE,GAAG,QAAA;wBAAM,OAAA;4BAC3C,OAAO;4BACP,IAAA,6CAAqB,EAAC,GAAG,CAAC;yBAC3B;oBAH4C,CAG5C,CAAC,CACH,CAAC;oBAEF,0CACE,KAAK,OAAA,EACL,MAAM,QAAA,EACN,SAAS,WAAA,EACT,QAAQ,UAAA,IACL,YAAY,GAEZ,mBAAmB,GACtB;;;;CACH;AAxBD,oEAwBC;AAED,SAAsB,4BAA4B,CAChD,MAAc,EACd,YAAe;;;;;wBAGb,qBAAM,IAAA,uCAAkB,EAAC,YAAY,EAAE,MAAM,CAAC,EAAA;;oBAD1C,KACJ,SAA8C,EADxC,IAAI,UAAA,EAAE,KAAK,WAAA,EAAE,MAAM,YAAA,EAAE,SAAS,eAAA,EAAE,QAAQ,cAAA,EAAK,YAAY,cAA3D,oDAA6D,CAAF;oBAG3D,mBAAmB,GAAG,MAAM,CAAC,WAAW,CAC5C,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,UAAC,EAAc;4BAAd,KAAA,aAAc,EAAb,OAAO,QAAA,EAAE,GAAG,QAAA;wBAAM,OAAA;4BAC3C,OAAO;4BACP,IAAA,6CAAqB,EAAC,GAAG,CAAC;yBAC3B;oBAH4C,CAG5C,CAAC,CACH,CAAC;oBAEF,0CACE,KAAK,OAAA,EACL,MAAM,QAAA,EACN,SAAS,WAAA,EACT,QAAQ,UAAA,IACL,YAAY,GAEZ,mBAAmB,GACtB;;;;CACH;AAvBD,oEAuBC;AAED,SAAsB,qBAAqB,CACzC,MAAc,EACd,YAAe,EACf,IAAqB;;;;;;yBAEjB,CAAA,IAAI,KAAK,eAAe,CAAA,EAAxB,wBAAwB;oBACF,qBAAM,4BAA4B,CACxD,MAAM,EACN,YAAY,CACb,EAAA;;oBAHK,oBAAkB,SAGvB;oBACD,sBAAO,IAAA,0BAAa,EAAC,gBAAgB,EAAE,iBAAe,CAAC,EAAC;wBAElC,qBAAM,4BAA4B,CACxD,MAAM,EACN,YAAY,CACb,EAAA;;oBAHK,eAAe,GAAG,SAGvB;oBACD,sBAAO,IAAA,0BAAa,EAAC,gBAAgB,EAAE,eAAe,CAAC,EAAC;;;;CACzD;AAjBD,sDAiBC"}
|