Skip to content

Commit

Permalink
Very work in progress pushed for sync
Browse files Browse the repository at this point in the history
  • Loading branch information
ArjenSchwarz committed Feb 22, 2024
1 parent 72cbd12 commit e02e182
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ var deploy_NonInteractive *bool
var deploy_CreateChangeset *bool
var deploy_DeployChangeset *bool
var deploy_DefaultTags *bool
var deploy_DeploymentFile *string
var deployment lib.DeployInfo

func init() {
Expand All @@ -90,6 +91,7 @@ func init() {
deploy_CreateChangeset = deployCmd.Flags().Bool("create-changeset", false, "Only create a change set")
deploy_DeployChangeset = deployCmd.Flags().Bool("deploy-changeset", false, "Deploy a specific change set")
deploy_DefaultTags = deployCmd.Flags().Bool("default-tags", true, "Add any default tags that are specified in your config file")
deploy_DeploymentFile = deployCmd.Flags().StringP("deployment-file", "d", "", "The file to use for the deployment")
}

func deployTemplate(cmd *cobra.Command, args []string) {
Expand All @@ -106,6 +108,10 @@ func deployTemplate(cmd *cobra.Command, args []string) {
if err != nil {
failWithError(err)
}
if *deploy_DeploymentFile != "" && (*deploy_Template != "" || *deploy_Parameters != "" || *deploy_Tags != "") {
outputsettings.StringFailure("You can't provide a deployment file and other parameters at the same time")
os.Exit(1)
}
deployment.IsNew = deployment.IsNewStack(awsConfig.CloudformationClient())
if !deployment.IsNew {
if ready, status := deployment.IsReadyForUpdate(awsConfig.CloudformationClient()); !ready {
Expand Down
4 changes: 4 additions & 0 deletions lib/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ func ReadParametersfile(parametersName string) (string, string, error) {
return ReadFile(&parametersName, "parameters")
}

func ReadDeploymentFile(deploymentmentFileName string) (string, string, error) {
return ReadFile(&deploymentmentFileName, "deployments")
}

func UploadTemplate(templateName *string, template string, bucketName *string, svc *s3.Client) (string, error) {
// use the template name with a timestamp that should be unique
// prefix with fog to make it easier to set up specific lifecycle rules
Expand Down

0 comments on commit e02e182

Please sign in to comment.