Skip to content

Commit

Permalink
Refactor cli to new org
Browse files Browse the repository at this point in the history
  • Loading branch information
schnie committed Nov 28, 2018
1 parent 8ae005c commit acba6d0
Show file tree
Hide file tree
Showing 31 changed files with 74 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
workspace:
base: /go
path: src/github.com/astronomerio/astro-cli
path: src/github.com/astronomer/astro-cli

pipeline:
# Build binary
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions airflow/airflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 7 additions & 7 deletions airflow/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
10 changes: 5 additions & 5 deletions auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
6 changes: 3 additions & 3 deletions cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
12 changes: 6 additions & 6 deletions cmd/airflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
5 changes: 2 additions & 3 deletions cmd/auth.go
Original file line number Diff line number Diff line change
@@ -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"
)

Expand Down Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion cmd/cluster.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/astronomerio/astro-cli/cluster"
"github.com/astronomer/astro-cli/cluster"
"github.com/spf13/cobra"
)

Expand Down
5 changes: 2 additions & 3 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/deployment.go
Original file line number Diff line number Diff line change
@@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/astronomerio/astro-cli/config"
"github.com/astronomer/astro-cli/config"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/serviceaccount.go
Original file line number Diff line number Diff line change
@@ -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"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/user.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/astronomerio/astro-cli/user"
"github.com/astronomer/astro-cli/user"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"github.com/astronomerio/astro-cli/workspace"
"github.com/astronomer/astro-cli/workspace"

"github.com/pkg/errors"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/astronomerio/astro-cli/version"
"github.com/astronomer/astro-cli/version"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/workspace.go
Original file line number Diff line number Diff line change
@@ -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"
)
Expand Down
6 changes: 3 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion config/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"strings"

"github.com/astronomerio/astro-cli/pkg/printutil"
"github.com/astronomer/astro-cli/pkg/printutil"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion gendocs/gendocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
6 changes: 3 additions & 3 deletions godownloader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ set -e
usage() {
this=$1
cat <<EOF
$this: download go binaries for astronomerio/astro-cli
$this: download go binaries for astronomer/astro-cli
Usage: $this [-b] bindir [tag]
-b sets bindir or installation directory, Defaults to ./bin
[tag] is a tag from
https://github.com/astronomerio/astro-cli/releases
https://github.com/astronomer/astro-cli/releases
If tag is missing, then an attempt to find the latest will be found.
Consider setting GITHUB_TOKEN to avoid triggering GitHub rate limits.
Expand Down Expand Up @@ -280,7 +280,7 @@ End of functions from https://github.com/client9/shlib
------------------------------------------------------------------------
EOF

OWNER=astronomerio
OWNER=astronomer
REPO=astro-cli
BINARY=astro
FORMAT=tar.gz
Expand Down
4 changes: 2 additions & 2 deletions houston/houston.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/pkg/errors"
// "github.com/sirupsen/logrus"

"github.com/astronomerio/astro-cli/cluster"
"github.com/astronomerio/astro-cli/pkg/httputil"
"github.com/astronomer/astro-cli/cluster"
"github.com/astronomer/astro-cli/pkg/httputil"
)

// Client containers the logger and HTTPClient used to communicate with the HoustonAPI
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"os"

"github.com/astronomerio/astro-cli/cmd"
"github.com/astronomer/astro-cli/cmd"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/fileutil/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func GetHomeDir() (string, error) {

// FindDirInPath walks up the current directory looking for the .astro folder
// 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 FindDirInPath(search string) (string, error) {
// Start in our current directory
workingDir, err := GetWorkingDir()
Expand Down
4 changes: 2 additions & 2 deletions pkg/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strings"
"time"

"github.com/astronomerio/astro-cli/messages"
"github.com/astronomerio/astro-cli/pkg/httputil"
"github.com/astronomer/astro-cli/messages"
"github.com/astronomer/astro-cli/pkg/httputil"
"github.com/pkg/errors"
)

Expand Down
4 changes: 2 additions & 2 deletions serviceaccount/serviceaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package deployment
import (
"fmt"

"github.com/astronomerio/astro-cli/houston"
"github.com/astronomerio/astro-cli/pkg/printutil"
"github.com/astronomer/astro-cli/houston"
"github.com/astronomer/astro-cli/pkg/printutil"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"errors"
"fmt"

"github.com/astronomerio/astro-cli/houston"
"github.com/astronomerio/astro-cli/pkg/input"
"github.com/astronomer/astro-cli/houston"
"github.com/astronomer/astro-cli/pkg/input"
)

// Create verifies input before sending a CreateUser API call to houston
Expand Down
8 changes: 4 additions & 4 deletions version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"errors"
"fmt"

"github.com/astronomerio/astro-cli/messages"
"github.com/astronomerio/astro-cli/pkg/github"
"github.com/astronomer/astro-cli/messages"
"github.com/astronomer/astro-cli/pkg/github"
)

var (
Expand All @@ -32,14 +32,14 @@ func CheckForUpdate(version, gitCommit string) error {
}

// fetch latest cli version
latestTagResp, err := api.RepoLatestRequest("astronomerio", "astro-cli")
latestTagResp, err := api.RepoLatestRequest("astronomer", "astro-cli")
if err != nil {
fmt.Println(err)
latestTagResp.TagName = messages.NA
}

// fetch meta data around current cli version
currentTagResp, err := api.RepoTagRequest("astronomerio", "astro-cli", string("v")+version)
currentTagResp, err := api.RepoTagRequest("astronomer", "astro-cli", string("v")+version)
if err != nil {
fmt.Println("Release info not found, please upgrade.")
fmt.Println(messages.CLI_INSTALL_CMD)
Expand Down
Loading

0 comments on commit acba6d0

Please sign in to comment.