From acba6d05e040f8b4ed7450d1a5780b449667e568 Mon Sep 17 00:00:00 2001 From: schnie Date: Wed, 28 Nov 2018 09:31:51 -0500 Subject: [PATCH] Refactor cli to new org --- .drone.yml | 2 +- Makefile | 4 ++-- airflow/airflow.go | 6 +++--- airflow/docker.go | 14 +++++++------- auth/auth.go | 10 +++++----- cluster/cluster.go | 6 +++--- cmd/airflow.go | 12 ++++++------ cmd/auth.go | 5 ++--- cmd/cluster.go | 2 +- cmd/config.go | 5 ++--- cmd/deployment.go | 2 +- cmd/root.go | 2 +- cmd/serviceaccount.go | 2 +- cmd/user.go | 4 ++-- cmd/validation.go | 2 +- cmd/version.go | 4 ++-- cmd/workspace.go | 2 +- config/config.go | 6 +++--- config/context.go | 2 +- deployment/deployment.go | 6 +++--- gendocs/gendocs.go | 2 +- godownloader.sh | 6 +++--- houston/houston.go | 4 ++-- main.go | 2 +- pkg/fileutil/paths.go | 2 +- pkg/github/github.go | 4 ++-- serviceaccount/serviceaccount.go | 4 ++-- user/user.go | 4 ++-- version/version.go | 8 ++++---- workspace/user.go | 4 ++-- workspace/workspace.go | 12 ++++++------ 31 files changed, 74 insertions(+), 76 deletions(-) diff --git a/.drone.yml b/.drone.yml index f48ecd1db..c449360a4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ workspace: base: /go - path: src/github.com/astronomerio/astro-cli + path: src/github.com/astronomer/astro-cli pipeline: # Build binary diff --git a/Makefile b/Makefile index 2a8e5b12a..3accc7816 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,8 @@ GIT_COMMIT=$(shell git rev-parse HEAD) GIT_COMMIT_SHORT=$(shell git rev-parse --short HEAD) VERSION ?= SNAPSHOT-${GIT_COMMIT_SHORT} -LDFLAGS_VERSION=-X github.com/astronomerio/astro-cli/cmd.currVersion=${VERSION} -LDFLAGS_GIT_COMMIT=-X github.com/astronomerio/astro-cli/cmd.currCommit=${GIT_COMMIT} +LDFLAGS_VERSION=-X github.com/astronomer/astro-cli/cmd.currVersion=${VERSION} +LDFLAGS_GIT_COMMIT=-X github.com/astronomer/astro-cli/cmd.currCommit=${GIT_COMMIT} .DEFAULT_GOAL := build diff --git a/airflow/airflow.go b/airflow/airflow.go index 83a9c125f..45a55184b 100644 --- a/airflow/airflow.go +++ b/airflow/airflow.go @@ -10,9 +10,9 @@ import ( "github.com/iancoleman/strcase" - "github.com/astronomerio/astro-cli/airflow/include" - "github.com/astronomerio/astro-cli/messages" - "github.com/astronomerio/astro-cli/pkg/fileutil" + "github.com/astronomer/astro-cli/airflow/include" + "github.com/astronomer/astro-cli/messages" + "github.com/astronomer/astro-cli/pkg/fileutil" ) func initDirs(root string, dirs []string) error { diff --git a/airflow/docker.go b/airflow/docker.go index 2d691e723..e657bf459 100644 --- a/airflow/docker.go +++ b/airflow/docker.go @@ -17,13 +17,13 @@ import ( "github.com/docker/libcompose/project/options" "github.com/pkg/errors" - "github.com/astronomerio/astro-cli/airflow/include" - "github.com/astronomerio/astro-cli/config" - "github.com/astronomerio/astro-cli/docker" - "github.com/astronomerio/astro-cli/houston" - "github.com/astronomerio/astro-cli/messages" - "github.com/astronomerio/astro-cli/pkg/input" - "github.com/astronomerio/astro-cli/pkg/printutil" + "github.com/astronomer/astro-cli/airflow/include" + "github.com/astronomer/astro-cli/config" + "github.com/astronomer/astro-cli/docker" + "github.com/astronomer/astro-cli/houston" + "github.com/astronomer/astro-cli/messages" + "github.com/astronomer/astro-cli/pkg/input" + "github.com/astronomer/astro-cli/pkg/printutil" ) const ( diff --git a/auth/auth.go b/auth/auth.go index ca07d0a09..c47d53b1a 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -3,11 +3,11 @@ package auth import ( "fmt" - "github.com/astronomerio/astro-cli/cluster" - "github.com/astronomerio/astro-cli/docker" - "github.com/astronomerio/astro-cli/houston" - "github.com/astronomerio/astro-cli/messages" - "github.com/astronomerio/astro-cli/pkg/input" + "github.com/astronomer/astro-cli/cluster" + "github.com/astronomer/astro-cli/docker" + "github.com/astronomer/astro-cli/houston" + "github.com/astronomer/astro-cli/messages" + "github.com/astronomer/astro-cli/pkg/input" "github.com/pkg/errors" ) diff --git a/cluster/cluster.go b/cluster/cluster.go index 889d1fb5d..dc1111d04 100644 --- a/cluster/cluster.go +++ b/cluster/cluster.go @@ -4,9 +4,9 @@ import ( "strconv" "strings" - "github.com/astronomerio/astro-cli/config" - "github.com/astronomerio/astro-cli/pkg/input" - "github.com/astronomerio/astro-cli/pkg/printutil" + "github.com/astronomer/astro-cli/config" + "github.com/astronomer/astro-cli/pkg/input" + "github.com/astronomer/astro-cli/pkg/printutil" "github.com/pkg/errors" ) diff --git a/cmd/airflow.go b/cmd/airflow.go index fdc592a8c..b285d4b61 100644 --- a/cmd/airflow.go +++ b/cmd/airflow.go @@ -7,18 +7,18 @@ import ( "regexp" "strings" - "github.com/astronomerio/astro-cli/pkg/input" + "github.com/astronomer/astro-cli/pkg/input" "github.com/iancoleman/strcase" "github.com/pkg/errors" - "github.com/astronomerio/astro-cli/messages" + "github.com/astronomer/astro-cli/messages" "github.com/spf13/cobra" - "github.com/astronomerio/astro-cli/airflow" - "github.com/astronomerio/astro-cli/config" - "github.com/astronomerio/astro-cli/pkg/fileutil" - "github.com/astronomerio/astro-cli/pkg/git" + "github.com/astronomer/astro-cli/airflow" + "github.com/astronomer/astro-cli/config" + "github.com/astronomer/astro-cli/pkg/fileutil" + "github.com/astronomer/astro-cli/pkg/git" ) var ( diff --git a/cmd/auth.go b/cmd/auth.go index 6da73f589..da691357b 100644 --- a/cmd/auth.go +++ b/cmd/auth.go @@ -1,8 +1,8 @@ package cmd import ( - "github.com/astronomerio/astro-cli/auth" - "github.com/astronomerio/astro-cli/cluster" + "github.com/astronomer/astro-cli/auth" + "github.com/astronomer/astro-cli/cluster" "github.com/spf13/cobra" ) @@ -71,6 +71,5 @@ func authLogout(cmd *cobra.Command, args []string) { // Silence Usage as we have now validated command input cmd.SilenceUsage = true - auth.Logout(domain) } diff --git a/cmd/cluster.go b/cmd/cluster.go index 5986f14c4..65c923da2 100644 --- a/cmd/cluster.go +++ b/cmd/cluster.go @@ -1,7 +1,7 @@ package cmd import ( - "github.com/astronomerio/astro-cli/cluster" + "github.com/astronomer/astro-cli/cluster" "github.com/spf13/cobra" ) diff --git a/cmd/config.go b/cmd/config.go index 40041a1b4..85203f479 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -4,8 +4,8 @@ import ( "fmt" "os" - "github.com/astronomerio/astro-cli/config" - "github.com/astronomerio/astro-cli/messages" + "github.com/astronomer/astro-cli/config" + "github.com/astronomer/astro-cli/messages" "github.com/pkg/errors" "github.com/spf13/cobra" ) @@ -72,7 +72,6 @@ func configGet(cmd *cobra.Command, args []string) error { // Silence Usage as we have now validated command input cmd.SilenceUsage = true - if globalFlag { fmt.Printf("%s: %s\n", cfg.Path, cfg.GetHomeString()) } else { diff --git a/cmd/deployment.go b/cmd/deployment.go index f604c5b47..8862d43ba 100644 --- a/cmd/deployment.go +++ b/cmd/deployment.go @@ -1,7 +1,7 @@ package cmd import ( - "github.com/astronomerio/astro-cli/deployment" + "github.com/astronomer/astro-cli/deployment" "github.com/pkg/errors" "github.com/spf13/cobra" ) diff --git a/cmd/root.go b/cmd/root.go index ce9038be2..731622cf8 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -1,7 +1,7 @@ package cmd import ( - "github.com/astronomerio/astro-cli/config" + "github.com/astronomer/astro-cli/config" "github.com/spf13/cobra" ) diff --git a/cmd/serviceaccount.go b/cmd/serviceaccount.go index a78cf3d21..750c09439 100644 --- a/cmd/serviceaccount.go +++ b/cmd/serviceaccount.go @@ -1,7 +1,7 @@ package cmd import ( - sa "github.com/astronomerio/astro-cli/serviceaccount" + sa "github.com/astronomer/astro-cli/serviceaccount" "github.com/pkg/errors" "github.com/spf13/cobra" ) diff --git a/cmd/user.go b/cmd/user.go index 606eccf80..a123e6ba2 100644 --- a/cmd/user.go +++ b/cmd/user.go @@ -1,7 +1,7 @@ package cmd import ( - "github.com/astronomerio/astro-cli/user" + "github.com/astronomer/astro-cli/user" "github.com/spf13/cobra" ) @@ -61,7 +61,7 @@ func init() { func userCreate(cmd *cobra.Command, args []string) error { // Silence Usage as we have now validated command input cmd.SilenceUsage = true - + return user.Create(userEmail) } diff --git a/cmd/validation.go b/cmd/validation.go index daf76ebc1..311c96a58 100644 --- a/cmd/validation.go +++ b/cmd/validation.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/astronomerio/astro-cli/workspace" + "github.com/astronomer/astro-cli/workspace" "github.com/pkg/errors" ) diff --git a/cmd/version.go b/cmd/version.go index 9074c4f43..366816eb2 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -1,7 +1,7 @@ package cmd import ( - "github.com/astronomerio/astro-cli/version" + "github.com/astronomer/astro-cli/version" "github.com/spf13/cobra" ) @@ -42,7 +42,7 @@ func printVersion(cmd *cobra.Command, args []string) error { func upgradeCheck(cmd *cobra.Command, args []string) error { // Silence Usage as we have now validated command input cmd.SilenceUsage = true - + err := version.CheckForUpdate(currVersion, currCommit) if err != nil { return err diff --git a/cmd/workspace.go b/cmd/workspace.go index 13d143ee4..5ed67b86a 100644 --- a/cmd/workspace.go +++ b/cmd/workspace.go @@ -1,7 +1,7 @@ package cmd import ( - "github.com/astronomerio/astro-cli/workspace" + "github.com/astronomer/astro-cli/workspace" "github.com/pkg/errors" "github.com/spf13/cobra" ) diff --git a/config/config.go b/config/config.go index 736d9225d..0365295a7 100644 --- a/config/config.go +++ b/config/config.go @@ -5,8 +5,8 @@ import ( "os" "path/filepath" - "github.com/astronomerio/astro-cli/messages" - "github.com/astronomerio/astro-cli/pkg/fileutil" + "github.com/astronomer/astro-cli/messages" + "github.com/astronomer/astro-cli/pkg/fileutil" "github.com/pkg/errors" "github.com/spf13/viper" ) @@ -169,7 +169,7 @@ func ProjectConfigExists() bool { // ProjectRoot returns the path to the nearest project root // TODO Deprecate if remains unused, removed due to -// https://github.com/astronomerio/astro-cli/issues/103 +// https://github.com/astronomer/astro-cli/issues/103 func ProjectRoot() (string, error) { configPath, searchErr := fileutil.FindDirInPath(ConfigDir) if searchErr != nil { diff --git a/config/context.go b/config/context.go index f15a69c8f..0d3bdcb80 100644 --- a/config/context.go +++ b/config/context.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/astronomerio/astro-cli/pkg/printutil" + "github.com/astronomer/astro-cli/pkg/printutil" ) var ( diff --git a/deployment/deployment.go b/deployment/deployment.go index a001efe6a..78321cc8d 100644 --- a/deployment/deployment.go +++ b/deployment/deployment.go @@ -3,9 +3,9 @@ package deployment import ( "fmt" - "github.com/astronomerio/astro-cli/config" - "github.com/astronomerio/astro-cli/houston" - "github.com/astronomerio/astro-cli/pkg/printutil" + "github.com/astronomer/astro-cli/config" + "github.com/astronomer/astro-cli/houston" + "github.com/astronomer/astro-cli/pkg/printutil" ) var ( diff --git a/gendocs/gendocs.go b/gendocs/gendocs.go index 5be637a0b..3563d22cd 100644 --- a/gendocs/gendocs.go +++ b/gendocs/gendocs.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/astronomerio/astro-cli/cmd" + "github.com/astronomer/astro-cli/cmd" "github.com/spf13/cobra/doc" ) diff --git a/godownloader.sh b/godownloader.sh index 767617a29..f08f58ba2 100755 --- a/godownloader.sh +++ b/godownloader.sh @@ -6,12 +6,12 @@ set -e usage() { this=$1 cat <