Commit 2d6ff717 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Split validation and generation of docx in validate.sh

parent b0448e86
Loading
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -9,10 +9,8 @@

workflow:
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
    - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
      when: never
    - if: $CI_COMMIT_BRANCH
    - if: $CI_COMMIT_TAG
    
variables:
  LOGFILE_YANG: "yang-validation.txt"
@@ -21,6 +19,7 @@ variables:

stages:
  - validation
  - generation
  - trigger
        
Validate API Robot Test Suite:
@@ -28,6 +27,15 @@ Validate API Robot Test Suite:
  script:
    - echo 'Validate API Robot Test Suite'
    - docker run -v "$(pwd):/home/etsi/dev/robot" stf583-rf-validation:miguel "bash" -c  "/home/etsi/dev/scripts/validate.sh $CI_COMMIT_BRANCH"
      
Generate API Robot Test Suite docx:
  stage: generation
  only:
    - tags
  script:
    - echo 'Generate API Robot Test Suite docx'
    - tagTargetBranch=$(git branch -a --contains tags/$CI_COMMIT_REF_NAME | tail -n 1)
    - docker run -v "$(pwd):/home/etsi/dev/robot" -u $(id -u):$(id -g) stf583-rf-validation:miguel "bash" -c  "/home/etsi/dev/scripts/generate.sh $tagTargetBranch"
  artifacts:
    when: on_success
    paths:
+24 −0
Original line number Diff line number Diff line
#!/bin/bash
#
# Generate docx document for the Robot test suite

cd /home/etsi/dev/robot/ 

echo "Using git branch $1"

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

if [[ $1 =~ ^(remotes\/){0,1}(origin\/){0,1}([0-9]{1}(\.[0-9]){2}){1}-dev$ || $1 =~ ^(remotes\/){0,1}(origin\/){0,1}([0-9]{1})(\.[0-9]){2,10}$ || $1 =~ ^(remotes\/){0,1}(origin\/){0,1}master$ || $1 =~ ^(remotes\/){0,1}(origin\/){0,1}Release-([0-9]{1})$ ]]; then

	echo "++++ Try to generate docs for branch $1"
	cd /home/etsi/dev/robot2doc/robot2doc

	python3 create_sols.py ../../robot 'local' ../../robot/build
	res2=$?
else res2=0
    echo "++++ Not generating docs for branch $1"
fi

exit $res && $res2
+1 −18
Original line number Diff line number Diff line
@@ -17,21 +17,4 @@ for i in */*/*.robot ; do
    fi
done

echo "Using git branch $1"

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

if [[ $1 =~ ^(origin\/){0,1}([0-9]{1}(\.[0-9]){2}){1}-dev$ || $1 =~ ^(origin\/){0,1}([0-9]{1})(\.[0-9]){2,10}$ || $1 =~ ^(origin\/){0,1}master$ || $1 =~ ^(origin\/){0,1}Release-([0-9]{1})$ ]]; then

	echo "++++ Try to generate docs for branch $1"
	cd /home/etsi/dev/robot2doc/robot2doc

	python3 create_sols.py ../../robot 'local' ../../robot/build
	res2=$?
else res2=0
    echo "++++ Not generating docs for branch $1"
fi

exit $res && $res2
exit $res