Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
Pipeline #396 failed
...@@ -78,13 +78,15 @@ Publish spec: ...@@ -78,13 +78,15 @@ Publish spec:
- chmod +x publish_spec.sh - 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 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: script:
- echo 'Publishing spec' - 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: artifacts:
name: "${CI_PROJECT_NAME}_${CI_COMMIT_TAG}" name: "${SPEC_NAME}_${CI_COMMIT_TAG}"
paths: paths:
- "${CI_PROJECT_NAME}_${CI_COMMIT_TAG}.docx" - "${SPEC_NAME}_${CI_COMMIT_TAG}.docx"
pages: pages:
stage: web stage: web
...@@ -104,9 +106,11 @@ pages: ...@@ -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/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 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: script:
- echo 'Publishing on pages' - 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: artifacts:
paths: paths:
- public - public
\ No newline at end of file
...@@ -21,12 +21,12 @@ if [ $6 == 'true' ]; then ...@@ -21,12 +21,12 @@ if [ $6 == 'true' ]; then
elif [ $6 == 'false' ]; then elif [ $6 == 'false' ]; then
mkdir -p "public/$4" mkdir -p "public/$4"
ls public/ ls public/
cp -r -f "$3_$4.docx" public/$4 cp -r -f "$7_$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" docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" pip install bs4 && python3 $1 "$7_$4" "$4/$7_$4.docx" "$5"
else else
echo 'Removing entry for ' $6 echo 'Removing entry for ' $6
rm -r -f public/$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 fi
echo "------ Zip the content and publish the zip again ------" echo "------ Zip the content and publish the zip again ------"
......
...@@ -30,7 +30,7 @@ for i in *.md ; do ...@@ -30,7 +30,7 @@ for i in *.md ; do
echo "\n------ Preparaing spec --------" echo "\n------ Preparaing spec --------"
docker run --rm -v $(pwd):/tmp/ -u $(id -u):$(id -g) "$TOOLS_DOCKER_IMAGE" pandocFilter -o "/tmp/" "/tmp/$i" docker run --rm -v $(pwd):/tmp/ -u $(id -u):$(id -g) "$TOOLS_DOCKER_IMAGE" pandocFilter -o "/tmp/" "/tmp/$i"
echo "\n------ Publishing spec --------" 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 done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment