diff --git a/.tekton/pull-request.yaml b/.tekton/pull-request.yaml index d206783b24..ea17e0410e 100644 --- a/.tekton/pull-request.yaml +++ b/.tekton/pull-request.yaml @@ -139,6 +139,11 @@ spec: type: string - name: e2e_test_namespace type: string + results: + - name: custom-docker-build-bundle + description: "custom bundle for docker-build pipeline" + - name: custom-fbc-builder-bundle + description: "custom bundle for fbc-builder pipeline" steps: - name: build-bundles image: quay.io/konflux-ci/pull-request-builds:appstudio-utils-{{revision}} @@ -152,6 +157,8 @@ spec: INSTALL_BUNDLE_NS=$(params.e2e_test_namespace) \ ENABLE_SOURCE_BUILD=1 \ hack/build-and-push.sh + echo -n $CUSTOM_DOCKER_BUILD_PIPELINE_BUNDLE | tee $(results.custom-docker-build-bundle.path) + echo -n $CUSTOM_FBC_BUILDER_PIPELINE_BUNDLE | tee $(results.custom-fbc-builder-bundle.path) workspaces: - name: source - name: e2e-tests @@ -164,6 +171,10 @@ spec: value: "{{ source_url }}" - name: ec_pipelines_repo_revision value: "{{ revision }}" + - name: docker-build-bundle + value: "$(tasks.build-bundles.results.custom-docker-build-bundle)" + - name: fbc-builder-bundle + value: "$(tasks.build-bundles.results.custom-fbc-builder-bundle)" runAfter: - build-bundles taskRef: diff --git a/.tekton/tasks/e2e-test.yaml b/.tekton/tasks/e2e-test.yaml index f47e75a8ee..cb3f4f4c37 100644 --- a/.tekton/tasks/e2e-test.yaml +++ b/.tekton/tasks/e2e-test.yaml @@ -20,9 +20,13 @@ spec: type: string - name: ec_pipelines_repo_revision type: string + - name: docker-build-bundle + type: string + - name: fbc-builder-bundle + type: string steps: - name: e2e-test - image: quay.io/redhat-appstudio/e2e-tests:bf19763689bec49c3169fe1ca5e704789ea48f56 + image: quay.io/susdas/e2e:next # a la infra-deployment updates, when PRs merge in e2e-tests, PRs will be opened # against build-definitions to update this tag args: [ @@ -38,7 +42,7 @@ spec: - name: APP_SUFFIX value: "$(params.app_suffix)" - name: COMPONENT_REPO_URLS - value: "https://github.com/redhat-appstudio-qe/devfile-sample-python-basic,https://github.com/redhat-appstudio-qe/retrodep,https://github.com/cachito-testing/pip-e2e-test,https://github.com/redhat-appstudio-qe/fbc-sample-repo,https://github.com/redhat-appstudio-qe/nodejs-no-dockerfile,https://github.com/redhat-appstudio-qe/maven-hello-world" + value: "https://github.com/redhat-appstudio-qe/devfile-sample-python-basic,https://github.com/redhat-appstudio-qe/retrodep,https://github.com/cachito-testing/pip-e2e-test,https://github.com/redhat-appstudio-qe/fbc-sample-repo" - name: QUAY_E2E_ORGANIZATION value: redhat-appstudio - name: E2E_APPLICATIONS_NAMESPACE @@ -59,3 +63,7 @@ spec: value: $(params.ec_pipelines_repo_url) - name: EC_PIPELINES_REPO_REVISION value: $(params.ec_pipelines_repo_revision) + - name: CUSTOM_DOCKER_BUILD_PIPELINE_BUNDLE + value: "$(params.docker-build-bundle)" + - name: CUSTOM_FBC_BUILDER_PIPELINE_BUNDLE + value: "$(params.fbc-builder-bundle)" diff --git a/hack/build-and-push.sh b/hack/build-and-push.sh index 6626319dcd..873d6f8d64 100755 --- a/hack/build-and-push.sh +++ b/hack/build-and-push.sh @@ -182,5 +182,6 @@ do done if [ "$SKIP_INSTALL" == "" ]; then - "$SCRIPTDIR/util-install-bundle.sh" "$docker_pipeline_bundle,$fbc_pipeline_bundle,$nodejs_pipeline_bundle,$java_pipeline_bundle" "$INSTALL_BUNDLE_NS" + CUSTOM_DOCKER_BUILD_PIPELINE_BUNDLE="$docker_pipeline_bundle" + CUSTOM_FBC_BUILDER_PIPELINE_BUNDLE="$fbc_pipeline_bundle" fi diff --git a/hack/util-install-bundle.sh b/hack/util-install-bundle.sh deleted file mode 100755 index c7f7038699..0000000000 --- a/hack/util-install-bundle.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/bash - -set -e -o pipefail - -BUNDLES=$1 -NAMESPACE=${2:-$(oc project -q)} -if [ -z "$BUNDLES" ]; then - echo "No Pipeline Bundles specified" - exit 1 -fi - -IFS=',' read -ra BUNDLE <<< "$BUNDLES" -for i in "${BUNDLE[@]}"; do - if [[ $i == *"docker-build"* ]]; then - DOCKER_BUNDLE=$i - elif [[ $i == *"fbc-builder"* ]]; then - FBC_BUNDLE=$i - elif [[ $i == *"nodejs-builder"* ]]; then - NODEJS_BUNDLE=$i - elif [[ $i == *"java-builder"* ]]; then - JAVA_BUNDLE=$i - fi -done - -cat << EOF | oc -n "$NAMESPACE" apply -f- -apiVersion: appstudio.redhat.com/v1alpha1 -kind: BuildPipelineSelector -metadata: - name: build-pipeline-selector -spec: - selectors: - - name: Hermetic build - golang - pipelineParams: - - name: hermetic - value: "true" - - name: prefetch-input - value: "gomod" - pipelineRef: - resolver: bundles - params: - - name: name - value: docker-build - - name: bundle - value: ${DOCKER_BUNDLE} - - name: kind - value: pipeline - when: - dockerfile: true - language: Go - projectType: test-hermetic-build - - name: Hermetic build - python - pipelineParams: - - name: hermetic - value: "true" - - name: prefetch-input - value: "pip" - pipelineRef: - resolver: bundles - params: - - name: name - value: docker-build - - name: bundle - value: ${DOCKER_BUNDLE} - - name: kind - value: pipeline - when: - dockerfile: true - language: Python - projectType: test-hermetic-build - - name: FBC build - pipelineRef: - resolver: bundles - params: - - name: name - value: fbc-builder - - name: bundle - value: ${FBC_BUNDLE} - - name: kind - value: pipeline - when: - language: fbc - - name: S2I - NodeJS - pipelineRef: - resolver: bundles - params: - - name: name - value: nodejs-builder - - name: bundle - value: ${NODEJS_BUNDLE} - - name: kind - value: pipeline - when: - language: nodejs - - name: S2I - Java - pipelineRef: - resolver: bundles - params: - - name: name - value: java-builder - - name: bundle - value: ${JAVA_BUNDLE} - - name: kind - value: pipeline - when: - language: java - - name: Docker build - pipelineRef: - resolver: bundles - params: - - name: name - value: docker-build - - name: bundle - value: ${DOCKER_BUNDLE} - - name: kind - value: pipeline - when: - dockerfile: true -EOF - -echo "Overridden Pipeline selectors configured to come from the namespace '$NAMESPACE':" -oc get buildpipelineselector build-pipeline-selector -n "$NAMESPACE" -o yaml | yq '.spec.selectors'