Skip to content

Commit

Permalink
Fix install script broken if (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobGeada authored Aug 14, 2023
1 parent e7e9b60 commit 6e28e74
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions tests/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,20 @@ if [ -z "$PULL_NUMBER" ]; then
sed -i "s#value: operatorTagPlaceholder#value: latest#" $HOME/peak/operator-tests/trustyai-explainability/resources/trustyai/trustyai_operator_kfdef.yaml
sed -i "s#value: operatorImagePlaceholder#value: quay.io/trustyai/trustyai-service-operator#" $HOME/peak/operator-tests/trustyai-explainability/resources/trustyai/trustyai_operator_kfdef.yaml
else
if [ $REPO_NAME == "trustyai-explainability" ]; then
echo "Setting manifests in kfctl_openshift to use pull number: $PULL_NUMBER"
sed -i "s#uri: https://github.com/trustyai-explainability/trustyai-explainability/tarball/main#uri: https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/tarball/pull/${PULL_NUMBER}/head#" ./${KFDEF_FILENAME}
echo "Setting manifests in kfctl_openshift to use pull number: $PULL_NUMBER"
sed -i "s#uri: https://github.com/trustyai-explainability/trustyai-explainability/tarball/main#uri: https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/tarball/pull/${PULL_NUMBER}/head#" ./${KFDEF_FILENAME}

BRANCH_SHA=$(curl https://api.github.com/repos/trustyai-explainability/trustyai-explainability/pulls/${PULL_NUMBER} | jq ".head.sha" | tr -d '"')
BRANCH_SHA=$(curl https://api.github.com/repos/trustyai-explainability/trustyai-explainability/pulls/${PULL_NUMBER} | jq ".head.sha" | tr -d '"')

# echo "Setting TrustyAI service kfdef to use PR image"
# sed -i "s#value: \"quay.io/trustyai/trustyai-service:latest\"#value: \"quay.io/trustyai/trustyai-service-ci:${BRANCH_SHA}\"#" ../resources/trustyai/trustyai_service_kfdef.yaml

echo "Setting TrustyAI operator configmap to use PR image"
sed -i "s#value: operatorImagePlaceholder#value: quay.io/trustyai/trustyai-service-operator-ci#" $HOME/peak/operator-tests/trustyai-explainability/resources/trustyai/trustyai_operator_kfdef.yaml
sed -i "s#value: operatorTagPlaceholder#value: ${BRANCH_SHA}#" $HOME/peak/operator-tests/trustyai-explainability/resources/trustyai/trustyai_operator_kfdef.yaml
echo "Setting TrustyAI operator configmap to use PR image"
sed -i "s#value: operatorImagePlaceholder#value: quay.io/trustyai/trustyai-service-operator-ci#" $HOME/peak/operator-tests/trustyai-explainability/resources/trustyai/trustyai_operator_kfdef.yaml
sed -i "s#value: operatorTagPlaceholder#value: ${BRANCH_SHA}#" $HOME/peak/operator-tests/trustyai-explainability/resources/trustyai/trustyai_operator_kfdef.yaml

echo "TrustyAI Operator KFDEF"
cat $HOME/peak/operator-tests/trustyai-explainability/resources/trustyai/trustyai_operator_kfdef.yaml
fi
echo "TrustyAI Operator KFDEF:"
cat $HOME/peak/operator-tests/trustyai-explainability/resources/trustyai/trustyai_operator_kfdef.yaml
fi

if [ -z "${OPENSHIFT_TESTUSER_NAME}" ] || [ -z "${OPENSHIFT_TESTUSER_PASS}" ]; then
Expand Down Expand Up @@ -101,6 +99,7 @@ else
cat ./${KFDEF_FILENAME} > ${ARTIFACT_DIR}/${KFDEF_FILENAME}
cat $HOME/peak/operator-tests/trustyai-explainability/resources/trustyai/trustyai_operator_kfdef.yaml > ${ARTIFACT_DIR}/operator_kfdef.yaml


oc apply -f ./${KFDEF_FILENAME}
kfctl_result=$?
if [ "$kfctl_result" -ne 0 ]; then
Expand Down

0 comments on commit 6e28e74

Please sign in to comment.