Skip to content

Commit

Permalink
Initial export
Browse files Browse the repository at this point in the history
  • Loading branch information
samvarankashyap committed Feb 12, 2021
1 parent 78a24db commit d78648e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Dockerfile
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"]
23 changes: 23 additions & 0 deletions entrypoint.sh
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

0 comments on commit d78648e

Please sign in to comment.