Skip to content

Commit

Permalink
fix(server): import cmd config (#1377)
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
yk-eukarya authored Jan 27, 2025
1 parent ab7c039 commit b982b10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions server/internal/infrastructure/gcp/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ type TaskConfig struct {
DecompressorDiskSideGb int64 `default:"2000"`
CopierImage string `default:"reearth/reearth-cms-copier"`
DBSecretName string `default:"reearth-cms-db"`
AccountDBSecretName string `default:"reearth-cms-db-users"`
CmsImage string `default:"reearth/reearth-cms"`
}
8 changes: 6 additions & 2 deletions server/internal/infrastructure/gcp/taskrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ func importItems(ctx context.Context, p task.Payload, conf *TaskConfig) error {

project := conf.GCPProject
region := conf.GCPRegion
dbSecretName := conf.DBSecretName

args := []string{
"item",
Expand All @@ -245,6 +244,7 @@ func importItems(ctx context.Context, p task.Payload, conf *TaskConfig) error {
Name: conf.CmsImage,
SecretEnv: []string{
"REEARTH_CMS_DB",
"REEARTH_CMS_DB_USERS",
},
Args: args,
},
Expand All @@ -255,9 +255,13 @@ func importItems(ctx context.Context, p task.Payload, conf *TaskConfig) error {
AvailableSecrets: &cloudbuild.Secrets{
SecretManager: []*cloudbuild.SecretManagerSecret{
{
VersionName: fmt.Sprintf("projects/%s/secrets/%s/versions/latest", project, dbSecretName),
VersionName: fmt.Sprintf("projects/%s/secrets/%s/versions/latest", project, conf.DBSecretName),
Env: "REEARTH_CMS_DB",
},
{
VersionName: fmt.Sprintf("projects/%s/secrets/%s/versions/latest", project, conf.AccountDBSecretName),
Env: "REEARTH_CMS_DB_USERS",
},
},
},
}
Expand Down

0 comments on commit b982b10

Please sign in to comment.