Commit 7a58135a authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Use the specification uploaded in commit triggering this pipeline

parent 61ee461f
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -10,13 +10,14 @@ DOC2OAS_DOCKER_IMAGE=doc2oas-ie-sample:master
# Get version from spec file name in root doc directory
cd doc

spec=$(ls | grep 'docx')
if [ -z $spec ] ; then 
    echo "-- No spec file"
# Get the pushed .docx file from the Git commit
spec=$(basename $(git diff --name-only HEAD^ HEAD | grep '\.docx$'))
if [ -z "$spec" ]; then 
    echo "-- No spec file found in the latest commit"
    exit 0
fi

version=$(ls | grep -e v[0-9]* -o)
version=$(echo "$spec" | grep -e v[0-9]* -o)
if [ -z "$version" ]; then
    echo "No version found in spec filename"
    exit 1