Commit 979ecb0f authored by Stephan Botta's avatar Stephan Botta
Browse files

Update pre-script.sh

parent 87888f7e
Pipeline #19054 passed with stages
in 1 minute and 13 seconds
......@@ -5,10 +5,24 @@ for file in $(ls -v ./docs-en/modules/ROOT/pages/ -l | grep '^-' | awk '{print $
export first=$(ls -v docs-de/modules/ROOT/pages/|head -n 1)
export first_en=$(ls -v docs-en/modules/ROOT/pages/|head -n 1)
export datetime=$(date -D "$CI_COMMIT_TIMESTAMP" +"%d.%m.%Y %H:%M %Z")
curl --header "PRIVATE-TOKEN: nKzM4vPYMS3UHyM62azT" "https://gitlab.desy.de/api/v4/projects/1958/repository/commits/main" >tmp.txt
export commit_version=$(awk -F "short_id" '{print $2}' tmp.txt | awk -F ":" '{print $2}' | awk -F "," '{ gsub(/"/,"" ); print $1}')
curl --header "PRIVATE-TOKEN: nKzM4vPYMS3UHyM62azT" "https://gitlab.desy.de/api/v4/projects/1958/repository/tags" >tmp2.txt
export tagname=$(awk -F "name" '{print $2}' tmp2.txt | awk -F ":" '{print $2}' | awk -F "," '{ gsub(/"/,"" ); print $1}')
export tagcommitid=$(awk -F "short_id" '{print $2}' tmp2.txt | awk -F ":" '{print $2}' | awk -F "," '{ gsub(/"/,"" ); print $1}')
if [ "$commit_version" = "$tagcommitid" ];
then
rev=$tagname
else
rev=$commit_version
fi
sed -i "/^\([[:space:]]*start_page: \).*/s//\1Enci_Dokumentation::$first/" antora-playbook.yml
sed -i "/^\([[:space:]]*page-commitreference: \).*/s//\1$CI_COMMIT_SHORT_SHA/" antora-playbook.yml
sed -i "/^\([[:space:]]*page-commitreference: \).*/s//\1$rev/" antora-playbook.yml
sed -i "/^\([[:space:]]*page-commitdate: \).*/s//\1$datetime/" antora-playbook.yml
sed -i "/^\([[:space:]]*page-tag: \).*/s//\1$CI_COMMIT_TAG/" antora-playbook.yml
cat antora-playbook.yml
sed -i "/^\([[:space:]]*start_page: \).*/s//\1$first/" ./docs-de/antora.yml
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment