Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions airflow/airflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"
"path/filepath"
"strings"

airflowversions "github.com/astronomer/astro-cli/airflow_versions"
"github.com/astronomer/astro-cli/pkg/fileutil"
Expand Down Expand Up @@ -198,5 +199,9 @@ func repositoryName(name string) string {

// imageName creates an airflow image name
func ImageName(name, tag string) string {
// If name already looks like a full image (has a slash and a colon), use as-is
if strings.Contains(name, "/") && strings.Contains(name, ":") {
return name
}
return fmt.Sprintf("%s:%s", repositoryName(name), tag)
}
34 changes: 17 additions & 17 deletions cmd/cloud/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ import (
)

var (
forceDeploy bool
forcePrompt bool
saveDeployConfig bool
pytest bool
parse bool
dags bool
waitForDeploy bool
image bool
dagsPath string
pytestFile string
envFile string
imageName string
deploymentName string
deployDescription string
deployExample = `
forceDeploy bool
forcePrompt bool
saveDeployConfig bool
pytest bool
parse bool
dags bool
waitForDeploy bool
image bool
dagsPath string
pytestFile string
envFile string
imageName string
deployDeploymentName string
deployDescription string
deployExample = `
Specify the ID of the Deployment on Astronomer you would like to deploy this project to:

$ astro deploy <deployment ID>
Expand Down Expand Up @@ -68,7 +68,7 @@ func NewDeployCmd() *cobra.Command {
cmd.Flags().BoolVarP(&dags, "dags", "d", false, "Push only DAGs to your Astro Deployment")
cmd.Flags().BoolVarP(&image, "image", "", false, "Push only an image to your Astro Deployment. If you have DAG Deploy enabled your DAGs will not be affected.")
cmd.Flags().StringVar(&dagsPath, "dags-path", "", "If set deploy dags from this path instead of the dags from working directory")
cmd.Flags().StringVarP(&deploymentName, "deployment-name", "n", "", "Name of the deployment to deploy to")
cmd.Flags().StringVarP(&deployDeploymentName, "deployment-name", "n", "", "Name of the deployment to deploy to")
cmd.Flags().BoolVar(&parse, "parse", false, "Succeed only if all DAGs in your Astro project parse without errors")
cmd.Flags().BoolVarP(&waitForDeploy, "wait", "w", false, "Wait for the Deployment to become healthy before ending the command")
cmd.Flags().MarkHidden("dags-path") //nolint:errcheck
Expand Down Expand Up @@ -146,7 +146,7 @@ func deploy(cmd *cobra.Command, args []string) error {
Pytest: pytestFile,
EnvFile: envFile,
ImageName: imageName,
DeploymentName: deploymentName,
DeploymentName: deployDeploymentName,
Prompt: forcePrompt,
Dags: dags,
Image: image,
Expand Down
Loading