diff --git a/cmd/terraformadmin.go b/cmd/terraformadmin.go index 95c357c05..735645a6c 100644 --- a/cmd/terraformadmin.go +++ b/cmd/terraformadmin.go @@ -6,8 +6,8 @@ import ( "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/legacy" "github.com/runatlantis/atlantis/server/logging" - "github.com/runatlantis/atlantis/server/neptune/temporalworker" neptune "github.com/runatlantis/atlantis/server/neptune/temporalworker/config" + "github.com/runatlantis/atlantis/server/neptune/terraformadmin" ) type TerraformAdmin struct{} @@ -21,12 +21,15 @@ func (t *TerraformAdmin) NewServer(userConfig legacy.UserConfig, config legacy.C globalCfg := valid.NewGlobalCfg(userConfig.DataDir) validator := &cfgParser.ParserValidator{} + + // TODO: should terraformadminmode pass in this stuff? if userConfig.RepoConfig != "" { globalCfg, err = validator.ParseGlobalCfg(userConfig.RepoConfig, globalCfg) if err != nil { return nil, errors.Wrapf(err, "parsing %s file", userConfig.RepoConfig) } } + parsedURL, err := legacy.ParseAtlantisURL(userConfig.AtlantisURL) if err != nil { return nil, errors.Wrapf(err, @@ -40,6 +43,8 @@ func (t *TerraformAdmin) NewServer(userConfig legacy.UserConfig, config legacy.C return nil, err } + // we don't need the feature config + cfg := &neptune.Config{ AuthCfg: neptune.AuthConfig{ SslCertFile: userConfig.SSLCertFile, @@ -50,12 +55,6 @@ func (t *TerraformAdmin) NewServer(userConfig legacy.UserConfig, config legacy.C Version: config.AtlantisVersion, Port: userConfig.Port, }, - FeatureConfig: neptune.FeatureConfig{ - FFOwner: userConfig.FFOwner, - FFRepo: userConfig.FFRepo, - FFPath: userConfig.FFPath, - FFBranch: userConfig.FFBranch, - }, TerraformCfg: neptune.TerraformConfig{ DefaultVersion: userConfig.DefaultTFVersion, DownloadURL: userConfig.TFDownloadURL, @@ -77,5 +76,5 @@ func (t *TerraformAdmin) NewServer(userConfig legacy.UserConfig, config legacy.C LyftAuditJobsSnsTopicArn: userConfig.LyftAuditJobsSnsTopicArn, RevisionSetter: globalCfg.RevisionSetter, } - return temporalworker.NewServer(cfg) + return terraformadmin.NewServer(cfg) } diff --git a/server/neptune/terraformadmin/server.go b/server/neptune/terraformadmin/server.go index ed71c3920..2a8fe6255 100644 --- a/server/neptune/terraformadmin/server.go +++ b/server/neptune/terraformadmin/server.go @@ -77,7 +77,6 @@ type Server struct { GithubActivities *activities.Github RevisionSetterActivities *lyftActivities.RevisionSetter // Temporary until we move this into our private code - AuditActivity *lyftActivities.Audit PRRevisionGithubActivities *lyftActivities.Github TerraformTaskQueue string RevisionSetterConfig valid.RevisionSetter @@ -141,10 +140,8 @@ func NewServer(config *config.Config) (*Server, error) { Logger: config.CtxLogger, } - auditActivity, err := lyftActivities.NewAuditActivity(config.LyftAuditJobsSnsTopicArn) - if err != nil { - return nil, errors.Wrap(err, "initializing lyft activities") - } + // we don't need audit activities + deployActivities, err := activities.NewDeploy(config.DeploymentConfig) if err != nil { return nil, errors.Wrap(err, "initializing deploy activities") @@ -227,12 +224,16 @@ func NewServer(config *config.Config) (*Server, error) { RevisionSetterActivities: revisionSetterActivities, TerraformTaskQueue: config.TemporalCfg.TerraformTaskQueue, RevisionSetterConfig: config.RevisionSetter, - AuditActivity: auditActivity, PRRevisionGithubActivities: prRevisionGithubActivities, } return &server, nil } +/* + * BIG TODO FOR ATLANTIS DEPRECATION: + * Figure out what workers / activities / stuff and things we don't need and remove them + */ + func (s Server) Start() error { defer s.shutdown() @@ -384,7 +385,6 @@ func (s Server) buildDeployWorker() worker.Worker { }) deployWorker.RegisterActivity(s.DeployActivities) deployWorker.RegisterActivity(s.GithubActivities) - deployWorker.RegisterActivity(s.AuditActivity) deployWorker.RegisterActivity(s.TerraformActivities) deployWorker.RegisterWorkflowWithOptions(workflows.GetDeployWithPlugins( func(ctx workflow.Context, dr workflows.DeployRequest) (plugins.Deploy, error) {