blob: 80418abfbc8ecdffedec35f3997cf35177519dc0 [file] [log] [blame]
// Copyright 2020 The LUCI Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
package main
import (
const (
// AppName is the name of the application (as it would appear on the command
// line).
AppName = "migrator"
// Version is the 'symver' of the migrator application.
Version = "0.0.1"
func main() {
defaults := cmdBaseOptions{
authOpts: chromeinfra.DefaultAuthOptions(),
var application = cli.Application{
Name: AppName,
Title: fmt.Sprintf(
`LUCI config migrator (%s v%s)
Tool to assist in 'global' migrations for LUCI configuration.
This tool can be used to generate a local 'migrator project' and then iterate
on it until the migration is complete. This includes semi-automated scanning to
find all LUCI projects affected by the migration, managing checkouts, sending
fixit CLs en-masse, and exporting migration status to e.g. CSV for project
management purposes.
`, AppName, Version),
Context: func(ctx context.Context) context.Context {
ctx = gologger.StdConfig.Use(ctx)
ctx = logging.SetLevel(ctx, logging.Info)
ctx, cancel := context.WithCancel(ctx)
return ctx
Commands: []*subcommands.Command{
{}, // spacer
versioncli.CmdVersion(AppName + " " + Version),
{}, // spacer
authcli.SubcommandLogin(defaults.authOpts, "auth-login", false),
authcli.SubcommandLogout(defaults.authOpts, "auth-logout", false),
authcli.SubcommandInfo(defaults.authOpts, "auth-info", false),
os.Exit(subcommands.Run(&application, nil))