From 901a30ea8c892e486bf5c2a4917f8ced208e15ea Mon Sep 17 00:00:00 2001 From: Dmytro Nochevnov Date: Thu, 18 Jan 2024 16:41:12 +0200 Subject: [PATCH] Move installation of oc client from Dockerfile to common.sh (#644) Signed-off-by: Dmytro Nochevnov --- .ci/openshift-ci/Dockerfile | 4 +--- .ci/openshift-ci/common.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.ci/openshift-ci/Dockerfile b/.ci/openshift-ci/Dockerfile index 09e046f5a8..9696dfd326 100644 --- a/.ci/openshift-ci/Dockerfile +++ b/.ci/openshift-ci/Dockerfile @@ -32,9 +32,7 @@ RUN set -x && dnf install -y -q --allowerasing --nobest nodejs-devel nodejs-libs curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \ chmod +x ./kubectl && \ mv ./kubectl /usr/local/bin && \ - bash <(curl -sL https://www.eclipse.org/che/chectl/) --channel=next && \ - curl -v https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest-4.14/openshift-client-linux.tar.gz | tar xvzf - -C /usr/local/bin/ oc && \ - chmod ug+x /usr/local/bin/oc + bash <(curl -sL https://www.eclipse.org/che/chectl/) --channel=next SHELL ["/bin/bash", "-c"] diff --git a/.ci/openshift-ci/common.sh b/.ci/openshift-ci/common.sh index 277ed2fe36..dfd9e0e611 100644 --- a/.ci/openshift-ci/common.sh +++ b/.ci/openshift-ci/common.sh @@ -490,6 +490,7 @@ testCloneGitRepoProjectShouldExists() { setupTestEnvironment() { OCP_USER_NAME=$1 + installOcClient provisionOpenShiftOAuthUser createCustomResourcesFile deployChe @@ -502,6 +503,7 @@ setupTestEnvironmentOAuthFlow() { APPLICATION_ID=$2 APPLICATION_SECRET=$3 + installOcClient provisionOpenShiftOAuthUser configureGitSelfSignedCertificate createCustomResourcesFile @@ -510,3 +512,9 @@ setupTestEnvironmentOAuthFlow() { createOAuthApplicationGitLabServer ${ADMIN_ACCESS_TOKEN} ${APPLICATION_NAME} setupOAuthSecret ${APPLICATION_ID} ${APPLICATION_SECRET} } + +installOcClient() { + set -x + curl https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest-4.14/openshift-client-linux.tar.gz | tar xvzf - -C /usr/local/bin/ oc && \ + chmod ug+x /usr/local/bin/oc +}