INFRA-558 | Deepak Jain| adding workspace

This commit is contained in:
Deepak Jain
2020-10-12 19:05:56 +05:30
parent ceb330a821
commit d9052be2cf
2 changed files with 9 additions and 6 deletions

11
main.go
View File

@@ -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{}
}

View File

@@ -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"`