Skip to content

Commit 60d97a8

Browse files
committed
SRVKP-7520 Update jib-maven test to push to quay.io
1 parent 9f100fb commit 60d97a8

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed

pkg/oc/oc.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ func CreateChainsImageRegistrySecret(dockerConfig string) {
164164
cmd.MustSucceed("oc", "create", "secret", "generic", "chains-image-registry-credentials", "--from-literal=.dockerconfigjson="+dockerConfig, "--from-literal=config.json="+dockerConfig, "--type=kubernetes.io/dockerconfigjson")
165165
}
166166

167+
func CreateJibMavenImageRegistrySecret(dockerConfig string) {
168+
cmd.MustSucceed("oc", "create", "secret", "generic", "jib-maven-image-registry-credentials", "--from-literal=.dockerconfigjson="+dockerConfig, "--from-literal=config.json="+dockerConfig, "--type=kubernetes.io/dockerconfigjson")
169+
}
170+
167171
func CopySecret(secretName string, sourceNamespace string, destNamespace string) {
168172
secretJson := cmd.MustSucceed("oc", "get", "secret", secretName, "-n", sourceNamespace, "-o", "json").Stdout()
169173
cmdOutput := cmd.MustSucceed("bash", "-c", fmt.Sprintf(`echo '%s' | jq 'del(.metadata["namespace", "creationTimestamp", "resourceVersion", "selfLink", "uid", "annotations"]) | .data |= with_entries(if .key == "github-auth-key" then .key = "token" else . end)'`, secretJson)).Stdout()

specs/ecosystem/ecosystem-multiarch.spec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Type: Functional
1212
Importance: Critical
1313

1414
Steps:
15+
* Verify that jib-maven image registry variable is exported
16+
* Create secret with image registry credentials for jib-maven
1517
* Create
1618
|S.NO|resource_dir |
1719
|----|------------------------------------------------------|
@@ -31,6 +33,8 @@ Type: Functional
3133
Importance: Critical
3234

3335
Steps:
36+
* Verify that jib-maven image registry variable is exported
37+
* Create secret with image registry credentials for jib-maven
3438
* Create
3539
|S.NO|resource_dir |
3640
|----|------------------------------------------------------|

steps/ecosystem/ecosystem.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package ecosystem
2+
3+
import (
4+
"os"
5+
6+
"github.com/getgauge-contrib/gauge-go/gauge"
7+
"github.com/getgauge-contrib/gauge-go/testsuit"
8+
"github.com/openshift-pipelines/release-tests/pkg/oc"
9+
)
10+
11+
var _ = gauge.Step("Verify that jib-maven image registry variable is exported", func() {
12+
if os.Getenv("JIB_MAVEN_REPOSITORY") == "" {
13+
testsuit.T.Errorf("'JIB_MAVEN_REPOSITORY' environment variable is not exported")
14+
}
15+
})
16+
17+
var _ = gauge.Step("Create secret with image registry credentials for jib-maven", func() {
18+
if os.Getenv("JIB_MAVEN_DOCKER_CONFIG_JSON") == "" {
19+
testsuit.T.Errorf("'JIB_MAVEN_DOCKER_CONFIG_JSON' credentials environment variable is not exported")
20+
} else {
21+
dockerConfig := os.Getenv("JIB_MAVEN_DOCKER_CONFIG_JSON")
22+
oc.CreateJibMavenImageRegistrySecret(dockerConfig)
23+
}
24+
})

testdata/ecosystem/pipelines/jib-maven-pz.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ spec:
5353
- name: INSECUREREGISTRY
5454
value: "false"
5555
- name: MAVEN_IMAGE
56-
value: maven:3.8.3-adoptopenjdk-11
56+
value: maven:3.8.3-adoptopenjdk-11

0 commit comments

Comments
 (0)