Skip to content

Commit

Permalink
Merge pull request #290 from rhopp/RHTAPINST-166v2
Browse files Browse the repository at this point in the history
RHTAPINST-166: extract login logic from rhtap-install task (version 2)
  • Loading branch information
openshift-merge-bot[bot] authored Oct 30, 2024
2 parents 18f68a3 + 5644b71 commit 36fcc40
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
13 changes: 13 additions & 0 deletions integration-tests/scripts/ci-oc-login.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail

## Script to be used in CI only.

# Login to OpenShift
export KUBECONFIG=$HOME/rhtap-cli-ci-kubeconfig
echo "[INFO]Login: $OCP_LOGIN_COMMAND"

$OCP_LOGIN_COMMAND >/dev/null
echo "[INFO]Console: $(kubectl get routes -n openshift-console console -o jsonpath='{.spec.port.targetPort}://{.spec.host}')"
5 changes: 5 additions & 0 deletions integration-tests/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ set -o errexit
set -o nounset
set -o pipefail

## This file should be present only in CI created by integration-tests/scripts/ci-oc-login.sh
if [ -f "$HOME/rhtap-cli-ci-kubeconfig" ]; then
export KUBECONFIG="$HOME/rhtap-cli-ci-kubeconfig"
fi

echo "[INFO]Configuring deployment"

acs_install_enabled="${acs_install_enabled:-true}"
Expand Down
5 changes: 5 additions & 0 deletions integration-tests/scripts/minio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ set -o errexit
set -o nounset
set -o pipefail

## This file should be present only in CI created by integration-tests/scripts/ci-oc-login.sh
if [ -f "$HOME/rhtap-cli-ci-kubeconfig" ]; then
export KUBECONFIG="$HOME/rhtap-cli-ci-kubeconfig"
fi

echo "[INFO] Applying minIO workaround"
DOCKER_IO_AUTH="$(cat /usr/local/rhtap-cli-install/docker_io)"
oc get secret/pull-secret -n openshift-config --template='{{index .data ".dockerconfigjson" | base64decode}}' > ./global-pull-secret.json
Expand Down
10 changes: 3 additions & 7 deletions integration-tests/tasks/rhtap-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ spec:
value: "$(params.gitlab_enabled)"
- name: jenkins_enabled
value: "$(params.jenkins_enabled)"
- name: OCP_LOGIN_COMMAND
value: "$(params.ocp-login-command)"
volumeMounts:
- name: rhtap-cli-volume
mountPath: /usr/local/rhtap-cli-install
Expand All @@ -55,13 +57,6 @@ spec:
set -o nounset
set -o pipefail
# Login to OpenShift
export KUBECONFIG=$(pwd)/kubeconfig
echo "[INFO]Login: $(params.ocp-login-command)"
$(params.ocp-login-command) >/dev/null
echo "[INFO]Console: $(kubectl get routes -n openshift-console console -o jsonpath='{.spec.port.targetPort}://{.spec.host}')"
GIT_REPO="${GIT_REPO:-$(echo "$JOB_SPEC" | jq -r '.git.git_repo')}"
# Clone the rhtap-cli repository
cd "$(mktemp -d)"
Expand All @@ -79,5 +74,6 @@ spec:
fi
# Deploy rhtap
./integration-tests/scripts/ci-oc-login.sh
./integration-tests/scripts/minio.sh
./integration-tests/scripts/install.sh

0 comments on commit 36fcc40

Please sign in to comment.