Skip to content

Commit 93be60d

Browse files
committed
Move to CDN for monobase matrix.json
1 parent dbaf981 commit 93be60d

File tree

4 files changed

+2
-1319
lines changed

4 files changed

+2
-1319
lines changed

pkg/dockerfile/env.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import (
99
)
1010

1111
const CogletVersionEnvVarName = "R8_COGLET_VERSION"
12-
const MonobaseMatrixHostVarName = "R8_MONOBASE_MATRIX_HOST"
13-
const MonobaseMatrixSchemeVarName = "R8_MONOBASE_MATRIX_SCHEME"
1412

1513
func envLineFromConfig(c *config.Config) (string, error) {
1614
vars := c.ParsedEnvironment()
@@ -34,19 +32,3 @@ func CogletVersionFromEnvironment() string {
3432
}
3533
return host
3634
}
37-
38-
func MonobaseMatrixHostFromEnvironment() string {
39-
host := os.Getenv(MonobaseMatrixHostVarName)
40-
if host == "" {
41-
host = "raw.githubusercontent.com"
42-
}
43-
return host
44-
}
45-
46-
func MonobaseMatrixSchemeFromEnvironment() string {
47-
scheme := os.Getenv(MonobaseMatrixSchemeVarName)
48-
if scheme == "" {
49-
scheme = "https"
50-
}
51-
return scheme
52-
}

pkg/dockerfile/env_test.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,3 @@ func TestCogletVersionFromEnvironment(t *testing.T) {
1111
t.Setenv(CogletVersionEnvVarName, cogletVersion)
1212
require.Equal(t, CogletVersionFromEnvironment(), cogletVersion)
1313
}
14-
15-
func TestMonobaseMatrixHostFromEnvironment(t *testing.T) {
16-
const monobaseMatrixHost = "localhost"
17-
t.Setenv(MonobaseMatrixHostVarName, monobaseMatrixHost)
18-
require.Equal(t, MonobaseMatrixHostFromEnvironment(), monobaseMatrixHost)
19-
}
20-
21-
func TestMonobaseMatrixSchemeFromEnvironment(t *testing.T) {
22-
const monobaseMatrixScheme = "http"
23-
t.Setenv(MonobaseMatrixSchemeVarName, monobaseMatrixScheme)
24-
require.Equal(t, MonobaseMatrixSchemeFromEnvironment(), monobaseMatrixScheme)
25-
}

pkg/dockerfile/monobase_matrix.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ type MonobaseMatrix struct {
2121
}
2222

2323
func NewMonobaseMatrix(client *http.Client) (*MonobaseMatrix, error) {
24-
resp, err := client.Get(MonobaseMatrixSchemeFromEnvironment() + "://" + MonobaseMatrixHostFromEnvironment() + "/replicate/monobase/refs/heads/main/matrix.json")
24+
url := "https://monobase-packages.replicate.delivery/matrix.json"
25+
resp, err := client.Get(url)
2526
if err != nil {
2627
return nil, err
2728
}

0 commit comments

Comments
 (0)