From d9052be2cf01029a477b9eceaa9fbdd65853cd0d Mon Sep 17 00:00:00 2001 From: Deepak Jain Date: Mon, 12 Oct 2020 19:05:56 +0530 Subject: [PATCH] INFRA-558 | Deepak Jain| adding workspace --- main.go | 11 +++++++---- types.go | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 88adfbd..0878791 100644 --- a/main.go +++ b/main.go @@ -2,13 +2,14 @@ package main import ( "encoding/json" + "io/ioutil" + "log" + "os" + "github.com/a8m/envsubst" "github.com/asaskevich/govalidator" "github.com/caarlos0/env/v6" "github.com/urfave/cli/v2" - "io/ioutil" - "log" - "os" ) func init() { @@ -51,8 +52,10 @@ func parseManifest(manifestPath string) (*Manifest, error) { if manifest.ExtraResources.Environment == "" { manifest.ExtraResources.Environment = manifest.Environment } + if manifest.ExtraResources.Workspace == "" { + manifest.ExtraResources.Workspace = workspaceMap[manifest.ExtraResources.Environment] + } - manifest.ExtraResources.Workspace = workspaceMap[manifest.ExtraResources.Environment] if manifest.Deployment == nil { manifest.Deployment = &Deployment{} } diff --git a/types.go b/types.go index 454cb2e..917efaf 100644 --- a/types.go +++ b/types.go @@ -17,8 +17,8 @@ type Manifest struct { type ExtraResources struct { //TODO: Remove environment from ExtraResources once all apps have migrated to new schema - Environment string `json:"environment"` - Workspace string + Environment string `json:"environment"` + Workspace string `json:"workspace"` Database *Database `json:"database"` ServiceRole *ServiceRole `json:"aws_access"` S3Buckets []S3Bucket `json:"s3_buckets"`