Skip to content

Commit aec296d

Browse files
authored
Merge pull request #197 from massdriver-cloud/chris/self-hosted/massdriver-url-in-state-gen
Use MASSDRIVER_URL for HTTP state backend
2 parents 5af7f3a + e6f952c commit aec296d

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/provisioners/terraform/backend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func GenerateJSONBackendHTTPConfig(spec *massdriver.Specification, bundleStep st
8585

8686
httpbb.Username = spec.DeploymentID
8787
httpbb.Password = spec.Token
88-
httpbb.Address = fmt.Sprintf("https://api.massdriver.cloud/state/%s/%s", getPackageNameShort(spec.PackageName), bundleStep)
88+
httpbb.Address = fmt.Sprintf("%s/state/%s/%s", spec.URL, getPackageNameShort(spec.PackageName), bundleStep)
8989
httpbb.LockAddress = httpbb.Address
9090
httpbb.UnlockAddress = httpbb.Address
9191

src/provisioners/terraform/backend_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ func TestGenerateJSONBackendHTTPConfig(t *testing.T) {
1212
DeploymentID: "depId",
1313
Token: "token",
1414
PackageName: "pkg-id-long-0000",
15+
URL: "https://foo.massdriver.cloud",
1516
}
1617
got, _ := GenerateJSONBackendHTTPConfig(&spec, "step")
1718
want := `
@@ -21,9 +22,9 @@ func TestGenerateJSONBackendHTTPConfig(t *testing.T) {
2122
"http": {
2223
"username": "depId",
2324
"password": "token",
24-
"address": "https://api.massdriver.cloud/state/pkg-id-long/step",
25-
"lock_address": "https://api.massdriver.cloud/state/pkg-id-long/step",
26-
"unlock_address": "https://api.massdriver.cloud/state/pkg-id-long/step"
25+
"address": "https://foo.massdriver.cloud/state/pkg-id-long/step",
26+
"lock_address": "https://foo.massdriver.cloud/state/pkg-id-long/step",
27+
"unlock_address": "https://foo.massdriver.cloud/state/pkg-id-long/step"
2728
}
2829
}
2930
}

0 commit comments

Comments
 (0)