-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78a24db
commit d78648e
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from fedora:32 | ||
|
||
WORKDIR /project | ||
|
||
RUN dnf update -y; | ||
RUN mkdir /project/output | ||
RUN export ARCH=$(case $(arch) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(arch) ;; esac); \ | ||
export OS=$(uname | awk '{print tolower($0)}'); \ | ||
export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.4.0/; \ | ||
curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH};\ | ||
chmod +x operator-sdk_${OS}_${ARCH};\ | ||
mv operator-sdk_${OS}_${ARCH} operator-sdk;\ | ||
mv operator-sdk /usr/local/bin/; | ||
RUN dnf install -y git ansible wget python3-pip | ||
RUN git clone --branch v1.0.11 https://github.com/redhat-operator-ecosystem/operator-test-playbooks.git | ||
COPY ./entrypoint.sh /project/entrypoint.sh | ||
RUN chmod +x /project/entrypoint.sh | ||
ENTRYPOINT ["/project/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# operator-bundle-image validate | ||
|
||
ansible-playbook -vvvv --connection local -i localhost, operator-test-playbooks/validate-operator-bundle.yml -e"work_dir=/project/output" -e"operator_work_dir=/project/operator-bundle/" | ||
|
||
operatorSDKVersion=$(cat /project/output/validation-version.txt) | ||
operatorBundlevalidationReturnCode=$(cat /project/output/validation-rc.txt) | ||
operatorBundlevalidationOutput=$(cat /project/output/validation-output.txt) | ||
|
||
echo -e "operatorSDKVersion is $operatorSDKVersion" | ||
echo -e "Operator bundle validation Return Code is $operatorBundlevalidationReturnCode" | ||
echo -e "Operator bundle Validation output is \n $operatorBundlevalidationOutput" | ||
|
||
if [[ $operatorBundlevalidationReturnCode -eq 0 ]]; | ||
then | ||
echo -e "\nBundle image validation is successful" | ||
exit 0 | ||
else | ||
echo -e "\nBundle image validation Failed" | ||
exit 1 | ||
fi | ||
|