From 6196f721a77a882d90389b10f23cabc2c1e9aeb1 Mon Sep 17 00:00:00 2001 From: team-devfile-bot Date: Mon, 6 Jan 2025 18:04:29 +0000 Subject: [PATCH 1/6] Trigger deploy based on devfile/devfile-web@f540461f043c7decee8904ecb9c5b5a81117b633 Signed-off-by: Maximiliano Pizarro From 603103199e19fcbbf19e906b6988440bf8ae6b36 Mon Sep 17 00:00:00 2001 From: Maximiliano Pizarro Date: Tue, 7 Jan 2025 19:24:30 +0000 Subject: [PATCH 2/6] migrate jhipster online to redhat developer demos Signed-off-by: Maximiliano Pizarro --- stacks/jhipster-online/2.33.0/devfile.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stacks/jhipster-online/2.33.0/devfile.yaml b/stacks/jhipster-online/2.33.0/devfile.yaml index 9f85f583..cb465300 100644 --- a/stacks/jhipster-online/2.33.0/devfile.yaml +++ b/stacks/jhipster-online/2.33.0/devfile.yaml @@ -3,7 +3,7 @@ metadata: name: jhipster-online description: Stack with JHipster Online on Red Hat OpenShift Dev Spaces displayName: JHipster Online - icon: https://raw.githubusercontent.com/maximilianoPizarro/ecommerce-oracle/main/jhipster-icon.png + icon: https://raw.githubusercontent.com/redhat-developer-demos/jhipster-online/main/jhipster-icon.png website: https://start.jhipster.tech tags: - Java @@ -17,13 +17,13 @@ projects: - name: jhipster-online git: remotes: - origin: 'https://github.com/maximilianoPizarro/jhipster-online' + origin: 'https://github.com/redhat-developer-demos/jhipster-online' checkoutFrom: - revision: openshift + revision: main components: - name: tools container: - image: 'quay.io/maximilianopizarro/jhipster-devspace@sha256:c27aefcf6ce158479bafae63758c1f0993c430a6ee15f76cf369fc889e54eae5' + image: 'quay.io/devfile/jhipster-online@sha256:254c710006b1582b2ebc48cc74ae080a9e10caa99dc1b62c1adb3341f072aede' mountSources: true cpuLimit: '4' cpuRequest: '1' From 1ffebe1e529500f46d0cfd0d4b09d27dee3b475b Mon Sep 17 00:00:00 2001 From: team-devfile-bot Date: Mon, 6 Jan 2025 18:04:29 +0000 Subject: [PATCH 3/6] Trigger deploy based on devfile/devfile-web@f540461f043c7decee8904ecb9c5b5a81117b633 Signed-off-by: Maximiliano Pizarro From 1dcb29743713d2c22cb00fcd40c36100998f87a7 Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Thu, 9 Jan 2025 14:07:47 -0500 Subject: [PATCH 4/6] Fix PR integration testing (#531) * tls enablement for check_odov2.sh and openshift_integration.sh Signed-off-by: Michael Valdron * replace odov2 with odov3 under integration testing Signed-off-by: Michael Valdron * fix missing ginkgo and test script argument steps Signed-off-by: Michael Valdron * correct ENABLE_TLS to ENABLE_TLS_VERIFY for odov2 test script Signed-off-by: Michael Valdron * remove ENABLE_TLS_VERIFY for odov3 test script run under integration testing script Signed-off-by: Michael Valdron * revert showing full odo path in test log Signed-off-by: Michael Valdron * openshift_integration: fix remaining file path references to use BASE_DIR instead of relative path Signed-off-by: Michael Valdron --------- Signed-off-by: Michael Valdron Signed-off-by: Maximiliano Pizarro --- .ci/openshift_integration.sh | 43 ++++++++++++++++++++++-------------- tests/check_odov2.sh | 27 +++++++++++++++++++++- tests/check_odov3.sh | 7 +++++- tests/odov3/odo_test.go | 12 ++++++++-- 4 files changed, 68 insertions(+), 21 deletions(-) diff --git a/.ci/openshift_integration.sh b/.ci/openshift_integration.sh index d4479436..8738d769 100755 --- a/.ci/openshift_integration.sh +++ b/.ci/openshift_integration.sh @@ -1,18 +1,18 @@ #!/bin/bash + +# Copyright Red Hat # -# Copyright 2021-2022 Red Hat, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. #!/usr/bin/env bash # exit immediately when a command fails @@ -24,12 +24,17 @@ set -u # print each command before executing it set -x +BASE_DIR="$(realpath $(dirname ${BASH_SOURCE[0]})/..)" + # Disable telemtry for odo export ODO_DISABLE_TELEMETRY=true # Set yq version YQ_VERSION=${YQ_VERSION:-v4.44.1} +# Set odo version +ODO_VERSION=${ODO_VERSION:-v3.16.1} + # Split the registry image and image tag from the REGISTRY_IMAGE env variable IMG="$(echo $REGISTRY_IMAGE | cut -d':' -f1)" TAG="$(echo $REGISTRY_IMAGE | cut -d':' -f2)" @@ -42,15 +47,19 @@ curl -sL https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linu YQ_PATH=$(realpath yq) # Download odo -curl -sL https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/odo/v2.5.1/odo-linux-amd64 -o odo && chmod +x odo +curl -sL https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/odo/${ODO_VERSION}/odo-linux-amd64 -o odo && chmod +x odo export GLOBALODOCONFIG=$(pwd)/preferences.yaml +# Download & Install Ginkgo +GINKGO_VERSION="$(cd $BASE_DIR/tests/odov3 && go list -m -json all | ${YQ_PATH} 'select(.Path == "github.com/onsi/ginkgo/v2") | .Version' -Mr -p=json)" +go install github.com/onsi/ginkgo/v2/ginkgo@${GINKGO_VERSION} + # Install the devfile registry -oc process -f .ci/deploy/devfile-registry.yaml -p DEVFILE_INDEX_IMAGE=$IMG -p IMAGE_TAG=$TAG -p REPLICAS=3 -p ANALYTICS_WRITE_KEY= | \ +oc process -f $BASE_DIR/.ci/deploy/devfile-registry.yaml -p DEVFILE_INDEX_IMAGE=$IMG -p IMAGE_TAG=$TAG -p REPLICAS=3 -p ANALYTICS_WRITE_KEY= | \ oc apply -f - # Deploy the routes for the registry -oc process -f .ci/deploy/route.yaml | oc apply -f - +oc process -f $BASE_DIR/.ci/deploy/route.yaml | oc apply -f - # Wait for the registry to become ready oc wait deploy/devfile-registry --for=condition=Available --timeout=600s @@ -65,8 +74,8 @@ REGISTRY_HOSTNAME=$(oc get route devfile-registry -o jsonpath="{.spec.host}") echo $REGISTRY_HOSTNAME # Delete the default devfile registry and add the test one we just stood up -$(realpath odo) registry delete DefaultDevfileRegistry -f -$(realpath odo) registry add TestDevfileRegistry http://$REGISTRY_HOSTNAME +$(realpath odo) preference remove registry DefaultDevfileRegistry -f +$(realpath odo) preference add registry TestDevfileRegistry http://$REGISTRY_HOSTNAME # Run the devfile validation tests -ENV=openshift REGISTRY=remote tests/check_odov2.sh $(realpath odo) $YQ_PATH +ENV=openshift REGISTRY=remote $BASE_DIR/tests/check_odov3.sh $(realpath odo) diff --git a/tests/check_odov2.sh b/tests/check_odov2.sh index 2cf609d7..db521af1 100755 --- a/tests/check_odov2.sh +++ b/tests/check_odov2.sh @@ -1,8 +1,24 @@ #!/usr/bin/env bash +# +# Copyright Red Hat +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + set -x DEVFILES_DIR="$(pwd)/stacks" FAILED_TESTS=() +ENABLE_TLS_VERIFY=${ENABLE_TLS_VERIFY:-"true"} # The stacks to test as a string separated by spaces STACKS=$(bash "$(pwd)/tests/get_stacks.sh") @@ -42,7 +58,16 @@ waitForHTTPStatus() { for i in $(seq 1 10); do echo "try: $i" - content=$(curl -i "$url") + if [[ $ENABLE_TLS_VERIFY == "true" ]] + then + content=$(curl -i "$url") + elif [[ $ENABLE_TLS_VERIFY == "false" ]] + then + content=$(curl -i --insecure "$url") + else + echo "ERROR: ENABLE_TLS must be either true or false" + return 1 + fi echo "Checking if $url is returning HTTP $status_code" echo "$content" | grep -q -E "HTTP/[0-9.]+ $status_code" ret_val=$? diff --git a/tests/check_odov3.sh b/tests/check_odov3.sh index 3421b816..4763e5c1 100755 --- a/tests/check_odov3.sh +++ b/tests/check_odov3.sh @@ -3,6 +3,11 @@ set -x stackDirs=$(bash "$(pwd)/tests/get_stacks.sh") +args="" + +if [ ! -z "${1}" ]; then + args="-odoPath ${1} ${args}" +fi ginkgo run --procs 2 \ --skip="stack: java-openliberty-gradle version: 0.4.0 starter: rest" \ @@ -58,4 +63,4 @@ ginkgo run --procs 2 \ --skip="stack: ollama" \ --slow-spec-threshold 120s \ --timeout 3h \ - tests/odov3 -- -stacksPath "$(pwd)"/stacks -stackDirs "$stackDirs" + tests/odov3 -- -stacksPath "$(pwd)"/stacks -stackDirs "$stackDirs" ${args} diff --git a/tests/odov3/odo_test.go b/tests/odov3/odo_test.go index 95564b4e..1cdcb0b2 100644 --- a/tests/odov3/odo_test.go +++ b/tests/odov3/odo_test.go @@ -10,6 +10,9 @@ ginkgo run --focus "stack: java-vertx starter: vertx-http-example" -- -stacksPa test all starter project in a specific stack: ginkgo run --focus "stack: java-vertx" -- -stacksPath ../../stacks + +specifying odo path: +ginkgo run -v -- -odoPath */ package main @@ -37,10 +40,12 @@ import ( var stacksPath string var stackDirs string +var odoPath string func init() { flag.StringVar(&stacksPath, "stacksPath", "../../stacks", "The path to the directory containing the stacks") flag.StringVar(&stackDirs, "stackDirs", "", "The stacks to test as a string separated by spaces") + flag.StringVar(&odoPath, "odoPath", "odo", "The path to the odo binary, defaults to path symbol") } // all stacks to be tested @@ -404,7 +409,7 @@ func runOdoDev(additionalArgs ...string) (io.ReadCloser, io.ReadCloser, *exec.Cm args := []string{"dev", "--random-ports"} args = append(args, additionalArgs...) GinkgoWriter.Println("Executing odo " + strings.Join(args, " ")) - cmd := exec.Command("odo", args...) + cmd := exec.Command(odoPath, args...) stdout, err := cmd.StdoutPipe() if err != nil { @@ -426,8 +431,11 @@ func runOdoDev(additionalArgs ...string) (io.ReadCloser, io.ReadCloser, *exec.Cm // run odo commands // returns stdout, stderr, and error func runOdo(args ...string) ([]byte, []byte, error) { + // Clean given path + filepath.Clean(odoPath) + GinkgoWriter.Println("Executing: odo", strings.Join(args, " ")) - cmd := exec.Command("odo", args...) + cmd := exec.Command(odoPath, args...) stdout, err := cmd.StdoutPipe() if err != nil { From f44040cebd476de235656dabaa56681bd6ea34b4 Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Thu, 9 Jan 2025 15:51:35 -0500 Subject: [PATCH 5/6] patch konflux pipeline task images (#546) Signed-off-by: Michael Valdron Signed-off-by: Maximiliano Pizarro --- .tekton/devfile-registry-main-pull-request.yaml | 10 +++++----- .tekton/devfile-registry-main-push.yaml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.tekton/devfile-registry-main-pull-request.yaml b/.tekton/devfile-registry-main-pull-request.yaml index 5a695ba6..64398df3 100644 --- a/.tekton/devfile-registry-main-pull-request.yaml +++ b/.tekton/devfile-registry-main-pull-request.yaml @@ -156,7 +156,7 @@ spec: - name: name value: init - name: bundle - value: quay.io/konflux-ci/tekton-catalog/task-init:0.2@sha256:0523b51c28375a3f222da91690e22eff11888ebc98a0c73c468af44762265c69 + value: quay.io/konflux-ci/tekton-catalog/task-init:0.2@sha256:90dda596d44b3f861889da2fba161dff34c6116fe76c3989e3f84262ea0f29cd - name: kind value: task resolver: bundles @@ -198,7 +198,7 @@ spec: - name: name value: prefetch-dependencies - name: bundle - value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies:0.1@sha256:d3d8a8bfee292afee3c683692fdd70c031ef430446124285f6abc73365839a6f + value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies:0.2@sha256:b7a6b67e97c6c03b552b9cd57d4a2868d63e279ee68ced2a53e713befca9e009 - name: kind value: task resolver: bundles @@ -242,7 +242,7 @@ spec: - name: name value: buildah - name: bundle - value: quay.io/konflux-ci/tekton-catalog/task-buildah:0.2@sha256:aebfe04c80f7fd937628fad760c095c6a0efacb048f2c98e5d5e7f2b0f134cf9 + value: quay.io/konflux-ci/tekton-catalog/task-buildah:0.2@sha256:03ff951f641678ae63e7d7f956a30a52547a58e093970a0a88665a6238c5061b - name: kind value: task resolver: bundles @@ -463,7 +463,7 @@ spec: - name: name value: coverity-availability-check - name: bundle - value: quay.io/konflux-ci/tekton-catalog/task-coverity-availability-check:0.1@sha256:dfe1150a94c7464c4a1e0b5a2bfdab4c9c97f51a992f8a479a43acc64ffcbf73 + value: quay.io/konflux-ci/tekton-catalog/task-coverity-availability-check:0.1@sha256:8e16d7d762c4d078740583c010195f506c3db1595979cbd05aadf917724e4558 - name: kind value: task resolver: bundles @@ -575,7 +575,7 @@ spec: - name: name value: rpms-signature-scan - name: bundle - value: quay.io/konflux-ci/tekton-catalog/task-rpms-signature-scan:0.2@sha256:8f3b23bf1b0ef55cc79d28604d2397a0101ac9c0c42ae26e26532eb2778c801b + value: quay.io/konflux-ci/tekton-catalog/task-rpms-signature-scan:0.2@sha256:39cd56ffa26ff5edfd5bf9b61e902cae35a345c078cd9dcbc0737d30f3ce5ef1 - name: kind value: task resolver: bundles diff --git a/.tekton/devfile-registry-main-push.yaml b/.tekton/devfile-registry-main-push.yaml index 4b9003da..63b24165 100644 --- a/.tekton/devfile-registry-main-push.yaml +++ b/.tekton/devfile-registry-main-push.yaml @@ -153,7 +153,7 @@ spec: - name: name value: init - name: bundle - value: quay.io/konflux-ci/tekton-catalog/task-init:0.2@sha256:0523b51c28375a3f222da91690e22eff11888ebc98a0c73c468af44762265c69 + value: quay.io/konflux-ci/tekton-catalog/task-init:0.2@sha256:90dda596d44b3f861889da2fba161dff34c6116fe76c3989e3f84262ea0f29cd - name: kind value: task resolver: bundles @@ -195,7 +195,7 @@ spec: - name: name value: prefetch-dependencies - name: bundle - value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies:0.1@sha256:d3d8a8bfee292afee3c683692fdd70c031ef430446124285f6abc73365839a6f + value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies:0.2@sha256:b7a6b67e97c6c03b552b9cd57d4a2868d63e279ee68ced2a53e713befca9e009 - name: kind value: task resolver: bundles @@ -239,7 +239,7 @@ spec: - name: name value: buildah - name: bundle - value: quay.io/konflux-ci/tekton-catalog/task-buildah:0.2@sha256:aebfe04c80f7fd937628fad760c095c6a0efacb048f2c98e5d5e7f2b0f134cf9 + value: quay.io/konflux-ci/tekton-catalog/task-buildah:0.2@sha256:03ff951f641678ae63e7d7f956a30a52547a58e093970a0a88665a6238c5061b - name: kind value: task resolver: bundles @@ -460,7 +460,7 @@ spec: - name: name value: coverity-availability-check - name: bundle - value: quay.io/konflux-ci/tekton-catalog/task-coverity-availability-check:0.1@sha256:dfe1150a94c7464c4a1e0b5a2bfdab4c9c97f51a992f8a479a43acc64ffcbf73 + value: quay.io/konflux-ci/tekton-catalog/task-coverity-availability-check:0.1@sha256:8e16d7d762c4d078740583c010195f506c3db1595979cbd05aadf917724e4558 - name: kind value: task resolver: bundles @@ -575,7 +575,7 @@ spec: - name: name value: rpms-signature-scan - name: bundle - value: quay.io/konflux-ci/tekton-catalog/task-rpms-signature-scan:0.2@sha256:8f3b23bf1b0ef55cc79d28604d2397a0101ac9c0c42ae26e26532eb2778c801b + value: quay.io/konflux-ci/tekton-catalog/task-rpms-signature-scan:0.2@sha256:39cd56ffa26ff5edfd5bf9b61e902cae35a345c078cd9dcbc0737d30f3ce5ef1 - name: kind value: task resolver: bundles From e923d949d9474c156b960e4ce3cf216c778cbfb5 Mon Sep 17 00:00:00 2001 From: team-devfile-bot Date: Mon, 6 Jan 2025 18:04:29 +0000 Subject: [PATCH 6/6] Trigger deploy based on devfile/devfile-web@f540461f043c7decee8904ecb9c5b5a81117b633 Signed-off-by: Maximiliano Pizarro