Skip to content

Commit 90c438c

Browse files
committed
Parameterize image repo and tag for Jenkins job in new tests
1 parent 0271f52 commit 90c438c

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

test/e2e/separate_nodes_test.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"io/ioutil"
66
"net/http"
7+
"os"
78
"path/filepath"
89
"strings"
910
"testing"
@@ -28,15 +29,28 @@ func TestSeparateEDnode(t *testing.T) {
2829
var body []byte
2930
var err error
3031

32+
imageRepo, repoPres := os.LookupEnv("dockerRepository")
33+
imageTag, tagPres := os.LookupEnv("dockerVersion")
34+
35+
if !repoPres {
36+
imageRepo = "marklogic-centos/marklogic-server-centos"
37+
t.Logf("No imageRepo variable present, setting to default value: " + imageRepo)
38+
}
39+
40+
if !tagPres {
41+
imageTag = "10-internal"
42+
t.Logf("No imageTag variable present, setting to default value: " + imageTag)
43+
}
44+
3145
namespaceName := "marklogic-" + strings.ToLower(random.UniqueId())
3246
kubectlOptions := k8s.NewKubectlOptions("", "", namespaceName)
3347
options := &helm.Options{
3448
KubectlOptions: kubectlOptions,
3549
SetValues: map[string]string{
3650
"persistence.enabled": "false",
3751
"replicaCount": "1",
38-
"image.repository": "marklogic-centos/marklogic-server-centos",
39-
"image.tag": "10-internal",
52+
"image.repository": imageRepo,
53+
"image.tag": imageTag,
4054
"auth.adminUsername": username,
4155
"auth.adminPassword": password,
4256
"group.name": "dnode",
@@ -91,8 +105,8 @@ func TestSeparateEDnode(t *testing.T) {
91105
SetValues: map[string]string{
92106
"persistence.enabled": "false",
93107
"replicaCount": "2",
94-
"image.repository": "marklogic-centos/marklogic-server-centos",
95-
"image.tag": "10-internal",
108+
"image.repository": imageRepo,
109+
"image.tag": imageTag,
96110
"auth.adminUsername": username,
97111
"auth.adminPassword": password,
98112
"group.name": "enode",

0 commit comments

Comments
 (0)