// 2019 Rackspace, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"): you may // not use this file except in compliance with the License. You may obtain // a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the // License for the specific language governing permissions and limitations // under the License. package main import ( "github.com/sirupsen/logrus" "github.rackspace.com/DCM/gomigrate/core" "github.rackspace.com/DCM/gomigrate/plugins/audit" "github.rackspace.com/DCM/gomigrate/plugins/autodiscover" "github.rackspace.com/DCM/gomigrate/plugins/changedc" "github.rackspace.com/DCM/gomigrate/plugins/compareports" "github.rackspace.com/DCM/gomigrate/plugins/copysegments" "github.rackspace.com/DCM/gomigrate/plugins/dpfailover" "github.rackspace.com/DCM/gomigrate/plugins/envdiscover" "github.rackspace.com/DCM/gomigrate/plugins/exnetxlate" "github.rackspace.com/DCM/gomigrate/plugins/finalize" "github.rackspace.com/DCM/gomigrate/plugins/findha" "github.rackspace.com/DCM/gomigrate/plugins/hypsnet" "github.rackspace.com/DCM/gomigrate/plugins/info" "github.rackspace.com/DCM/gomigrate/plugins/ip" "github.rackspace.com/DCM/gomigrate/plugins/link" "github.rackspace.com/DCM/gomigrate/plugins/migrate" "github.rackspace.com/DCM/gomigrate/plugins/notmoving" "github.rackspace.com/DCM/gomigrate/plugins/portaudit" "github.rackspace.com/DCM/gomigrate/plugins/portstatus" "github.rackspace.com/DCM/gomigrate/plugins/post" "github.rackspace.com/DCM/gomigrate/plugins/processmaps" "github.rackspace.com/DCM/gomigrate/plugins/publicxlate" "github.rackspace.com/DCM/gomigrate/plugins/refresh" "github.rackspace.com/DCM/gomigrate/plugins/shutdown" "github.rackspace.com/DCM/gomigrate/plugins/snapshot" "github.rackspace.com/DCM/gomigrate/plugins/status" "github.rackspace.com/DCM/gomigrate/plugins/tokens" "github.rackspace.com/DCM/gomigrate/plugins/uglyservers" "github.rackspace.com/DCM/gomigrate/plugins/validate" "github.rackspace.com/DCM/gomigrate/plugins/version" "github.rackspace.com/DCM/gomigrate/plugins/zsp" "github.rackspace.com/gorax/gokeys" ) var buildVersion = "1.0.0+dev" func main() { // Get the gokeys configuration file from the // default store location (homedir/.config/gokeys) cfg, err := gokeys.New(logrus.Debug) if err != nil { logrus.Fatalf("gomigrate.gokeys.New:%s", err) } // Run a check of the current version. This will only alert and perform // a check against artifactory every 2 hours. if err := version.Check(cfg, buildVersion); err != nil { logrus.Warning(err) } // Create a new cli parser and register all the plugins to be used. // This is where the arg commands are defined and the func to execute // when called. parser := core.NewParser( audit.Plugin, autodiscover.Plugin, changedc.Plugin, compareports.Plugin, copysegments.Plugin, dpfailover.Plugin, envdiscover.Plugin, finalize.Plugin, findha.Plugin, hypsnet.Plugin, info.Plugin, ip.Plugin, link.Plugin, migrate.Plugin, notmoving.Plugin, portaudit.Plugin, portstatus.Plugin, post.Plugin, processmaps.Plugin, publicxlate.Plugin, refresh.Plugin, snapshot.Plugin, shutdown.Plugin, status.Plugin, tokens.Plugin, exnetxlate.Plugin, // "translations" uglyservers.Plugin, validate.Plugin, version.Plugin, zsp.Plugin, ) // Run the parser to parse all the arguments defined by gomigrate and // the additional plugins. This will also check if and what argument happened // and execute the defined plugin function. parser.Run(buildVersion, cfg) }