@payfit/iac 1.13.5-ephemeral-concurrent-tflint-execution.2 → 1.13.5
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/README.md +0 -12
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +0 -39
- package/dist/src/index.js.map +1 -1
- package/package.json +2 -6
- package/dist/src/executors/stack-migration/README.md +0 -79
- package/dist/src/executors/stack-migration/lib/constants.d.ts +0 -34
- package/dist/src/executors/stack-migration/lib/constants.d.ts.map +0 -1
- package/dist/src/executors/stack-migration/lib/constants.js +0 -44
- package/dist/src/executors/stack-migration/lib/constants.js.map +0 -1
- package/dist/src/executors/stack-migration/lib/file-operations.d.ts +0 -24
- package/dist/src/executors/stack-migration/lib/file-operations.d.ts.map +0 -1
- package/dist/src/executors/stack-migration/lib/file-operations.js +0 -125
- package/dist/src/executors/stack-migration/lib/file-operations.js.map +0 -1
- package/dist/src/executors/stack-migration/lib/git-operations.d.ts +0 -21
- package/dist/src/executors/stack-migration/lib/git-operations.d.ts.map +0 -1
- package/dist/src/executors/stack-migration/lib/git-operations.js +0 -99
- package/dist/src/executors/stack-migration/lib/git-operations.js.map +0 -1
- package/dist/src/executors/stack-migration/lib/index.d.ts +0 -11
- package/dist/src/executors/stack-migration/lib/index.d.ts.map +0 -1
- package/dist/src/executors/stack-migration/lib/index.js +0 -14
- package/dist/src/executors/stack-migration/lib/index.js.map +0 -1
- package/dist/src/executors/stack-migration/lib/migration-helper.d.ts +0 -41
- package/dist/src/executors/stack-migration/lib/migration-helper.d.ts.map +0 -1
- package/dist/src/executors/stack-migration/lib/migration-helper.js +0 -217
- package/dist/src/executors/stack-migration/lib/migration-helper.js.map +0 -1
- package/dist/src/executors/stack-migration/lib/migration-tool.d.ts +0 -72
- package/dist/src/executors/stack-migration/lib/migration-tool.d.ts.map +0 -1
- package/dist/src/executors/stack-migration/lib/migration-tool.js +0 -859
- package/dist/src/executors/stack-migration/lib/migration-tool.js.map +0 -1
- package/dist/src/executors/stack-migration/lib/path-builder.d.ts +0 -21
- package/dist/src/executors/stack-migration/lib/path-builder.d.ts.map +0 -1
- package/dist/src/executors/stack-migration/lib/path-builder.js +0 -59
- package/dist/src/executors/stack-migration/lib/path-builder.js.map +0 -1
- package/dist/src/executors/stack-migration/lib/spacelift-client.d.ts +0 -26
- package/dist/src/executors/stack-migration/lib/spacelift-client.d.ts.map +0 -1
- package/dist/src/executors/stack-migration/lib/spacelift-client.js +0 -118
- package/dist/src/executors/stack-migration/lib/spacelift-client.js.map +0 -1
- package/dist/src/executors/stack-migration/lib/templates/index.d.ts +0 -8
- package/dist/src/executors/stack-migration/lib/templates/index.d.ts.map +0 -1
- package/dist/src/executors/stack-migration/lib/templates/index.js +0 -11
- package/dist/src/executors/stack-migration/lib/templates/index.js.map +0 -1
- package/dist/src/executors/stack-migration/lib/templates/mermaid-diagram.d.ts +0 -14
- package/dist/src/executors/stack-migration/lib/templates/mermaid-diagram.d.ts.map +0 -1
- package/dist/src/executors/stack-migration/lib/templates/mermaid-diagram.js +0 -45
- package/dist/src/executors/stack-migration/lib/templates/mermaid-diagram.js.map +0 -1
- package/dist/src/executors/stack-migration/lib/templates/message-templates.d.ts +0 -17
- package/dist/src/executors/stack-migration/lib/templates/message-templates.d.ts.map +0 -1
- package/dist/src/executors/stack-migration/lib/templates/message-templates.js +0 -42
- package/dist/src/executors/stack-migration/lib/templates/message-templates.js.map +0 -1
- package/dist/src/executors/stack-migration/lib/templates/pr-templates.d.ts +0 -33
- package/dist/src/executors/stack-migration/lib/templates/pr-templates.d.ts.map +0 -1
- package/dist/src/executors/stack-migration/lib/templates/pr-templates.js +0 -108
- package/dist/src/executors/stack-migration/lib/templates/pr-templates.js.map +0 -1
- package/dist/src/executors/stack-migration/lib/templates/procedure-template.d.ts +0 -7
- package/dist/src/executors/stack-migration/lib/templates/procedure-template.d.ts.map +0 -1
- package/dist/src/executors/stack-migration/lib/templates/procedure-template.js +0 -62
- package/dist/src/executors/stack-migration/lib/templates/procedure-template.js.map +0 -1
- package/dist/src/executors/stack-migration/lib/types.d.ts +0 -54
- package/dist/src/executors/stack-migration/lib/types.d.ts.map +0 -1
- package/dist/src/executors/stack-migration/lib/types.js +0 -3
- package/dist/src/executors/stack-migration/lib/types.js.map +0 -1
- package/dist/src/executors/stack-migration/schema.d.ts +0 -20
- package/dist/src/executors/stack-migration/schema.json +0 -60
- package/dist/src/executors/stack-migration/stack-migration.d.ts +0 -5
- package/dist/src/executors/stack-migration/stack-migration.d.ts.map +0 -1
- package/dist/src/executors/stack-migration/stack-migration.js +0 -79
- package/dist/src/executors/stack-migration/stack-migration.js.map +0 -1
- package/executors.json +0 -9
package/README.md
CHANGED
|
@@ -62,18 +62,6 @@ nx run <terraform-project>:tofu-format:write
|
|
|
62
62
|
nx run <terraform-project>:lint
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
## Executors
|
|
66
|
-
|
|
67
|
-
### Stack Migration
|
|
68
|
-
|
|
69
|
-
Migrate Spacelift stacks from iac-deploy to repository-level metastacks.
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
nx run <project>:stack-migration --command=run
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
See [Stack Migration README](./src/executors/stack-migration/README.md) for detailed documentation.
|
|
76
|
-
|
|
77
65
|
## Development
|
|
78
66
|
|
|
79
67
|
See [AGENTS.md](./AGENTS.md) for build, test, and development instructions.
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EAEd,MAAM,YAAY,CAAA;AAWnB,eAAO,MAAM,aAAa,EAAE,aAW3B,CAAA;AAED,wBAAsB,mBAAmB,CACvC,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,OAAO,EACjB,OAAO,EAAE,oBAAoB;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EAEd,MAAM,YAAY,CAAA;AAWnB,eAAO,MAAM,aAAa,EAAE,aAW3B,CAAA;AAED,wBAAsB,mBAAmB,CACvC,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,OAAO,EACjB,OAAO,EAAE,oBAAoB;;;;;;;;;;;;GAgI9B"}
|
package/dist/src/index.js
CHANGED
|
@@ -17,7 +17,6 @@ async function createNodesInternal(configFilePath, _options, context) {
|
|
|
17
17
|
const projectRoot = (0, path_1.dirname)(configFilePath);
|
|
18
18
|
const targets = {};
|
|
19
19
|
let release;
|
|
20
|
-
const isRootProject = projectRoot === '.';
|
|
21
20
|
const isTfModule = (0, terraform_detection_1.isTerraformModule)(projectRoot, projectConfiguration);
|
|
22
21
|
// Get tflintConfigFile from metadata or use default
|
|
23
22
|
const tflintConfigFile = (0, path_1.join)((0, devkit_1.offsetFromRoot)(projectRoot), '.tflint.hcl');
|
|
@@ -116,44 +115,6 @@ async function createNodesInternal(configFilePath, _options, context) {
|
|
|
116
115
|
};
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
|
-
// Only infer stack-migration target for root project
|
|
120
|
-
if (isRootProject) {
|
|
121
|
-
const stackMigrationConfig = (0, devkit_1.readJsonFile)((0, path_1.join)(__dirname, '/executors/stack-migration/schema.json'));
|
|
122
|
-
targets['stack-migration'] = {
|
|
123
|
-
executor: '@payfit/iac:stack-migration',
|
|
124
|
-
cache: false,
|
|
125
|
-
options: {
|
|
126
|
-
command: 'run',
|
|
127
|
-
},
|
|
128
|
-
configurations: {
|
|
129
|
-
init: {
|
|
130
|
-
command: 'init',
|
|
131
|
-
},
|
|
132
|
-
state: {
|
|
133
|
-
command: 'state',
|
|
134
|
-
},
|
|
135
|
-
enroll: {
|
|
136
|
-
command: 'enroll',
|
|
137
|
-
},
|
|
138
|
-
'generate-tf-migration': {
|
|
139
|
-
command: 'generate-tf-migration',
|
|
140
|
-
},
|
|
141
|
-
'iac-deploy-cleanup': {
|
|
142
|
-
command: 'iac-deploy-cleanup',
|
|
143
|
-
},
|
|
144
|
-
'generate-procedure': {
|
|
145
|
-
command: 'generate-procedure',
|
|
146
|
-
},
|
|
147
|
-
cleanup: {
|
|
148
|
-
command: 'cleanup',
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
metadata: {
|
|
152
|
-
technologies: ['spacelift', 'terraform'],
|
|
153
|
-
description: stackMigrationConfig?.description || 'Migrate stacks to metastack',
|
|
154
|
-
},
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
118
|
return {
|
|
158
119
|
projects: {
|
|
159
120
|
[projectRoot]: {
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AA8BA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AA8BA,kDAmIC;AAjKD,+BAAoC;AAQpC,uCAA+E;AAC/E,4EAAsE;AAEtE,qEAA+D;AAMlD,QAAA,aAAa,GAAkB;IAC1C,iBAAiB;IACjB,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;QACtC,OAAO,MAAM,IAAA,6BAAoB,EAC/B,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,CAC/B,mBAAmB,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,EACnD,WAAW,EACX,OAAO,EACP,OAAO,CACR,CAAA;IACH,CAAC;CACF,CAAA;AAEM,KAAK,UAAU,mBAAmB,CACvC,cAAsB,EACtB,QAAiB,EACjB,OAA6B;IAE7B,MAAM,oBAAoB,GACxB,IAAA,qBAAY,EAAC,cAAc,CAAC,CAAA;IAC9B,MAAM,WAAW,GAAG,IAA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,EAAE,OAAuC;YACtE,EAAE,cAAc,EAClB,CAAC;YACD,OAAO,GAAG;gBACR,OAAO,EAAE;oBACP,cAAc,EAAE,kDAAkD;oBAClE,qBAAqB,EAAE,CAAC,eAAe,CAAC;iBACzC;aACF,CAAA;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,QAAQ,EAAE;YACR,CAAC,WAAW,CAAC,EAAE;gBACb,OAAO;gBACP,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAChC;SACF;KACF,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payfit/iac",
|
|
3
|
-
"version": "1.13.5
|
|
3
|
+
"version": "1.13.5",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "restricted"
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
"@octokit/rest": "^22.0.0",
|
|
34
34
|
"args-tokenizer": "^0.3.0",
|
|
35
35
|
"consola": "^3.4.2",
|
|
36
|
-
"js-yaml": "^4.1.0",
|
|
37
36
|
"tinyexec": "1.1.2",
|
|
38
37
|
"tslib": "^2.8.1"
|
|
39
38
|
},
|
|
@@ -43,17 +42,14 @@
|
|
|
43
42
|
"nx": "^22"
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|
|
46
|
-
"@types/js-yaml": "4.0.9",
|
|
47
45
|
"memfs": "4.57.2",
|
|
48
46
|
"vitest": "^4.0.0"
|
|
49
47
|
},
|
|
50
|
-
"executors": "./executors.json",
|
|
51
48
|
"createNodes": [
|
|
52
49
|
"./dist/src/index"
|
|
53
50
|
],
|
|
54
51
|
"files": [
|
|
55
52
|
"dist",
|
|
56
|
-
"!**/*.tsbuildinfo"
|
|
57
|
-
"executors.json"
|
|
53
|
+
"!**/*.tsbuildinfo"
|
|
58
54
|
]
|
|
59
55
|
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
# Stack Migration Executor
|
|
2
|
-
|
|
3
|
-
Migrate Spacelift stacks from iac-deploy to repository-level metastacks.
|
|
4
|
-
|
|
5
|
-
## Migration Flow
|
|
6
|
-
|
|
7
|
-
```mermaid
|
|
8
|
-
flowchart TD
|
|
9
|
-
subgraph Phase1["📦 1: Setup"]
|
|
10
|
-
A[init] --> B[Create PRs + Scripts]
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
subgraph Phase2["🔒 2: Safety & Enrollment"]
|
|
14
|
-
B --> C[Merge Safety Net PR]
|
|
15
|
-
C --> D[Merge Domain Enrollment PR]
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
subgraph Phase3["🧹 3: State Management"]
|
|
19
|
-
D --> E[Run State Removal]
|
|
20
|
-
E --> F[Merge iac-deploy Cleanup PR]
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
subgraph Phase4["✅ 4: Complete"]
|
|
24
|
-
F --> G[Merge Service Repo PR]
|
|
25
|
-
G --> H[Run Cleanup]
|
|
26
|
-
H --> I[Merge Post-Migration Cleanup PR]
|
|
27
|
-
end
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Quick Start
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
# Full migration (recommended)
|
|
34
|
-
nx run <project>:stack-migration --command=run
|
|
35
|
-
|
|
36
|
-
# Preview changes first
|
|
37
|
-
nx run <project>:stack-migration --command=run --dry-run
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Commands
|
|
41
|
-
|
|
42
|
-
| Command | Description |
|
|
43
|
-
| ----------------------- | --------------------------------------------- |
|
|
44
|
-
| `run` | Execute full migration workflow |
|
|
45
|
-
| `init` | Clone repos, load config |
|
|
46
|
-
| `state` | Show migration state |
|
|
47
|
-
| `enroll` | Create domain enrollment PR |
|
|
48
|
-
| `generate-tf-migration` | Create service PR + state removal script |
|
|
49
|
-
| `iac-deploy-cleanup` | Create iac-deploy cleanup PR |
|
|
50
|
-
| `generate-procedure` | Generate procedure doc |
|
|
51
|
-
| `cleanup` | Create post-migration PR + remove local files |
|
|
52
|
-
| `help` | Show usage information |
|
|
53
|
-
|
|
54
|
-
## Execution Order
|
|
55
|
-
|
|
56
|
-
| Step | Action | Type |
|
|
57
|
-
| ---- | ----------------------------------- | --------- |
|
|
58
|
-
| 1 | Merge **Safety Net** PR | 🔀 PR |
|
|
59
|
-
| 2 | Merge **Domain Enrollment** PR | 🔀 PR |
|
|
60
|
-
| 3 | Run state removal script | 🔧 Manual |
|
|
61
|
-
| 4 | Merge **iac-deploy Cleanup** PR | 🔀 PR |
|
|
62
|
-
| 5 | Merge **Service Repo** PR | 🔀 PR |
|
|
63
|
-
| 6 | Run cleanup | 🔧 Manual |
|
|
64
|
-
| 7 | Merge **Post-Migration Cleanup** PR | 🔀 PR |
|
|
65
|
-
|
|
66
|
-
## Files Generated
|
|
67
|
-
|
|
68
|
-
| File | Purpose |
|
|
69
|
-
| ------------------------------------- | -------------------------------- |
|
|
70
|
-
| `.migration-state.json` | Migration state (resume anytime) |
|
|
71
|
-
| `METASTACK_MIGRATION_PROCEDURE.md` | Checklist & instructions |
|
|
72
|
-
| `METASTACK_STATE_REMOVAL_COMMANDS.sh` | State removal commands |
|
|
73
|
-
| `.metastack/import.tf` | Terraform import blocks |
|
|
74
|
-
| `spacelift.yaml` | Stack definitions |
|
|
75
|
-
|
|
76
|
-
## Notes
|
|
77
|
-
|
|
78
|
-
- State saved in `.migration-state.json`, you can resume at any time
|
|
79
|
-
- Run state removal before merging iac-deploy cleanup PR to avoid actually deleting the stacks
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export declare const REPO_URLS: {
|
|
2
|
-
readonly domainEnrollment: "git@github.com:PayFit/domain-enrollment.git";
|
|
3
|
-
readonly iacDeploy: "git@github.com:PayFit/iac-deploy.git";
|
|
4
|
-
};
|
|
5
|
-
export declare const FILE_NAMES: {
|
|
6
|
-
readonly migrationState: ".migration-state.json";
|
|
7
|
-
readonly tempDir: ".migration-tmp";
|
|
8
|
-
readonly stateRemovalCommands: "METASTACK_STATE_REMOVAL_COMMANDS.sh";
|
|
9
|
-
readonly migrationProcedure: "METASTACK_MIGRATION_PROCEDURE.md";
|
|
10
|
-
readonly spaceliftYaml: "spacelift.yaml";
|
|
11
|
-
readonly gitignore: ".gitignore";
|
|
12
|
-
};
|
|
13
|
-
export declare const GITIGNORE_ENTRIES: string;
|
|
14
|
-
export declare const IAC_DEPLOY_PATHS: {
|
|
15
|
-
readonly projectsConfigs: "projects/configs";
|
|
16
|
-
};
|
|
17
|
-
export declare const DOMAIN_ENROLLMENT_PATHS: {
|
|
18
|
-
readonly domains: "domains";
|
|
19
|
-
readonly spaceliftDir: "spacelift";
|
|
20
|
-
readonly spaceliftYaml: "spacelift/domain-spacelift.yaml";
|
|
21
|
-
};
|
|
22
|
-
export declare const SPACELIFT_API: {
|
|
23
|
-
readonly endpoint: "https://payfit.app.spacelift.io/graphql";
|
|
24
|
-
};
|
|
25
|
-
export declare const SPACELIFT_INTEGRATIONS_ENV_IDS: {
|
|
26
|
-
readonly DEV: "01GMN9SZKWZ7865CNSHY7B1NXY";
|
|
27
|
-
readonly PROD: "01GMN9SZEGBXRGKSC8K43Y9X9E";
|
|
28
|
-
readonly SHARED: "01GMN9T0G289G811A802GV7FN9";
|
|
29
|
-
readonly STAGING: "01GMN9SZQ1750KR5TH5W6XKQB0";
|
|
30
|
-
};
|
|
31
|
-
export declare const STACK_MANAGERS: {
|
|
32
|
-
readonly projectsManager: "projects-manager";
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/executors/stack-migration/lib/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;CAGZ,CAAA;AAEV,eAAO,MAAM,UAAU;;;;;;;CAOb,CAAA;AAEV,eAAO,MAAM,iBAAiB,QAOlB,CAAA;AAEZ,eAAO,MAAM,gBAAgB;;CAEnB,CAAA;AAEV,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAA;AAEV,eAAO,MAAM,aAAa;;CAEhB,CAAA;AAEV,eAAO,MAAM,8BAA8B;;;;;CAKjC,CAAA;AAEV,eAAO,MAAM,cAAc;;CAEjB,CAAA"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.STACK_MANAGERS = exports.SPACELIFT_INTEGRATIONS_ENV_IDS = exports.SPACELIFT_API = exports.DOMAIN_ENROLLMENT_PATHS = exports.IAC_DEPLOY_PATHS = exports.GITIGNORE_ENTRIES = exports.FILE_NAMES = exports.REPO_URLS = void 0;
|
|
4
|
-
exports.REPO_URLS = {
|
|
5
|
-
domainEnrollment: 'git@github.com:PayFit/domain-enrollment.git',
|
|
6
|
-
iacDeploy: 'git@github.com:PayFit/iac-deploy.git',
|
|
7
|
-
};
|
|
8
|
-
exports.FILE_NAMES = {
|
|
9
|
-
migrationState: '.migration-state.json',
|
|
10
|
-
tempDir: '.migration-tmp',
|
|
11
|
-
stateRemovalCommands: 'METASTACK_STATE_REMOVAL_COMMANDS.sh',
|
|
12
|
-
migrationProcedure: 'METASTACK_MIGRATION_PROCEDURE.md',
|
|
13
|
-
spaceliftYaml: 'spacelift.yaml',
|
|
14
|
-
gitignore: '.gitignore',
|
|
15
|
-
};
|
|
16
|
-
exports.GITIGNORE_ENTRIES = [
|
|
17
|
-
'',
|
|
18
|
-
'# Migration temporary files',
|
|
19
|
-
`${exports.FILE_NAMES.tempDir}/`,
|
|
20
|
-
exports.FILE_NAMES.migrationState,
|
|
21
|
-
exports.FILE_NAMES.stateRemovalCommands,
|
|
22
|
-
exports.FILE_NAMES.migrationProcedure,
|
|
23
|
-
].join('\n');
|
|
24
|
-
exports.IAC_DEPLOY_PATHS = {
|
|
25
|
-
projectsConfigs: 'projects/configs',
|
|
26
|
-
};
|
|
27
|
-
exports.DOMAIN_ENROLLMENT_PATHS = {
|
|
28
|
-
domains: 'domains',
|
|
29
|
-
spaceliftDir: 'spacelift',
|
|
30
|
-
spaceliftYaml: 'spacelift/domain-spacelift.yaml',
|
|
31
|
-
};
|
|
32
|
-
exports.SPACELIFT_API = {
|
|
33
|
-
endpoint: 'https://payfit.app.spacelift.io/graphql',
|
|
34
|
-
};
|
|
35
|
-
exports.SPACELIFT_INTEGRATIONS_ENV_IDS = {
|
|
36
|
-
DEV: '01GMN9SZKWZ7865CNSHY7B1NXY',
|
|
37
|
-
PROD: '01GMN9SZEGBXRGKSC8K43Y9X9E',
|
|
38
|
-
SHARED: '01GMN9T0G289G811A802GV7FN9',
|
|
39
|
-
STAGING: '01GMN9SZQ1750KR5TH5W6XKQB0',
|
|
40
|
-
};
|
|
41
|
-
exports.STACK_MANAGERS = {
|
|
42
|
-
projectsManager: 'projects-manager',
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/executors/stack-migration/lib/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IACvB,gBAAgB,EAAE,6CAA6C;IAC/D,SAAS,EAAE,sCAAsC;CACzC,CAAA;AAEG,QAAA,UAAU,GAAG;IACxB,cAAc,EAAE,uBAAuB;IACvC,OAAO,EAAE,gBAAgB;IACzB,oBAAoB,EAAE,qCAAqC;IAC3D,kBAAkB,EAAE,kCAAkC;IACtD,aAAa,EAAE,gBAAgB;IAC/B,SAAS,EAAE,YAAY;CACf,CAAA;AAEG,QAAA,iBAAiB,GAAG;IAC/B,EAAE;IACF,6BAA6B;IAC7B,GAAG,kBAAU,CAAC,OAAO,GAAG;IACxB,kBAAU,CAAC,cAAc;IACzB,kBAAU,CAAC,oBAAoB;IAC/B,kBAAU,CAAC,kBAAkB;CAC9B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEC,QAAA,gBAAgB,GAAG;IAC9B,eAAe,EAAE,kBAAkB;CAC3B,CAAA;AAEG,QAAA,uBAAuB,GAAG;IACrC,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,WAAW;IACzB,aAAa,EAAE,iCAAiC;CACxC,CAAA;AAEG,QAAA,aAAa,GAAG;IAC3B,QAAQ,EAAE,yCAAyC;CAC3C,CAAA;AAEG,QAAA,8BAA8B,GAAG;IAC5C,GAAG,EAAE,4BAA4B;IACjC,IAAI,EAAE,4BAA4B;IAClC,MAAM,EAAE,4BAA4B;IACpC,OAAO,EAAE,4BAA4B;CAC7B,CAAA;AAEG,QAAA,cAAc,GAAG;IAC5B,eAAe,EAAE,kBAAkB;CAC3B,CAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Logger } from './git-operations';
|
|
2
|
-
export declare class FileOperations {
|
|
3
|
-
private dryRun;
|
|
4
|
-
private logger;
|
|
5
|
-
constructor(dryRun: boolean, logger: Logger);
|
|
6
|
-
readYaml(filePath: string): Record<string, unknown>;
|
|
7
|
-
writeYaml(filePath: string, data: Record<string, unknown>): void;
|
|
8
|
-
writeFile(filePath: string, content: string): void;
|
|
9
|
-
readFile(filePath: string): string;
|
|
10
|
-
mkdir(dirPath: string, options?: {
|
|
11
|
-
recursive?: boolean;
|
|
12
|
-
}): void;
|
|
13
|
-
deleteFile(filePath: string): void;
|
|
14
|
-
deleteDirectory(dirPath: string): void;
|
|
15
|
-
copyFile(source: string, destination: string): void;
|
|
16
|
-
exists(filePath: string): boolean;
|
|
17
|
-
isDirectory(filePath: string): boolean;
|
|
18
|
-
readDir(dirPath: string): Array<{
|
|
19
|
-
name: string;
|
|
20
|
-
isDirectory: boolean;
|
|
21
|
-
}>;
|
|
22
|
-
updateAutodeployInYaml(filePath: string, value: boolean): void;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=file-operations.d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 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FileOperations = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const fs = tslib_1.__importStar(require("fs"));
|
|
6
|
-
const yaml = tslib_1.__importStar(require("js-yaml"));
|
|
7
|
-
class FileOperations {
|
|
8
|
-
dryRun;
|
|
9
|
-
logger;
|
|
10
|
-
constructor(dryRun, logger) {
|
|
11
|
-
this.dryRun = dryRun;
|
|
12
|
-
this.logger = logger;
|
|
13
|
-
}
|
|
14
|
-
readYaml(filePath) {
|
|
15
|
-
try {
|
|
16
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
17
|
-
return yaml.load(content);
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
this.logger.error('failed to read yaml file: ' + error);
|
|
21
|
-
throw error;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
writeYaml(filePath, data) {
|
|
25
|
-
const content = yaml.dump(data, {
|
|
26
|
-
lineWidth: -1,
|
|
27
|
-
quotingType: '"',
|
|
28
|
-
noRefs: false,
|
|
29
|
-
});
|
|
30
|
-
if (this.dryRun) {
|
|
31
|
-
this.logger.info(`[DRY RUN] Would write YAML to: ${filePath}`);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
fs.writeFileSync(filePath, content);
|
|
35
|
-
}
|
|
36
|
-
writeFile(filePath, content) {
|
|
37
|
-
if (this.dryRun) {
|
|
38
|
-
this.logger.info(`[DRY RUN] Would write file to: ${filePath}`);
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
fs.writeFileSync(filePath, content);
|
|
42
|
-
}
|
|
43
|
-
readFile(filePath) {
|
|
44
|
-
try {
|
|
45
|
-
return fs.readFileSync(filePath, 'utf-8');
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
this.logger.error('failed to read file: ' + error);
|
|
49
|
-
throw error;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
mkdir(dirPath, options) {
|
|
53
|
-
if (this.dryRun) {
|
|
54
|
-
this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
fs.mkdirSync(dirPath, options);
|
|
58
|
-
}
|
|
59
|
-
deleteFile(filePath) {
|
|
60
|
-
if (this.dryRun) {
|
|
61
|
-
this.logger.info(`[DRY RUN] Would delete file: ${filePath}`);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
if (fs.existsSync(filePath)) {
|
|
65
|
-
fs.unlinkSync(filePath);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
deleteDirectory(dirPath) {
|
|
69
|
-
if (this.dryRun) {
|
|
70
|
-
this.logger.info(`[DRY RUN] Would delete directory: ${dirPath}`);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
if (fs.existsSync(dirPath)) {
|
|
74
|
-
fs.rmSync(dirPath, { recursive: true, force: true });
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
copyFile(source, destination) {
|
|
78
|
-
if (this.dryRun) {
|
|
79
|
-
this.logger.info(`[DRY RUN] Would copy ${source} -> ${destination}`);
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
fs.copyFileSync(source, destination);
|
|
83
|
-
}
|
|
84
|
-
exists(filePath) {
|
|
85
|
-
return fs.existsSync(filePath);
|
|
86
|
-
}
|
|
87
|
-
isDirectory(filePath) {
|
|
88
|
-
return fs.existsSync(filePath) && fs.statSync(filePath).isDirectory();
|
|
89
|
-
}
|
|
90
|
-
readDir(dirPath) {
|
|
91
|
-
if (!fs.existsSync(dirPath)) {
|
|
92
|
-
return [];
|
|
93
|
-
}
|
|
94
|
-
const entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
|
95
|
-
return entries.map(entry => ({
|
|
96
|
-
name: entry.name,
|
|
97
|
-
isDirectory: entry.isDirectory(),
|
|
98
|
-
}));
|
|
99
|
-
}
|
|
100
|
-
updateAutodeployInYaml(filePath, value) {
|
|
101
|
-
if (this.dryRun) {
|
|
102
|
-
this.logger.info(`[DRY RUN] Would set autodeploy=${value} in ${filePath}`);
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
const content = this.readFile(filePath);
|
|
106
|
-
const lines = content.split('\n');
|
|
107
|
-
const result = [];
|
|
108
|
-
for (const line of lines) {
|
|
109
|
-
if (line === undefined) {
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
const autodeployMatch = line.match(/^(\s*)autodeploy:\s*(true|false)(.*)$/);
|
|
113
|
-
if (autodeployMatch) {
|
|
114
|
-
const [, indent, , rest] = autodeployMatch;
|
|
115
|
-
result.push(`${indent}autodeploy: ${value}${rest}`);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
result.push(line);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
this.writeFile(filePath, result.join('\n'));
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
exports.FileOperations = FileOperations;
|
|
125
|
-
//# sourceMappingURL=file-operations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-operations.js","sourceRoot":"","sources":["../../../../../src/executors/stack-migration/lib/file-operations.ts"],"names":[],"mappings":";;;;AAAA,+CAAwB;AAIxB,sDAA+B;AAE/B,MAAa,cAAc;IAEf;IACA;IAFV,YACU,MAAe,EACf,MAAc;QADd,WAAM,GAAN,MAAM,CAAS;QACf,WAAM,GAAN,MAAM,CAAQ;IACrB,CAAC;IAEJ,QAAQ,CAAC,QAAgB;QACvB,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;YAClD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAA4B,CAAA;QACtD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAA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,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAC7C,CAAC;CACF;AAvID,wCAuIC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface Logger {
|
|
2
|
-
info(message: string): void;
|
|
3
|
-
success(message: string): void;
|
|
4
|
-
warn(message: string): void;
|
|
5
|
-
error(message: string): void;
|
|
6
|
-
}
|
|
7
|
-
export declare class GitOperations {
|
|
8
|
-
private dryRun;
|
|
9
|
-
private logger;
|
|
10
|
-
constructor(dryRun: boolean, logger: Logger);
|
|
11
|
-
private exec;
|
|
12
|
-
clone(repoUrl: string, targetPath: string, cwd: string): Promise<void>;
|
|
13
|
-
checkoutMainBranch(repoName: string): Promise<void>;
|
|
14
|
-
pull(cwd: string): Promise<void>;
|
|
15
|
-
createBranch(branchName: string, cwd: string): Promise<void>;
|
|
16
|
-
add(files: string[], cwd: string): Promise<void>;
|
|
17
|
-
commit(message: string, cwd: string): Promise<void>;
|
|
18
|
-
push(branchName: string, cwd: string): Promise<void>;
|
|
19
|
-
createPR(branchName: string, title: string, body: string, cwd: string): Promise<string>;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=git-operations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-operations.d.ts","sourceRoot":"","sources":["../../../../../src/executors/stack-migration/lib/git-operations.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAED,qBAAa,aAAa;IAEtB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,MAAM;gBADN,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM;IAGxB,OAAO,CAAC,IAAI;IAiBN,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWtE,kBAAkB,CAAC,QAAQ,EAAE,MAAM;IAQnC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQhC,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ5D,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQhD,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWnD,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQpD,QAAQ,CACZ,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC;CAqBnB"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GitOperations = void 0;
|
|
4
|
-
const child_process_1 = require("child_process");
|
|
5
|
-
class GitOperations {
|
|
6
|
-
dryRun;
|
|
7
|
-
logger;
|
|
8
|
-
constructor(dryRun, logger) {
|
|
9
|
-
this.dryRun = dryRun;
|
|
10
|
-
this.logger = logger;
|
|
11
|
-
}
|
|
12
|
-
exec(command, cwd) {
|
|
13
|
-
if (this.dryRun) {
|
|
14
|
-
this.logger.info(`[DRY RUN] Would run git command: ${command}`);
|
|
15
|
-
return '';
|
|
16
|
-
}
|
|
17
|
-
try {
|
|
18
|
-
return (0, child_process_1.execSync)(command, {
|
|
19
|
-
cwd,
|
|
20
|
-
encoding: 'utf8',
|
|
21
|
-
timeout: 300000, // 5 minutes
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
catch (error) {
|
|
25
|
-
this.logger.error(`Git command failed: ${command} - ` + error);
|
|
26
|
-
throw error;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
async clone(repoUrl, targetPath, cwd) {
|
|
30
|
-
if (this.dryRun) {
|
|
31
|
-
this.logger.info(`[DRY RUN] Would clone ${repoUrl} to ${targetPath}`);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
this.logger.info(`Cloning ${repoUrl}...`);
|
|
35
|
-
const repoName = targetPath.split('/').pop() || targetPath;
|
|
36
|
-
this.exec(`git clone ${repoUrl} ${repoName}`, cwd);
|
|
37
|
-
}
|
|
38
|
-
async checkoutMainBranch(repoName) {
|
|
39
|
-
if (this.dryRun) {
|
|
40
|
-
this.logger.info(`[DRY RUN] Would checkout main branch on ${repoName}`);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
this.exec(`git checkout main`, repoName);
|
|
44
|
-
}
|
|
45
|
-
async pull(cwd) {
|
|
46
|
-
if (this.dryRun) {
|
|
47
|
-
this.logger.info(`[DRY RUN] Would pull latest changes`);
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
this.exec('git pull origin main', cwd);
|
|
51
|
-
}
|
|
52
|
-
async createBranch(branchName, cwd) {
|
|
53
|
-
if (this.dryRun) {
|
|
54
|
-
this.logger.info(`[DRY RUN] Would create branch: ${branchName}`);
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
this.exec(`git checkout -b ${branchName}`, cwd);
|
|
58
|
-
}
|
|
59
|
-
async add(files, cwd) {
|
|
60
|
-
if (this.dryRun) {
|
|
61
|
-
this.logger.info(`[DRY RUN] Would add files: ${files.join(' ')}`);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
this.exec(`git add ${files.join(' ')}`, cwd);
|
|
65
|
-
}
|
|
66
|
-
async commit(message, cwd) {
|
|
67
|
-
if (this.dryRun) {
|
|
68
|
-
this.logger.info(`[DRY RUN] Would commit with message:`);
|
|
69
|
-
message.split('\n').forEach(line => this.logger.info(` ${line}`));
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
const escapedMessage = message.replace(/'/g, "'\\''");
|
|
73
|
-
this.exec(`git commit --no-verify -m '${escapedMessage}'`, cwd);
|
|
74
|
-
}
|
|
75
|
-
async push(branchName, cwd) {
|
|
76
|
-
if (this.dryRun) {
|
|
77
|
-
this.logger.info(`[DRY RUN] Would push branch: ${branchName}`);
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
this.exec(`git push -u origin ${branchName}`, cwd);
|
|
81
|
-
}
|
|
82
|
-
async createPR(branchName, title, body, cwd) {
|
|
83
|
-
if (this.dryRun) {
|
|
84
|
-
this.logger.info('[DRY RUN] Would create draft PR:');
|
|
85
|
-
this.logger.info(` Branch: ${branchName}`);
|
|
86
|
-
this.logger.info(` Title: ${title}`);
|
|
87
|
-
this.logger.info(` Body:`);
|
|
88
|
-
body.split('\n').forEach(line => this.logger.info(` ${line}`));
|
|
89
|
-
return 'https://github.com/example/repo/pull/0 (dry-run)';
|
|
90
|
-
}
|
|
91
|
-
await this.push(branchName, cwd);
|
|
92
|
-
const escapedTitle = title.replace(/'/g, "'\\''");
|
|
93
|
-
const prUrl = this.exec(`gh pr create --draft --title '${escapedTitle}' --body "$(cat <<'EOF'\n${body}\nEOF\n)"`, cwd);
|
|
94
|
-
this.logger.success(`Draft PR created: ${prUrl}`);
|
|
95
|
-
return prUrl;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
exports.GitOperations = GitOperations;
|
|
99
|
-
//# sourceMappingURL=git-operations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-operations.js","sourceRoot":"","sources":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AA;QAEhC,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QACjD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CACrB,iCAAiC,YAAY,4BAA4B,IAAI,WAAW,EACxF,GAAG,CACJ,CAAA;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,qBAAqB,KAAK,EAAE,CAAC,CAAA;QACjD,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AA/GD,sCA+GC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stack migration library exports
|
|
3
|
-
*/
|
|
4
|
-
export * from './constants';
|
|
5
|
-
export * from './types';
|
|
6
|
-
export * from './path-builder';
|
|
7
|
-
export * from './git-operations';
|
|
8
|
-
export * from './file-operations';
|
|
9
|
-
export * from './spacelift-client';
|
|
10
|
-
export * from '../../../utils/logger';
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/executors/stack-migration/lib/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Stack migration library exports
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
|
-
tslib_1.__exportStar(require("./constants"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./types"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./path-builder"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./git-operations"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./file-operations"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./spacelift-client"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("../../../utils/logger"), exports);
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/executors/stack-migration/lib/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,sDAA2B;AAC3B,kDAAuB;AACvB,yDAA8B;AAC9B,2DAAgC;AAChC,4DAAiC;AACjC,6DAAkC;AAClC,gEAAqC"}
|