@payfit/iac 1.0.0-ephemeral-release-rerun.1 → 1.0.0
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 +87 -14
- package/dist/executors/stack-migration/README.md +115 -69
- package/dist/executors/stack-migration/lib/constants.d.ts +1 -1
- package/dist/executors/stack-migration/lib/constants.js +1 -1
- package/dist/executors/stack-migration/lib/constants.js.map +1 -1
- package/dist/executors/stack-migration/lib/logger.d.ts +0 -1
- package/dist/executors/stack-migration/lib/logger.js +16 -15
- package/dist/executors/stack-migration/lib/logger.js.map +1 -1
- package/dist/executors/stack-migration/lib/migration-helper.d.ts +5 -7
- package/dist/executors/stack-migration/lib/migration-helper.js +36 -81
- package/dist/executors/stack-migration/lib/migration-helper.js.map +1 -1
- package/dist/executors/stack-migration/lib/migration-tool.d.ts +13 -18
- package/dist/executors/stack-migration/lib/migration-tool.js +404 -365
- package/dist/executors/stack-migration/lib/migration-tool.js.map +1 -1
- package/dist/executors/stack-migration/lib/templates/index.d.ts +0 -1
- package/dist/executors/stack-migration/lib/templates/index.js +0 -1
- package/dist/executors/stack-migration/lib/templates/index.js.map +1 -1
- package/dist/executors/stack-migration/lib/templates/message-templates.d.ts +20 -11
- package/dist/executors/stack-migration/lib/templates/message-templates.js +93 -28
- package/dist/executors/stack-migration/lib/templates/message-templates.js.map +1 -1
- package/dist/executors/stack-migration/lib/templates/pr-templates.d.ts +5 -16
- package/dist/executors/stack-migration/lib/templates/pr-templates.js +72 -81
- package/dist/executors/stack-migration/lib/templates/pr-templates.js.map +1 -1
- package/dist/executors/stack-migration/lib/templates/procedure-template.d.ts +0 -1
- package/dist/executors/stack-migration/lib/templates/procedure-template.js +118 -36
- package/dist/executors/stack-migration/lib/templates/procedure-template.js.map +1 -1
- package/dist/executors/stack-migration/lib/types.d.ts +0 -7
- package/dist/executors/stack-migration/schema.d.ts +4 -4
- package/dist/executors/stack-migration/schema.json +4 -7
- package/dist/executors/stack-migration/stack-migration.js +10 -10
- package/dist/executors/stack-migration/stack-migration.js.map +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/executors/stack-migration/lib/templates/mermaid-diagram.d.ts +0 -13
- package/dist/executors/stack-migration/lib/templates/mermaid-diagram.js +0 -45
- package/dist/executors/stack-migration/lib/templates/mermaid-diagram.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,31 +1,104 @@
|
|
|
1
1
|
# @payfit/iac
|
|
2
2
|
|
|
3
|
-
Nx plugin for infrastructure as code operations
|
|
3
|
+
A Nx plugin that provides executors for infrastructure as code operations
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```shell
|
|
8
8
|
npx nx add @payfit/iac
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Stack Migration Executor
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
The stack migration executor automates the process of migrating Spacelift stacks from a centralized iac-deploy repository to repository-level metastacks with autodiscovery.
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
#### Quick Start
|
|
16
18
|
|
|
17
19
|
```bash
|
|
18
|
-
|
|
20
|
+
# Run the complete migration workflow
|
|
21
|
+
npx nx run <project>:stack-migration --command=run
|
|
22
|
+
|
|
23
|
+
# Run in dry-run mode to preview changes
|
|
24
|
+
npx nx run <project>:stack-migration --command=run --dryRun
|
|
19
25
|
```
|
|
20
26
|
|
|
21
|
-
|
|
27
|
+
#### Migration Workflow
|
|
22
28
|
|
|
23
|
-
|
|
29
|
+
The migration process consists of several phases:
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
# Build
|
|
27
|
-
npx nx build iac
|
|
31
|
+
1. **Initialization**: Clone repositories and collect configuration
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
npx nx
|
|
31
|
-
```
|
|
33
|
+
```bash
|
|
34
|
+
npx nx run <project>:stack-migration --command=init
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
2. **Domain Enrollment**: Create PR to enroll repository in domain
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx nx run <project>:stack-migration --command=enroll
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
3. **Generate Migration Files**: Create service repository PR with import configuration
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx nx run <project>:stack-migration --command=generate-tf-migration
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
4. **Cleanup**: Create PR to remove old stack configuration
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx nx run <project>:stack-migration --command=cleanup-pr
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
5. **Generate Documentation**: Create migration procedure document
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx nx run <project>:stack-migration --command=generate-procedure
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
6. **Migrate Spaces** (Manual step): Move stacks to domain space
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npx nx run <project>:stack-migration --command=migrate-spaces
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
7. **Cleanup Migration Files**: Remove temporary migration files
|
|
68
|
+
```bash
|
|
69
|
+
npx nx run <project>:stack-migration --command=migration-cleanup
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### Configuration
|
|
73
|
+
|
|
74
|
+
Once installed, the executor should be automatically inferred from your root project.
|
|
75
|
+
|
|
76
|
+
#### Available Commands
|
|
77
|
+
|
|
78
|
+
- `init` - Initialize migration by cloning repositories and collecting configuration
|
|
79
|
+
- `state` - Check current migration state
|
|
80
|
+
- `enroll` - Create domain enrollment PR
|
|
81
|
+
- `generate-tf-migration` - Generate service repository PR and state removal commands
|
|
82
|
+
- `cleanup-pr` - Create cleanup PR for iac-deploy
|
|
83
|
+
- `generate-procedure` - Generate migration procedure documentation
|
|
84
|
+
- `migrate-spaces` - Update stack spaces (manual step, run after state removal)
|
|
85
|
+
- `migration-cleanup` - Clean up migration files after completion
|
|
86
|
+
- `run` - Execute complete migration workflow (excludes migrate-spaces for safety)
|
|
87
|
+
- `help` - Display help information
|
|
88
|
+
|
|
89
|
+
#### Important Notes
|
|
90
|
+
|
|
91
|
+
- The migration state is saved in `.migration-state.json` and can be resumed from any step
|
|
92
|
+
- The `migrate-spaces` command must be run manually after executing state removal commands
|
|
93
|
+
- Follow the recommended order: enrollment → migration files → state removal → space migration → cleanup
|
|
94
|
+
- Always review PRs before merging them
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Building
|
|
99
|
+
|
|
100
|
+
Run `npx nx build iac` to build the library.
|
|
101
|
+
|
|
102
|
+
## Running unit tests
|
|
103
|
+
|
|
104
|
+
Run `npx nx test iac` to execute the unit tests via [Vitest](https://vitest.dev/).
|
|
@@ -1,79 +1,125 @@
|
|
|
1
1
|
# Stack Migration Executor
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
```
|
|
3
|
+
NX executor for migrating Spacelift stacks from centralized iac-deploy to repository-level metastacks.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This tool automates the migration of Spacelift stacks to the new metastack architecture. It creates necessary PRs, generates import files, and manages state removal.
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
29
10
|
|
|
30
|
-
|
|
11
|
+
### Complete Workflow
|
|
31
12
|
|
|
32
13
|
```bash
|
|
33
|
-
#
|
|
14
|
+
# Run the full migration (recommended for first-time users)
|
|
34
15
|
nx run <project>:stack-migration --command=run
|
|
35
16
|
|
|
36
|
-
#
|
|
37
|
-
nx run <project>:stack-migration --command=run --
|
|
17
|
+
# Run in dry-run mode to preview changes
|
|
18
|
+
nx run <project>:stack-migration --command=run --dryRun
|
|
38
19
|
```
|
|
39
20
|
|
|
40
|
-
|
|
21
|
+
### Individual Steps
|
|
22
|
+
|
|
23
|
+
You can also run each step independently. This is useful if you need to pause the migration or re-run specific steps.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# 1. Initialize migration (clone repos, collect info)
|
|
27
|
+
nx run <project>:stack-migration --command=init
|
|
28
|
+
|
|
29
|
+
# 2. Check migration state
|
|
30
|
+
nx run <project>:stack-migration --command=state
|
|
31
|
+
|
|
32
|
+
# 3. Create domain enrollment PR
|
|
33
|
+
nx run <project>:stack-migration --command=enroll
|
|
34
|
+
|
|
35
|
+
# 4. Create service repository PR and generate state removal commands
|
|
36
|
+
nx run <project>:stack-migration --command=generate-tf-migration
|
|
37
|
+
|
|
38
|
+
# 5. Create cleanup PR (iac-deploy)
|
|
39
|
+
nx run <project>:stack-migration --command=cleanup-pr
|
|
40
|
+
|
|
41
|
+
# 6. Generate migration procedure documentation
|
|
42
|
+
nx run <project>:stack-migration --command=generate-procedure
|
|
43
|
+
|
|
44
|
+
# 7. Update stack spaces (move to domain space) - RUN MANUALLY ONLY
|
|
45
|
+
nx run <project>:stack-migration --command=migrate-spaces
|
|
46
|
+
|
|
47
|
+
# 8. Clean up migration files
|
|
48
|
+
nx run <project>:stack-migration --command=migration-cleanup
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Migration Flow and Dependencies
|
|
52
|
+
|
|
53
|
+
The migration follows a specific sequence. Here's the required flow:
|
|
54
|
+
|
|
55
|
+
### Phase 1: Setup and Configuration
|
|
56
|
+
|
|
57
|
+
1. **init** - Clones required repos, validates auth, collects service info
|
|
58
|
+
- Creates `.migration-state.json` to track progress
|
|
59
|
+
- Clones: `domain-enrollment`, `iac-deploy`
|
|
60
|
+
- Loads stack configuration
|
|
61
|
+
|
|
62
|
+
### Phase 2: Safety and Enrollment
|
|
63
|
+
|
|
64
|
+
2. **enroll** - Creates domain enrollment PR
|
|
65
|
+
- Adds repository to domain's `spacelift.yaml`
|
|
66
|
+
- PR must be merged before continuing
|
|
67
|
+
- Deploys the metastack for your repository
|
|
68
|
+
|
|
69
|
+
3. **generate-tf-migration** - Creates service repository PR and state removal script
|
|
70
|
+
- Copies `spacelift.yaml` from iac-deploy
|
|
71
|
+
- Generates `.metastack/import.tf` with import blocks
|
|
72
|
+
- Generates `METASTACK_STATE_REMOVAL_COMMANDS.sh`
|
|
73
|
+
- DO NOT MERGE THIS PR YET
|
|
74
|
+
|
|
75
|
+
### Phase 3: Cleanup and State Management
|
|
76
|
+
|
|
77
|
+
4. **cleanup-pr** - Creates cleanup PR
|
|
78
|
+
- iac-deploy: Removes stack configuration file
|
|
79
|
+
- DO NOT MERGE THIS PR YET
|
|
80
|
+
|
|
81
|
+
5. **generate-procedure** - Generates migration documentation
|
|
82
|
+
- Creates `METASTACK_MIGRATION_PROCEDURE.md`
|
|
83
|
+
- Provides complete overview of migration steps
|
|
84
|
+
|
|
85
|
+
6. **migrate-spaces** - Updates stack spaces (MANUAL STEP)
|
|
86
|
+
- Moves stacks from old space to `domain-{domain}` space
|
|
87
|
+
- **IMPORTANT**: Run MANUALLY after state removal commands
|
|
88
|
+
- Run AFTER state removal, BEFORE merging cleanup PRs
|
|
89
|
+
- NOT included in full `run` workflow for safety
|
|
90
|
+
|
|
91
|
+
### Phase 4: Completion
|
|
92
|
+
|
|
93
|
+
7. After all steps complete:
|
|
94
|
+
- Merge cleanup PR (iac-deploy)
|
|
95
|
+
- Merge service repository PR
|
|
96
|
+
- Run **migration-cleanup** to remove temporary files
|
|
97
|
+
|
|
98
|
+
## Important Notes
|
|
99
|
+
|
|
100
|
+
### State Management
|
|
101
|
+
|
|
102
|
+
- Migration state is saved in `.migration-state.json`
|
|
103
|
+
- You can resume migration from any step
|
|
104
|
+
- Configuration (stacks) is preserved in state
|
|
105
|
+
- You can run steps in any order after `init`, but follow the recommended flow
|
|
106
|
+
|
|
107
|
+
### Order Requirements
|
|
108
|
+
|
|
109
|
+
While steps can be run independently, they should generally follow this sequence:
|
|
110
|
+
|
|
111
|
+
1. `init` must be run first (loads configuration)
|
|
112
|
+
2. `enroll` should be merged before running `generate-tf-migration`
|
|
113
|
+
3. `generate-tf-migration` creates the service repo PR and state removal script
|
|
114
|
+
4. Run state removal commands from `METASTACK_STATE_REMOVAL_COMMANDS.sh` before merging cleanup PR
|
|
115
|
+
5. Run `migrate-spaces` MANUALLY after state removal but before merging cleanup PR
|
|
116
|
+
6. Merge cleanup PR before merging service repository PR
|
|
117
|
+
7. The full `run` command skips `migrate-spaces` for safety - you must run it manually
|
|
118
|
+
|
|
119
|
+
### Files Generated
|
|
41
120
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
|
121
|
+
- `.migration-state.json` - Migration state and progress
|
|
122
|
+
- `METASTACK_MIGRATION_PROCEDURE.md` - Complete migration procedure
|
|
123
|
+
- `METASTACK_STATE_REMOVAL_COMMANDS.sh` - Commands to remove Terraform state
|
|
124
|
+
- `.metastack/import.tf` - Terraform import blocks
|
|
125
|
+
- `spacelift.yaml` - Stack configuration
|
|
@@ -17,7 +17,7 @@ export declare const IAC_DEPLOY_PATHS: {
|
|
|
17
17
|
export declare const DOMAIN_ENROLLMENT_PATHS: {
|
|
18
18
|
readonly domains: "domains";
|
|
19
19
|
readonly spaceliftDir: "spacelift";
|
|
20
|
-
readonly spaceliftYaml: "spacelift/
|
|
20
|
+
readonly spaceliftYaml: "spacelift/spacelift.yaml";
|
|
21
21
|
};
|
|
22
22
|
export declare const SPACELIFT_API: {
|
|
23
23
|
readonly endpoint: "https://payfit.app.spacelift.io/graphql";
|
|
@@ -27,7 +27,7 @@ exports.IAC_DEPLOY_PATHS = {
|
|
|
27
27
|
exports.DOMAIN_ENROLLMENT_PATHS = {
|
|
28
28
|
domains: 'domains',
|
|
29
29
|
spaceliftDir: 'spacelift',
|
|
30
|
-
spaceliftYaml: 'spacelift/
|
|
30
|
+
spaceliftYaml: 'spacelift/spacelift.yaml',
|
|
31
31
|
};
|
|
32
32
|
exports.SPACELIFT_API = {
|
|
33
33
|
endpoint: 'https://payfit.app.spacelift.io/graphql',
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,0BAA0B;CACjC,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,32 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MigrationLogger =
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
fancy: true,
|
|
7
|
-
});
|
|
3
|
+
exports.MigrationLogger = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const chalk = tslib_1.__importStar(require("chalk"));
|
|
8
6
|
class MigrationLogger {
|
|
9
7
|
info(message) {
|
|
10
|
-
|
|
8
|
+
console.log(message);
|
|
11
9
|
}
|
|
12
10
|
success(message) {
|
|
13
|
-
|
|
11
|
+
console.log(chalk.green(`✓ ${message}`));
|
|
14
12
|
}
|
|
15
13
|
warn(message) {
|
|
16
|
-
|
|
14
|
+
console.log(chalk.yellow(`⚠ ${message}`));
|
|
17
15
|
}
|
|
18
16
|
error(message) {
|
|
19
|
-
|
|
17
|
+
console.log(chalk.red(`✗ ${message}`));
|
|
20
18
|
}
|
|
21
19
|
section(title) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
console.log('');
|
|
21
|
+
console.log(chalk.cyan.bold('='.repeat(60)));
|
|
22
|
+
console.log(chalk.cyan.bold(title));
|
|
23
|
+
console.log(chalk.cyan.bold('='.repeat(60)));
|
|
24
|
+
console.log('');
|
|
25
25
|
}
|
|
26
26
|
step(current, total, description) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
console.log('');
|
|
28
|
+
console.log(chalk.blue.bold(`[Step ${current}/${total}] ${description}`));
|
|
29
|
+
console.log(chalk.blue('-'.repeat(60)));
|
|
30
|
+
console.log('');
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
exports.MigrationLogger = MigrationLogger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../../src/executors/stack-migration/lib/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../../src/executors/stack-migration/lib/logger.ts"],"names":[],"mappings":";;;;AAAA,qDAA8B;AAE9B,MAAa,eAAe;IAC1B,IAAI,CAAC,OAAe;QAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IACtB,CAAC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CACF;AA/BD,0CA+BC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as readline from 'readline';
|
|
1
2
|
import type { MigrationConfig } from './types';
|
|
2
3
|
import { FileOperations } from './file-operations';
|
|
3
4
|
import { GitOperations } from './git-operations';
|
|
@@ -5,12 +6,15 @@ import { MigrationLogger } from './logger';
|
|
|
5
6
|
import { MigrationPaths } from './path-builder';
|
|
6
7
|
export declare class MigrationHelper {
|
|
7
8
|
logger: MigrationLogger;
|
|
9
|
+
rl: readline.Interface | null;
|
|
8
10
|
config: MigrationConfig;
|
|
9
11
|
dryRun: boolean;
|
|
10
12
|
paths: MigrationPaths;
|
|
11
13
|
git: GitOperations;
|
|
12
14
|
files: FileOperations;
|
|
13
15
|
constructor(dryRun?: boolean, serviceRepoPath?: string);
|
|
16
|
+
initReadline(): void;
|
|
17
|
+
closeReadline(): void;
|
|
14
18
|
ask(question: string): Promise<string>;
|
|
15
19
|
confirm(question: string, defaultYes?: boolean): Promise<boolean>;
|
|
16
20
|
getOrAskConfig(optionValue: string | string[] | undefined, promptText: string, defaultValue?: string): Promise<string>;
|
|
@@ -21,15 +25,9 @@ export declare class MigrationHelper {
|
|
|
21
25
|
silent?: boolean;
|
|
22
26
|
}): string;
|
|
23
27
|
execSilent(command: string, cwd?: string): string;
|
|
24
|
-
isSpacectlInstalled(): boolean;
|
|
25
|
-
ensureSpacectlInstalled(): Promise<void>;
|
|
26
28
|
isSpacectlAuthenticated(): boolean;
|
|
27
29
|
ensureSpacectlAuthentication(): Promise<void>;
|
|
28
|
-
|
|
29
|
-
identifier: string;
|
|
30
|
-
environment: string;
|
|
31
|
-
region?: string;
|
|
32
|
-
}): string;
|
|
30
|
+
getStackResourcesFromDirectory(stackId: string, cwd: string): string;
|
|
33
31
|
getStackModuleKey(stack: {
|
|
34
32
|
identifier: string;
|
|
35
33
|
environment: string;
|
|
@@ -4,6 +4,7 @@ exports.MigrationHelper = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const child_process_1 = require("child_process");
|
|
6
6
|
const fs = tslib_1.__importStar(require("fs"));
|
|
7
|
+
const readline = tslib_1.__importStar(require("readline"));
|
|
7
8
|
const constants_1 = require("./constants");
|
|
8
9
|
const file_operations_1 = require("./file-operations");
|
|
9
10
|
const git_operations_1 = require("./git-operations");
|
|
@@ -11,6 +12,7 @@ const logger_1 = require("./logger");
|
|
|
11
12
|
const path_builder_1 = require("./path-builder");
|
|
12
13
|
class MigrationHelper {
|
|
13
14
|
constructor(dryRun = false, serviceRepoPath = process.cwd()) {
|
|
15
|
+
this.rl = null;
|
|
14
16
|
this.dryRun = dryRun;
|
|
15
17
|
this.logger = new logger_1.MigrationLogger();
|
|
16
18
|
this.config = {
|
|
@@ -32,40 +34,41 @@ class MigrationHelper {
|
|
|
32
34
|
this.git = new git_operations_1.GitOperations(dryRun, this.logger);
|
|
33
35
|
this.files = new file_operations_1.FileOperations(dryRun, this.logger);
|
|
34
36
|
}
|
|
37
|
+
initReadline() {
|
|
38
|
+
if (!this.rl) {
|
|
39
|
+
this.rl = readline.createInterface({
|
|
40
|
+
input: process.stdin,
|
|
41
|
+
output: process.stdout,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
closeReadline() {
|
|
46
|
+
if (this.rl) {
|
|
47
|
+
this.rl.close();
|
|
48
|
+
this.rl = null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
35
51
|
async ask(question) {
|
|
36
|
-
|
|
37
|
-
|
|
52
|
+
this.initReadline();
|
|
53
|
+
return new Promise(resolve => {
|
|
54
|
+
this.rl.question(` ${question}: `, answer => {
|
|
55
|
+
resolve(answer.trim());
|
|
56
|
+
});
|
|
38
57
|
});
|
|
39
|
-
if (answer === null || answer === undefined) {
|
|
40
|
-
// User cancelled
|
|
41
|
-
process.exit(0);
|
|
42
|
-
}
|
|
43
|
-
return String(answer).trim();
|
|
44
58
|
}
|
|
45
59
|
async confirm(question, defaultYes = false) {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
// User cancelled
|
|
52
|
-
process.exit(0);
|
|
53
|
-
}
|
|
54
|
-
return Boolean(answer);
|
|
60
|
+
const suffix = defaultYes ? ' (Y/n)' : ' (y/N)';
|
|
61
|
+
const answer = await this.ask(question + suffix);
|
|
62
|
+
if (!answer)
|
|
63
|
+
return defaultYes;
|
|
64
|
+
return answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes';
|
|
55
65
|
}
|
|
56
66
|
async getOrAskConfig(optionValue, promptText, defaultValue) {
|
|
57
67
|
if (optionValue) {
|
|
58
68
|
return Array.isArray(optionValue) ? optionValue.join(',') : optionValue;
|
|
59
69
|
}
|
|
60
|
-
const answer = await
|
|
61
|
-
|
|
62
|
-
initial: defaultValue,
|
|
63
|
-
});
|
|
64
|
-
if (answer === null || answer === undefined) {
|
|
65
|
-
// User cancelled
|
|
66
|
-
process.exit(0);
|
|
67
|
-
}
|
|
68
|
-
return String(answer) || defaultValue || '';
|
|
70
|
+
const answer = await this.ask(defaultValue ? `${promptText} [${defaultValue}]` : promptText);
|
|
71
|
+
return answer || defaultValue || '';
|
|
69
72
|
}
|
|
70
73
|
generateBranchName(prefix) {
|
|
71
74
|
return `${prefix}-${Date.now()}`;
|
|
@@ -93,46 +96,6 @@ class MigrationHelper {
|
|
|
93
96
|
execSilent(command, cwd) {
|
|
94
97
|
return this.exec(command, { cwd, silent: true });
|
|
95
98
|
}
|
|
96
|
-
isSpacectlInstalled() {
|
|
97
|
-
try {
|
|
98
|
-
this.execSilent('which spacectl');
|
|
99
|
-
return true;
|
|
100
|
-
}
|
|
101
|
-
catch {
|
|
102
|
-
return false;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
async ensureSpacectlInstalled() {
|
|
106
|
-
if (this.isSpacectlInstalled()) {
|
|
107
|
-
this.logger.success('spacectl CLI is installed');
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
this.logger.warn('spacectl CLI is not installed');
|
|
111
|
-
if (this.dryRun) {
|
|
112
|
-
this.logger.info('[DRY RUN] Would install spacectl');
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
const shouldInstall = await this.confirm('Install spacectl using brew now?', true);
|
|
116
|
-
if (!shouldInstall) {
|
|
117
|
-
this.logger.error('spacectl CLI is required');
|
|
118
|
-
this.logger.info('Install spacectl using:');
|
|
119
|
-
this.logger.info(' brew install spacelift-io/spacelift/spacectl');
|
|
120
|
-
this.logger.info('');
|
|
121
|
-
this.logger.info('Or visit: https://github.com/spacelift-io/spacectl#installation');
|
|
122
|
-
throw new Error('spacectl CLI is required. Please install it and try again.');
|
|
123
|
-
}
|
|
124
|
-
this.logger.info('Installing spacectl...');
|
|
125
|
-
try {
|
|
126
|
-
this.exec('brew install spacelift-io/spacelift/spacectl');
|
|
127
|
-
this.logger.success('spacectl installed successfully');
|
|
128
|
-
}
|
|
129
|
-
catch (error) {
|
|
130
|
-
this.logger.error('Failed to install spacectl');
|
|
131
|
-
this.logger.info('Please install manually:');
|
|
132
|
-
this.logger.info(' brew install spacelift-io/spacelift/spacectl');
|
|
133
|
-
throw error;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
99
|
isSpacectlAuthenticated() {
|
|
137
100
|
try {
|
|
138
101
|
this.execSilent('spacectl profile current');
|
|
@@ -152,27 +115,19 @@ class MigrationHelper {
|
|
|
152
115
|
return;
|
|
153
116
|
}
|
|
154
117
|
this.logger.warn('spacectl is not authenticated');
|
|
155
|
-
const shouldLogin = await this.confirm('Run spacectl profile login
|
|
118
|
+
const shouldLogin = await this.confirm('Run spacectl profile login now?', true);
|
|
156
119
|
if (!shouldLogin) {
|
|
157
|
-
throw new Error('spacectl authentication required. Run: spacectl profile login
|
|
158
|
-
}
|
|
159
|
-
this.logger.info('Running spacectl profile login payfit...');
|
|
160
|
-
try {
|
|
161
|
-
this.exec('spacectl profile login --endpoint https://payfit.app.spacelift.io/ payfit');
|
|
162
|
-
this.logger.success('spacectl authentication complete');
|
|
163
|
-
}
|
|
164
|
-
catch (error) {
|
|
165
|
-
this.logger.error('Failed to authenticate with spacectl');
|
|
166
|
-
this.logger.info('Please run manually:');
|
|
167
|
-
this.logger.info(' spacectl profile login --endpoint https://payfit.app.spacelift.io/ payfit');
|
|
168
|
-
throw error;
|
|
120
|
+
throw new Error('spacectl authentication required. Run: spacectl profile login');
|
|
169
121
|
}
|
|
122
|
+
this.logger.info('Running spacectl profile login...');
|
|
123
|
+
this.exec('spacectl profile login');
|
|
124
|
+
this.logger.success('spacectl authentication complete');
|
|
170
125
|
}
|
|
171
|
-
|
|
172
|
-
return
|
|
126
|
+
getStackResourcesFromDirectory(stackId, cwd) {
|
|
127
|
+
return this.execSilent(`spacectl stack resources list --id ${stackId}`, cwd);
|
|
173
128
|
}
|
|
174
129
|
getStackModuleKey(stack) {
|
|
175
|
-
return `${stack.identifier}
|
|
130
|
+
return `${stack.identifier}-${stack.environment}${stack.region ? `-${stack.region}` : ''}`;
|
|
176
131
|
}
|
|
177
132
|
saveMigrationState() {
|
|
178
133
|
if (this.dryRun) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-helper.js","sourceRoot":"","sources":["../../../../src/executors/stack-migration/lib/migration-helper.ts"],"names":[],"mappings":";;;;AAAA,iDAAwC;AACxC,+CAAwB;
|
|
1
|
+
{"version":3,"file":"migration-helper.js","sourceRoot":"","sources":["../../../../src/executors/stack-migration/lib/migration-helper.ts"],"names":[],"mappings":";;;;AAAA,iDAAwC;AACxC,+CAAwB;AACxB,2DAAoC;AAIpC,2CAAwC;AACxC,uDAAkD;AAClD,qDAAgD;AAChD,qCAA0C;AAC1C,iDAA+C;AAE/C,MAAa,eAAe;IAS1B,YAAY,MAAM,GAAG,KAAK,EAAE,kBAA0B,OAAO,CAAC,GAAG,EAAE;QAP5D,OAAE,GAA8B,IAAI,CAAA;QAQzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA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