diff --git a/Readme.md b/Readme.md index c4ed314..cfe908d 100644 --- a/Readme.md +++ b/Readme.md @@ -76,6 +76,11 @@ To migrate triggers harness-upgrade triggers ``` +To migrate user groups +```shell +harness-upgrade user-groups +``` + To create project ```shell harness-upgrade project create diff --git a/constants.go b/constants.go index d56297b..3429913 100644 --- a/constants.go +++ b/constants.go @@ -14,6 +14,7 @@ const ( Environment = "ENVIRONMENT" ApplicationManifest = "MANIFEST" Template = "TEMPLATE" + UserGroups = "USER_GROUP" ) const ( diff --git a/main.go b/main.go index f30fb1a..036e8bb 100644 --- a/main.go +++ b/main.go @@ -222,6 +222,13 @@ func main() { return cliWrapper(GetAppSummary, context) }, }, + { + Name: "user-groups", + Usage: "Import user groups from First Gen to Next Gen", + Action: func(context *cli.Context) error { + return cliWrapper(migrateUserGroups, context) + }, + }, { Name: "account", Usage: "Import secrets managers, secrets, connectors. This will not migrate services, environments, triggers, pipelines etc", diff --git a/usergroup.go b/usergroup.go new file mode 100644 index 0000000..773417c --- /dev/null +++ b/usergroup.go @@ -0,0 +1,15 @@ +package main + +import ( + log "github.com/sirupsen/logrus" + "github.com/urfave/cli/v2" +) + +func migrateUserGroups(*cli.Context) error { + _ = PromptEnvDetails() + logMigrationDetails() + log.Info("Importing the user groups....") + CreateEntities(getReqBody(UserGroups, Filter{})) + log.Info("Imported the user groups.") + return nil +}