Loading .jenkins.sh +3 −1 Original line number Diff line number Diff line Loading @@ -12,4 +12,6 @@ run_dir="$(pwd)" bash ./scripts/build-container.sh bash ./scripts/run-container.sh "${run_dir}" exit $? ret=$? echo "Final validation result: $ret" exit $ret scripts/build-container.sh +14 −14 Original line number Diff line number Diff line Loading @@ -10,25 +10,25 @@ if [ -f ${DOCKER_FILE} ] then #check and build stf583-rf-validation image DOCKER_ID=`docker ps -a | grep -e stf583-rf-validation | awk '{ print $1 }'` if [ ! -z "${DOCKER_ID}" ] then docker rm --force stf583-rf-validation fi docker build --tag stf583-rf-validation --force-rm -f ${DOCKER_FILE} . # if [ ! -z "${DOCKER_ID}" ] # then # docker rm --force stf583-rf-validation # fi docker build --tag stf583-rf-validation -f ${DOCKER_FILE} . if [ "$?" != "0" ] then echo "Docker build failed: $?" exit -1 fi docker image ls -a docker inspect stf583-rf-validation:latest if [ "$?" != "0" ] then echo "Docker inspect failed: $?" exit -2 fi else exit -3 # docker image ls -a # docker inspect stf583-rf-validation:latest # if [ "$?" != "0" ] # then # echo "Docker inspect failed: $?" # exit -2 # fi #else # exit -3 fi # That's all Floks Loading scripts/docker/Dockerfile +5 −6 Original line number Diff line number Diff line Loading @@ -7,11 +7,8 @@ LABEL description="SFT583 Robot Framework Docker Image" ENV TERM=xterm ENV HOSTNAME docker-robot-STF583 ARG ssh_prv_key RUN DEBIAN_FRONTEND=noninteractive apt update \ && apt install python3 git -y \ && apt install python3-pip -y \ Loading @@ -34,16 +31,18 @@ RUN DEBIAN_FRONTEND=noninteractive \ && mkdir -p /home/etsi/dev/robot \ && cd /home/etsi/dev/robot RUN pip3 install robotframework ADD . /home/etsi/dev/robot RUN DEBIAN_FRONTEND=noninteractive \ && cd /home/etsi/dev/robot \ && git clone https://github.com/etsi-cti-admin/robotframework-mockserver RUN pip3 install robotframework ADD . /home/etsi/dev/robot RUN DEBIAN_FRONTEND=noninteractive \ && cd /home/etsi/dev/robot \ && pip3 install -r requirements.txt \ && chmod +x /home/etsi/dev/robot/scripts/* \ && git clone https://github.com/etsi-cti-admin/robotframework-mockserver \ && cd robotframework-mockserver \ && patch -p1 < ../extensions/mockserverlibrary.patch \ && python3 -m pip install -e . Loading scripts/run-container.sh +5 −5 Original line number Diff line number Diff line Loading @@ -5,10 +5,10 @@ #set -e #set -vx docker run stf583-rf-validation:latest "/bin/bash" \ -c "cd /home/etsi/dev/robot \ && bash scripts/validate.sh " docker run stf583-rf-validation:latest "bash" \ -c "/home/etsi/dev/robot/scripts/validate.sh" # That's all Floks exit $? ret=$? exit $ret scripts/validate.sh +11 −4 Original line number Diff line number Diff line Loading @@ -2,12 +2,19 @@ # # Validate syntax and keywords existance in each Robot file cd /home/etsi/dev/robot/ res=0 for i in */*/*.robot ; do [[ "$i" != *"Keywords.robot"* && "$i" != *"Keyword.robot"* ]] && \ (echo "++++ Dryrun $i" && \ robot --dryrun --output NONE --report NONE --log NONE $i || \ (echo "++++ Issues in file $i" && res=1)); if [[ "$i" != *"Keywords.robot"* && "$i" != *"Keyword.robot"* ]] ; then echo "++++ Dryrun file $i" msg=$(robot --dryrun --output NONE --report NONE --log NONE $i 2>&1) if [ $? != 0 ] ; then echo "++++ Issues found in file $i" echo "$msg" res=1 fi fi done exit $res Loading
.jenkins.sh +3 −1 Original line number Diff line number Diff line Loading @@ -12,4 +12,6 @@ run_dir="$(pwd)" bash ./scripts/build-container.sh bash ./scripts/run-container.sh "${run_dir}" exit $? ret=$? echo "Final validation result: $ret" exit $ret
scripts/build-container.sh +14 −14 Original line number Diff line number Diff line Loading @@ -10,25 +10,25 @@ if [ -f ${DOCKER_FILE} ] then #check and build stf583-rf-validation image DOCKER_ID=`docker ps -a | grep -e stf583-rf-validation | awk '{ print $1 }'` if [ ! -z "${DOCKER_ID}" ] then docker rm --force stf583-rf-validation fi docker build --tag stf583-rf-validation --force-rm -f ${DOCKER_FILE} . # if [ ! -z "${DOCKER_ID}" ] # then # docker rm --force stf583-rf-validation # fi docker build --tag stf583-rf-validation -f ${DOCKER_FILE} . if [ "$?" != "0" ] then echo "Docker build failed: $?" exit -1 fi docker image ls -a docker inspect stf583-rf-validation:latest if [ "$?" != "0" ] then echo "Docker inspect failed: $?" exit -2 fi else exit -3 # docker image ls -a # docker inspect stf583-rf-validation:latest # if [ "$?" != "0" ] # then # echo "Docker inspect failed: $?" # exit -2 # fi #else # exit -3 fi # That's all Floks Loading
scripts/docker/Dockerfile +5 −6 Original line number Diff line number Diff line Loading @@ -7,11 +7,8 @@ LABEL description="SFT583 Robot Framework Docker Image" ENV TERM=xterm ENV HOSTNAME docker-robot-STF583 ARG ssh_prv_key RUN DEBIAN_FRONTEND=noninteractive apt update \ && apt install python3 git -y \ && apt install python3-pip -y \ Loading @@ -34,16 +31,18 @@ RUN DEBIAN_FRONTEND=noninteractive \ && mkdir -p /home/etsi/dev/robot \ && cd /home/etsi/dev/robot RUN pip3 install robotframework ADD . /home/etsi/dev/robot RUN DEBIAN_FRONTEND=noninteractive \ && cd /home/etsi/dev/robot \ && git clone https://github.com/etsi-cti-admin/robotframework-mockserver RUN pip3 install robotframework ADD . /home/etsi/dev/robot RUN DEBIAN_FRONTEND=noninteractive \ && cd /home/etsi/dev/robot \ && pip3 install -r requirements.txt \ && chmod +x /home/etsi/dev/robot/scripts/* \ && git clone https://github.com/etsi-cti-admin/robotframework-mockserver \ && cd robotframework-mockserver \ && patch -p1 < ../extensions/mockserverlibrary.patch \ && python3 -m pip install -e . Loading
scripts/run-container.sh +5 −5 Original line number Diff line number Diff line Loading @@ -5,10 +5,10 @@ #set -e #set -vx docker run stf583-rf-validation:latest "/bin/bash" \ -c "cd /home/etsi/dev/robot \ && bash scripts/validate.sh " docker run stf583-rf-validation:latest "bash" \ -c "/home/etsi/dev/robot/scripts/validate.sh" # That's all Floks exit $? ret=$? exit $ret
scripts/validate.sh +11 −4 Original line number Diff line number Diff line Loading @@ -2,12 +2,19 @@ # # Validate syntax and keywords existance in each Robot file cd /home/etsi/dev/robot/ res=0 for i in */*/*.robot ; do [[ "$i" != *"Keywords.robot"* && "$i" != *"Keyword.robot"* ]] && \ (echo "++++ Dryrun $i" && \ robot --dryrun --output NONE --report NONE --log NONE $i || \ (echo "++++ Issues in file $i" && res=1)); if [[ "$i" != *"Keywords.robot"* && "$i" != *"Keyword.robot"* ]] ; then echo "++++ Dryrun file $i" msg=$(robot --dryrun --output NONE --report NONE --log NONE $i 2>&1) if [ $? != 0 ] ; then echo "++++ Issues found in file $i" echo "$msg" res=1 fi fi done exit $res