Commit 950a0373 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Enhancement of Jenkins build scripts for:

1) Detection of branch that triggers the build to determine whether or not to generate the .docx documents
2) Check for udpates on the robot2doc tool
3) Removal of precedent existing .docx documents in the workspace before running a new job
parent a5f29b3d
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -9,8 +9,10 @@ cd "$(dirname "$0")"


run_dir="$(pwd)"
run_dir="$(pwd)"


echo "Using git branch $GIT_BRANCH"

bash ./scripts/build-container.sh
bash ./scripts/build-container.sh
bash ./scripts/run-container.sh "${run_dir}"
bash ./scripts/run-container.sh "${run_dir}" "$GIT_BRANCH"


ret=$?
ret=$?
echo "Final validation result: $ret"
echo "Final validation result: $ret"
+2 −0
Original line number Original line Diff line number Diff line
@@ -35,6 +35,8 @@ ADD extensions /home/etsi/dev/robot/extensions


RUN ls /home/etsi/dev/robot
RUN ls /home/etsi/dev/robot


#To avoid to use the cache when new commits are available
ADD "https://forge.etsi.org/rep/api/v4/projects/224/repository/branches/master" /tmp/devalidateCache


RUN DEBIAN_FRONTED=noninteractive \
RUN DEBIAN_FRONTED=noninteractive \
	cd /home/etsi/dev/ \
	cd /home/etsi/dev/ \
+3 −1
Original line number Original line Diff line number Diff line
@@ -7,8 +7,10 @@


mkdir -p build
mkdir -p build


echo "Using git branch $2"

docker run -v "$(pwd)/build:/home/etsi/dev/build" stf583-rf-validation:latest "bash" \
docker run -v "$(pwd)/build:/home/etsi/dev/build" stf583-rf-validation:latest "bash" \
	-c  "/home/etsi/dev/robot/scripts/validate.sh"
	-c  "/home/etsi/dev/robot/scripts/validate.sh $2"


ret=$? 
ret=$? 


+11 −3
Original line number Original line Diff line number Diff line
@@ -17,11 +17,19 @@ for i in */*/*.robot ; do
    fi
    fi
done
done


cd /home/etsi/dev/robot2doc/robot2doc
echo "Using git branch $1"


mkdir -p /home/etsi/dev/build
mkdir -p /home/etsi/dev/build
cd /home/etsi/dev/build
rm -r -v *

if [[ "$1" =~ .*-dev$ || "$1" =~ \d+(\.?\d)+ || "$1" == "master" ]]; then

	cd /home/etsi/dev/robot2doc/robot2doc


	python3 create_sols.py ../../robot 'local' ../../build
	python3 create_sols.py ../../robot 'local' ../../build
	res2=$?
	res2=$?
else res=0
fi


exit $res && $res2
exit $res && $res2