Commit 57d00866 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Changing the name of the published file

parent d11c8051
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -78,13 +78,15 @@ Publish spec:
    - chmod +x publish_spec.sh
    - |
     curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/Spec-template%2Edocx/raw?ref=master" >> onem2m_spec_template.docx
    - |
     export SPEC_NAME=$(ls | grep *.md | cut -d'.' -f1)
  script:
    - echo 'Publishing spec'
    - ./publish_spec.sh ${CI_PROJECT_URL} ${CI_COMMIT_TAG} onem2m_spec_template.docx
    - ./publish_spec.sh ${CI_PROJECT_URL} ${CI_COMMIT_TAG} onem2m_spec_template.docx $SPEC_NAME
  artifacts:
    name: "${CI_PROJECT_NAME}_${CI_COMMIT_TAG}"
    name: "${SPEC_NAME}_${CI_COMMIT_TAG}"
    paths:
      - "${CI_PROJECT_NAME}_${CI_COMMIT_TAG}.docx"
      - "${SPEC_NAME}_${CI_COMMIT_TAG}.docx"

pages:
  stage: web
@@ -104,9 +106,11 @@ pages:
     curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/updateIndex%2Epy/raw?ref=master" >> updateIndex.py
    - |
     curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/index%2Ehtml/raw?ref=master" >> index.html
    - |
     export SPEC_NAME=$(ls | grep *.md | cut -d'.' -f1)
   script:
    - echo 'Publishing on pages'
    - ./publish_on_pages.sh updateIndex.py $CI_PAGES_URL ${CI_PROJECT_NAME} $TAG_NAME index.html $CLEAN_WEB_PAGES
    - ./publish_on_pages.sh updateIndex.py $CI_PAGES_URL ${CI_PROJECT_NAME} $TAG_NAME index.html $CLEAN_WEB_PAGES $SPEC_NAME
  artifacts:
    paths:
      - public
 No newline at end of file
+3 −3
Original line number Diff line number Diff line
@@ -21,12 +21,12 @@ if [ $6 == 'true' ]; then
elif [ $6 == 'false' ]; then
	mkdir -p "public/$4"
    ls public/
	cp -r -f "$3_$4.docx" public/$4
    docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" pip install bs4 && python3 $1 "$3_$4" "$4/$3_$4.docx" "$5"
	cp -r -f "$7_$4.docx" public/$4
    docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" pip install bs4 && python3 $1 "$7_$4" "$4/$7_$4.docx" "$5"
else
    echo 'Removing entry for ' $6
    rm -r -f public/$6
    docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" pip install bs4 && python3 $1 -re "$3_$6" "$4/$3_$4.docx" "$5"
    docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" pip install bs4 && python3 $1 -re "$7_$6" "$4/$7_$4.docx" "$5"
fi

echo "------ Zip the content and publish the zip again ------"
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ for i in *.md ; do
	echo "\n------ Preparaing spec --------" 
	docker run --rm -v $(pwd):/tmp/ -u $(id -u):$(id -g) "$TOOLS_DOCKER_IMAGE" pandocFilter -o "/tmp/" "/tmp/$i"
	echo "\n------ Publishing spec --------" 
	docker run --rm -v $(pwd):/data -u $(id -u):$(id -g) "$DOCKER_IMAGE" "/data/$i" -f markdown -t docx --reference-doc "/data/${3}" -o "${PROJECT_NAME}_${2}.docx"
	docker run --rm -v $(pwd):/data -u $(id -u):$(id -g) "$DOCKER_IMAGE" "/data/$i" -f markdown -t docx --reference-doc "/data/${3}" -o "${4}_${2}.docx"
done