@payfit/iac 1.0.0-ephemeral-migration-scripts.10 → 1.0.0-ephemeral-release-rerun.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 +14 -87
- package/dist/executors/stack-migration/README.md +69 -115
- 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 +1 -0
- package/dist/executors/stack-migration/lib/logger.js +15 -16
- package/dist/executors/stack-migration/lib/logger.js.map +1 -1
- package/dist/executors/stack-migration/lib/migration-helper.d.ts +7 -5
- package/dist/executors/stack-migration/lib/migration-helper.js +81 -36
- package/dist/executors/stack-migration/lib/migration-helper.js.map +1 -1
- package/dist/executors/stack-migration/lib/migration-tool.d.ts +18 -13
- package/dist/executors/stack-migration/lib/migration-tool.js +365 -404
- package/dist/executors/stack-migration/lib/migration-tool.js.map +1 -1
- package/dist/executors/stack-migration/lib/templates/index.d.ts +1 -0
- package/dist/executors/stack-migration/lib/templates/index.js +1 -0
- package/dist/executors/stack-migration/lib/templates/index.js.map +1 -1
- package/dist/executors/stack-migration/lib/templates/mermaid-diagram.d.ts +13 -0
- package/dist/executors/stack-migration/lib/templates/mermaid-diagram.js +45 -0
- package/dist/executors/stack-migration/lib/templates/mermaid-diagram.js.map +1 -0
- package/dist/executors/stack-migration/lib/templates/message-templates.d.ts +11 -20
- package/dist/executors/stack-migration/lib/templates/message-templates.js +28 -93
- package/dist/executors/stack-migration/lib/templates/message-templates.js.map +1 -1
- package/dist/executors/stack-migration/lib/templates/pr-templates.d.ts +16 -5
- package/dist/executors/stack-migration/lib/templates/pr-templates.js +81 -72
- package/dist/executors/stack-migration/lib/templates/pr-templates.js.map +1 -1
- package/dist/executors/stack-migration/lib/templates/procedure-template.d.ts +1 -0
- package/dist/executors/stack-migration/lib/templates/procedure-template.js +36 -118
- package/dist/executors/stack-migration/lib/templates/procedure-template.js.map +1 -1
- package/dist/executors/stack-migration/lib/types.d.ts +7 -0
- package/dist/executors/stack-migration/schema.d.ts +4 -4
- package/dist/executors/stack-migration/schema.json +7 -4
- 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 +4 -7
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,104 +1,31 @@
|
|
|
1
1
|
# @payfit/iac
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Nx plugin for infrastructure as code operations.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```bash
|
|
8
8
|
npx nx add @payfit/iac
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
### Stack Migration Executor
|
|
11
|
+
## Executors
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
### Stack Migration
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
Migrate Spacelift stacks from iac-deploy to repository-level metastacks.
|
|
18
16
|
|
|
19
17
|
```bash
|
|
20
|
-
|
|
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
|
|
18
|
+
nx run <project>:stack-migration --command=run
|
|
25
19
|
```
|
|
26
20
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
The migration process consists of several phases:
|
|
30
|
-
|
|
31
|
-
1. **Initialization**: Clone repositories and collect configuration
|
|
32
|
-
|
|
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
|
-
```
|
|
21
|
+
See [Stack Migration README](./src/executors/stack-migration/README.md) for detailed documentation.
|
|
60
22
|
|
|
61
|
-
|
|
23
|
+
## Development
|
|
62
24
|
|
|
63
|
-
|
|
64
|
-
|
|
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
|
|
25
|
+
```bash
|
|
26
|
+
# Build
|
|
27
|
+
npx nx build iac
|
|
103
28
|
|
|
104
|
-
|
|
29
|
+
# Test
|
|
30
|
+
npx nx test iac
|
|
31
|
+
```
|
|
@@ -1,125 +1,79 @@
|
|
|
1
1
|
# Stack Migration Executor
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
19
28
|
```
|
|
20
29
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
You can also run each step independently. This is useful if you need to pause the migration or re-run specific steps.
|
|
30
|
+
## Quick Start
|
|
24
31
|
|
|
25
32
|
```bash
|
|
26
|
-
#
|
|
27
|
-
nx run <project>:stack-migration --command=
|
|
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
|
|
33
|
+
# Full migration (recommended)
|
|
34
|
+
nx run <project>:stack-migration --command=run
|
|
46
35
|
|
|
47
|
-
#
|
|
48
|
-
nx run <project>:stack-migration --command=
|
|
36
|
+
# Preview changes first
|
|
37
|
+
nx run <project>:stack-migration --command=run --dry-run
|
|
49
38
|
```
|
|
50
39
|
|
|
51
|
-
##
|
|
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
|
|
40
|
+
## Commands
|
|
120
41
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
|
@@ -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/spacelift.yaml";
|
|
20
|
+
readonly spaceliftYaml: "spacelift/domain-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/spacelift.yaml',
|
|
30
|
+
spaceliftYaml: 'spacelift/domain-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,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,33 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MigrationLogger = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
3
|
+
exports.MigrationLogger = exports.consola = void 0;
|
|
4
|
+
const consola_1 = require("consola");
|
|
5
|
+
exports.consola = (0, consola_1.createConsola)({
|
|
6
|
+
fancy: true,
|
|
7
|
+
});
|
|
6
8
|
class MigrationLogger {
|
|
7
9
|
info(message) {
|
|
8
|
-
|
|
10
|
+
exports.consola.info(message);
|
|
9
11
|
}
|
|
10
12
|
success(message) {
|
|
11
|
-
|
|
13
|
+
exports.consola.success(message);
|
|
12
14
|
}
|
|
13
15
|
warn(message) {
|
|
14
|
-
|
|
16
|
+
exports.consola.warn(message);
|
|
15
17
|
}
|
|
16
18
|
error(message) {
|
|
17
|
-
|
|
19
|
+
exports.consola.error(message);
|
|
18
20
|
}
|
|
19
21
|
section(title) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
console.log(chalk.cyan.bold('='.repeat(60)));
|
|
24
|
-
console.log('');
|
|
22
|
+
exports.consola.log('');
|
|
23
|
+
exports.consola.box(title);
|
|
24
|
+
exports.consola.log('');
|
|
25
25
|
}
|
|
26
26
|
step(current, total, description) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
console.log('');
|
|
27
|
+
exports.consola.log('');
|
|
28
|
+
exports.consola.start(`[Step ${current}/${total}] ${description}`);
|
|
29
|
+
exports.consola.log('');
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
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,qCAAuC;AAE1B,QAAA,OAAO,GAAG,IAAA,uBAAa,EAAC;IACnC,KAAK,EAAE,IAAI;CACZ,CAAC,CAAA;AAEF,MAAa,eAAe;IAC1B,IAAI,CAAC,OAAe;QAClB,eAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACvB,CAAC;IAED,OAAO,CAAC,OAAe;QACrB,eAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC1B,CAAC;IAED,IAAI,CAAC,OAAe;QAClB,eAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACvB,CAAC;IAED,KAAK,CAAC,OAAe;QACnB,eAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACxB,CAAC;IAED,OAAO,CAAC,KAAa;QACnB,eAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACf,eAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAClB,eAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACjB,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,KAAa,EAAE,WAAmB;QACtD,eAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACf,eAAO,CAAC,KAAK,CAAC,SAAS,OAAO,IAAI,KAAK,KAAK,WAAW,EAAE,CAAC,CAAA;QAC1D,eAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACjB,CAAC;CACF;AA5BD,0CA4BC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as readline from 'readline';
|
|
2
1
|
import type { MigrationConfig } from './types';
|
|
3
2
|
import { FileOperations } from './file-operations';
|
|
4
3
|
import { GitOperations } from './git-operations';
|
|
@@ -6,15 +5,12 @@ import { MigrationLogger } from './logger';
|
|
|
6
5
|
import { MigrationPaths } from './path-builder';
|
|
7
6
|
export declare class MigrationHelper {
|
|
8
7
|
logger: MigrationLogger;
|
|
9
|
-
rl: readline.Interface | null;
|
|
10
8
|
config: MigrationConfig;
|
|
11
9
|
dryRun: boolean;
|
|
12
10
|
paths: MigrationPaths;
|
|
13
11
|
git: GitOperations;
|
|
14
12
|
files: FileOperations;
|
|
15
13
|
constructor(dryRun?: boolean, serviceRepoPath?: string);
|
|
16
|
-
initReadline(): void;
|
|
17
|
-
closeReadline(): void;
|
|
18
14
|
ask(question: string): Promise<string>;
|
|
19
15
|
confirm(question: string, defaultYes?: boolean): Promise<boolean>;
|
|
20
16
|
getOrAskConfig(optionValue: string | string[] | undefined, promptText: string, defaultValue?: string): Promise<string>;
|
|
@@ -25,9 +21,15 @@ export declare class MigrationHelper {
|
|
|
25
21
|
silent?: boolean;
|
|
26
22
|
}): string;
|
|
27
23
|
execSilent(command: string, cwd?: string): string;
|
|
24
|
+
isSpacectlInstalled(): boolean;
|
|
25
|
+
ensureSpacectlInstalled(): Promise<void>;
|
|
28
26
|
isSpacectlAuthenticated(): boolean;
|
|
29
27
|
ensureSpacectlAuthentication(): Promise<void>;
|
|
30
|
-
|
|
28
|
+
getStacksGeneratorModuleKey(stack: {
|
|
29
|
+
identifier: string;
|
|
30
|
+
environment: string;
|
|
31
|
+
region?: string;
|
|
32
|
+
}): string;
|
|
31
33
|
getStackModuleKey(stack: {
|
|
32
34
|
identifier: string;
|
|
33
35
|
environment: string;
|
|
@@ -4,7 +4,6 @@ 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"));
|
|
8
7
|
const constants_1 = require("./constants");
|
|
9
8
|
const file_operations_1 = require("./file-operations");
|
|
10
9
|
const git_operations_1 = require("./git-operations");
|
|
@@ -12,7 +11,6 @@ const logger_1 = require("./logger");
|
|
|
12
11
|
const path_builder_1 = require("./path-builder");
|
|
13
12
|
class MigrationHelper {
|
|
14
13
|
constructor(dryRun = false, serviceRepoPath = process.cwd()) {
|
|
15
|
-
this.rl = null;
|
|
16
14
|
this.dryRun = dryRun;
|
|
17
15
|
this.logger = new logger_1.MigrationLogger();
|
|
18
16
|
this.config = {
|
|
@@ -34,41 +32,40 @@ class MigrationHelper {
|
|
|
34
32
|
this.git = new git_operations_1.GitOperations(dryRun, this.logger);
|
|
35
33
|
this.files = new file_operations_1.FileOperations(dryRun, this.logger);
|
|
36
34
|
}
|
|
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
|
-
}
|
|
51
35
|
async ask(question) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.rl.question(` ${question}: `, answer => {
|
|
55
|
-
resolve(answer.trim());
|
|
56
|
-
});
|
|
36
|
+
const answer = await logger_1.consola.prompt(question, {
|
|
37
|
+
type: 'text',
|
|
57
38
|
});
|
|
39
|
+
if (answer === null || answer === undefined) {
|
|
40
|
+
// User cancelled
|
|
41
|
+
process.exit(0);
|
|
42
|
+
}
|
|
43
|
+
return String(answer).trim();
|
|
58
44
|
}
|
|
59
45
|
async confirm(question, defaultYes = false) {
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
46
|
+
const answer = await logger_1.consola.prompt(question, {
|
|
47
|
+
type: 'confirm',
|
|
48
|
+
initial: defaultYes,
|
|
49
|
+
});
|
|
50
|
+
if (answer === null || answer === undefined) {
|
|
51
|
+
// User cancelled
|
|
52
|
+
process.exit(0);
|
|
53
|
+
}
|
|
54
|
+
return Boolean(answer);
|
|
65
55
|
}
|
|
66
56
|
async getOrAskConfig(optionValue, promptText, defaultValue) {
|
|
67
57
|
if (optionValue) {
|
|
68
58
|
return Array.isArray(optionValue) ? optionValue.join(',') : optionValue;
|
|
69
59
|
}
|
|
70
|
-
const answer = await
|
|
71
|
-
|
|
60
|
+
const answer = await logger_1.consola.prompt(promptText, {
|
|
61
|
+
type: 'text',
|
|
62
|
+
initial: defaultValue,
|
|
63
|
+
});
|
|
64
|
+
if (answer === null || answer === undefined) {
|
|
65
|
+
// User cancelled
|
|
66
|
+
process.exit(0);
|
|
67
|
+
}
|
|
68
|
+
return String(answer) || defaultValue || '';
|
|
72
69
|
}
|
|
73
70
|
generateBranchName(prefix) {
|
|
74
71
|
return `${prefix}-${Date.now()}`;
|
|
@@ -96,6 +93,46 @@ class MigrationHelper {
|
|
|
96
93
|
execSilent(command, cwd) {
|
|
97
94
|
return this.exec(command, { cwd, silent: true });
|
|
98
95
|
}
|
|
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
|
+
}
|
|
99
136
|
isSpacectlAuthenticated() {
|
|
100
137
|
try {
|
|
101
138
|
this.execSilent('spacectl profile current');
|
|
@@ -115,19 +152,27 @@ class MigrationHelper {
|
|
|
115
152
|
return;
|
|
116
153
|
}
|
|
117
154
|
this.logger.warn('spacectl is not authenticated');
|
|
118
|
-
const shouldLogin = await this.confirm('Run spacectl profile login now?', true);
|
|
155
|
+
const shouldLogin = await this.confirm('Run spacectl profile login payfit now?', true);
|
|
119
156
|
if (!shouldLogin) {
|
|
120
|
-
throw new Error('spacectl authentication required. Run: spacectl profile login');
|
|
157
|
+
throw new Error('spacectl authentication required. Run: spacectl profile login --endpoint https://payfit.app.spacelift.io/ payfit');
|
|
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;
|
|
121
169
|
}
|
|
122
|
-
this.logger.info('Running spacectl profile login...');
|
|
123
|
-
this.exec('spacectl profile login');
|
|
124
|
-
this.logger.success('spacectl authentication complete');
|
|
125
170
|
}
|
|
126
|
-
|
|
127
|
-
return
|
|
171
|
+
getStacksGeneratorModuleKey(stack) {
|
|
172
|
+
return `${stack.identifier}${stack.environment ? `-${stack.environment}` : '-global'}${stack.region ? `-${stack.region}` : '-global'}`;
|
|
128
173
|
}
|
|
129
174
|
getStackModuleKey(stack) {
|
|
130
|
-
return `${stack.identifier}
|
|
175
|
+
return `${stack.identifier}${stack.environment ? `-${stack.environment}` : ''}${stack.region ? `-${stack.region}` : ''}`;
|
|
131
176
|
}
|
|
132
177
|
saveMigrationState() {
|
|
133
178
|
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;AAIxB,2CAAwC;AACxC,uDAAkD;AAClD,qDAAgD;AAChD,qCAAmD;AACnD,iDAA+C;AAE/C,MAAa,eAAe;IAQ1B,YAAY,MAAM,GAAG,KAAK,EAAE,kBAA0B,OAAO,CAAC,GAAG,EAAE;QACjE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,wBAAe,EAAE,CAAA;QACnC,IAAI,CAAC,MAAM,GAAG;YACZ,iBAAiB,EAAE;gBACjB,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,eAAe;gBACrB,MAAM,EAAE,EAAE;gBACV,IAAI,EAAE,EAAE;gBACR,UAAU,EAAE,EAAE;aACf;YACD,YAAY,EAAE;gBACZ,gBAAgB,EAAE,EAAE;gBACpB,SAAS,EAAE,EAAE;aACd;YACD,MAAM,EAAE,EAAE;YACV,cAAc,EAAE,EAAE;SACnB,CAAA;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,6BAAc,CAAC,eAAe,CAAC,CAAA;QAChD,IAAI,CAAC,GAAG,GAAG,IAAI,8BAAa,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QACjD,IAAI,CAAC,KAAK,GAAG,IAAI,gCAAc,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;IACtD,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,QAAgB;QACxB,MAAM,MAAM,GAAG,MAAM,gBAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;YAC5C,IAAI,EAAE,MAAM;SACb,CAAC,CAAA;QACF,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC5C,iBAAiB;YACjB,OAAO,CAAC,IAAI,CA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