mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
Fix windows script to use correct API KEY (#5512)
* fix windows script to use correct API KEY Signed-off-by: anandrkskd <anandrkskd@gmail.com> * remove github login Signed-off-by: anandrkskd <anandrkskd@gmail.com> * k8s updated qe key Signed-off-by: anandrkskd <anandrkskd@gmail.com> * use serviceid API key Signed-off-by: anandrkskd <anandrkskd@gmail.com> * update save_log func Signed-off-by: anandrkskd <anandrkskd@gmail.com> * make script executable Signed-off-by: anandrkskd <anandrkskd@gmail.com>
This commit is contained in:
committed by
GitHub
parent
63a5dcea99
commit
575d9ce7d6
@@ -11,17 +11,17 @@ save_logs() {
|
||||
apt update
|
||||
apt install jq colorized-logs --yes
|
||||
|
||||
ansi2html < "/tmp/${LOGFILE}" > "/tmp/${LOGFILE}.html"
|
||||
ansi2txt < "/tmp/${LOGFILE}" > "/tmp/${LOGFILE}.txt"
|
||||
ansi2html <"/tmp/${LOGFILE}" >"/tmp/${LOGFILE}.html"
|
||||
ansi2txt <"/tmp/${LOGFILE}" >"/tmp/${LOGFILE}.txt"
|
||||
|
||||
ibmcloud target -g "${IBM_RESOURCE_GROUP}"
|
||||
ibmcloud login --apikey "${API_KEY}"
|
||||
ibmcloud target -g "${IBM_RESOURCE_GROUP}" -r "${IBM_REGION}"
|
||||
CRN=$(ibmcloud resource service-instance ${IBM_COS} --output json | jq -r .[0].guid)
|
||||
ibmcloud cos config crn --crn "${CRN}"
|
||||
|
||||
ibmcloud cos upload --bucket "${IBM_BUCKET}" --key "${LOGFILE}.html" --file "/tmp/${LOGFILE}.html"
|
||||
ibmcloud cos upload --bucket "${IBM_BUCKET}" --key "${LOGFILE}.txt" --file "/tmp/${LOGFILE}.txt"
|
||||
|
||||
echo -n ${GITHUB_TOKEN} | gh auth login --with-token
|
||||
BASE_URL="https://s3.${IBM_REGION}.cloud-object-storage.appdomain.cloud/${IBM_BUCKET}"
|
||||
if [[ $RESULT == "0" ]]; then
|
||||
STATUS="successfully"
|
||||
@@ -38,12 +38,10 @@ EOF
|
||||
# with values: "team: odo" and "type: testing"
|
||||
cleanup_namespaces() {
|
||||
PROJECTS=$(kubectl get cm -A | grep config-map-for-cleanup | awk '{ print $1 }')
|
||||
for PROJECT in ${PROJECTS}
|
||||
do
|
||||
for PROJECT in ${PROJECTS}; do
|
||||
TEAM=$(kubectl get configmaps config-map-for-cleanup -n ${PROJECT} -o jsonpath='{.data.team}')
|
||||
TYPE=$(kubectl get configmaps config-map-for-cleanup -n ${PROJECT} -o jsonpath='{.data.type}')
|
||||
if [[ "${TYPE}" -eq "testing" ]] && [[ "${TEAM}" -eq "odo" ]]
|
||||
then
|
||||
if [[ "${TYPE}" -eq "testing" ]] && [[ "${TEAM}" -eq "odo" ]]; then
|
||||
kubectl delete namespace ${PROJECT} --wait=false
|
||||
fi
|
||||
done
|
||||
|
||||
2
.ibm/pipelines/kubernetes-tests.sh
Normal file → Executable file
2
.ibm/pipelines/kubernetes-tests.sh
Normal file → Executable file
@@ -4,7 +4,7 @@ LOGFILE="pr-${GIT_PR_NUMBER}-kubernetes-tests-${BUILD_NUMBER}"
|
||||
|
||||
source .ibm/pipelines/functions.sh
|
||||
|
||||
ibmcloud login --apikey "${API_KEY}"
|
||||
ibmcloud login --apikey "${API_KEY_QE}"
|
||||
ibmcloud target -r "${IBM_REGION}"
|
||||
ibmcloud ks cluster config --cluster "${IBM_KUBERNETES_ID}" --admin
|
||||
|
||||
|
||||
4
.ibm/pipelines/openshift-tests.sh
Normal file → Executable file
4
.ibm/pipelines/openshift-tests.sh
Normal file → Executable file
@@ -4,7 +4,7 @@ LOGFILE="pr-${GIT_PR_NUMBER}-openshift-tests-${BUILD_NUMBER}"
|
||||
|
||||
source .ibm/pipelines/functions.sh
|
||||
|
||||
oc login -u apikey -p "${API_KEY}" "${IBM_OPENSHIFT_ENDPOINT}"
|
||||
oc login -u apikey -p "${API_KEY_QE}" "${IBM_OPENSHIFT_ENDPOINT}"
|
||||
|
||||
cleanup_namespaces
|
||||
|
||||
@@ -20,8 +20,6 @@ cleanup_namespaces
|
||||
) |& tee "/tmp/${LOGFILE}"
|
||||
RESULT=${PIPESTATUS[0]}
|
||||
|
||||
ibmcloud login --apikey "${API_KEY}"
|
||||
ibmcloud target -r "${IBM_REGION}"
|
||||
save_logs "${LOGFILE}" "OpenShift Tests" ${RESULT}
|
||||
|
||||
exit ${RESULT}
|
||||
|
||||
0
.ibm/pipelines/unit-tests.sh
Normal file → Executable file
0
.ibm/pipelines/unit-tests.sh
Normal file → Executable file
0
.ibm/pipelines/validate.sh
Normal file → Executable file
0
.ibm/pipelines/validate.sh
Normal file → Executable file
@@ -57,7 +57,7 @@ function Run-Test {
|
||||
|
||||
|
||||
Shout "Login Openshift"
|
||||
oc login -u apikey -p ${API_KEY_QE} ${IBM_OPENSHIFT_ENDPOINT}
|
||||
oc login -u apikey -p ${API_KEY} ${IBM_OPENSHIFT_ENDPOINT}
|
||||
|
||||
Shout "Create Binary"
|
||||
make install
|
||||
|
||||
@@ -10,20 +10,20 @@ set -x
|
||||
LOGFILE="pr-${GIT_PR_NUMBER}-windows-tests-${BUILD_NUMBER}"
|
||||
export REPO=${REPO:-"https://github.com/redhat-developer/odo"}
|
||||
#copy test script inside /tmp/
|
||||
sshpass -p $WINDOWS_PASSWORD scp -o StrictHostKeyChecking=no ./.ibm/pipelines/windows-test-script.ps1 Administrator@$WINDOWS_IP:/tmp/windows-test-script.ps1
|
||||
sshpass -p $WINDOWS_PASSWORD scp -o StrictHostKeyChecking=no ./.ibm/pipelines/windows-test-script.ps1 Administrator@$WINDOWS_IP:/tmp/windows-test-script.ps1
|
||||
|
||||
#execute test from the test script
|
||||
sshpass -p $WINDOWS_PASSWORD ssh Administrator@$WINDOWS_IP -o StrictHostKeyChecking=no powershell /tmp/windows-test-script.ps1 "${GIT_PR_NUMBER}" "${BUILD_NUMBER}" "${API_KEY}" "${IBM_OPENSHIFT_ENDPOINT}" "${LOGFILE}" "${REPO}"
|
||||
sshpass -p $WINDOWS_PASSWORD ssh Administrator@$WINDOWS_IP -o StrictHostKeyChecking=no powershell /tmp/windows-test-script.ps1 "${GIT_PR_NUMBER}" "${BUILD_NUMBER}" "${API_KEY_QE}" "${IBM_OPENSHIFT_ENDPOINT}" "${LOGFILE}" "${REPO}"
|
||||
RESULT=$?
|
||||
echo "RESULT: $RESULT"
|
||||
|
||||
# save log
|
||||
source .ibm/pipelines/functions.sh
|
||||
ibmcloud login --apikey "${API_KEY}" -r "${IBM_REGION}"
|
||||
sshpass -p $WINDOWS_PASSWORD scp -o StrictHostKeyChecking=no Administrator@$WINDOWS_IP:/tmp/${LOGFILE} /tmp/${LOGFILE}
|
||||
save_logs "${LOGFILE}" "Windows Tests (OCP)" $RESULT
|
||||
sshpass -p $WINDOWS_PASSWORD scp -o StrictHostKeyChecking=no Administrator@$WINDOWS_IP:/tmp/${LOGFILE} /tmp/${LOGFILE}
|
||||
save_logs "${LOGFILE}" "Windows Tests (OCP)" $RESULT
|
||||
|
||||
# cleanup
|
||||
sshpass -p $WINDOWS_PASSWORD ssh Administrator@$WINDOWS_IP -o StrictHostKeyChecking=no rm -rf /tmp/windows-test-script.ps1
|
||||
sshpass -p $WINDOWS_PASSWORD ssh Administrator@$WINDOWS_IP -o StrictHostKeyChecking=no rm -rf /tmp/windows-test-script.ps1
|
||||
|
||||
exit ${RESULT}
|
||||
Reference in New Issue
Block a user