spacelift-io / spacelift-migration-kit

Helper to move from various tools to Spacelift
MIT License
36 stars 5 forks source link

Feat: support contexts #48

Closed Apollorion closed 1 month ago

Apollorion commented 3 months ago

Added support for variable sets in TFC

The way this works:

  1. For every organization it will create a new workspace called "SMK" in the default project
    • The SMK workspace will, initially, be setup with a "remote" runner.
    • The SMK workspace will be setup as a cli driven workflow
  2. Using a new docker image, terraform-push we will run a quick apply with a null resource.
    • This is because the migration kit dies if there is no state in the workspace.
  3. We will then update the SMK workspace to use the SMK agent instead of "remote"
  4. We will list every variable set in the organization
  5. We will backup the variable sets current relationships
  6. We will update the variable sets relationship to the SMK workspace only and set it to priority to ensure no auto attaching variables will overwrite the ones from this variable set.
  7. We will trigger a plan on the SMK agent and capture the environment
  8. We will loop through all the variables and see if any of them correspond with sensitive variables in the current variable set, if they do we set that value in data.json
  9. We reset the variable sets relationships back to what they were in the backup taken previously.
  10. we delete the SMK workspace and agent pool
  11. we stop any locally running docker containers