From c601690354fe9ae972cba5b4fdc033b47235bc68 Mon Sep 17 00:00:00 2001 From: Jerry Dimitriou Date: Thu, 19 Sep 2024 18:02:01 +0300 Subject: [PATCH] fixes paths inside zip --- build-actions.sh | 40 ++++++++++++++++++++++++++++++++++++++++ build.sh | 11 +++++++---- 2 files changed, 47 insertions(+), 4 deletions(-) create mode 100755 build-actions.sh diff --git a/build-actions.sh b/build-actions.sh new file mode 100755 index 00000000..cfc6b8c8 --- /dev/null +++ b/build-actions.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +PROJECT=$(dirname $(readlink -f "$0")) + +# Delete target folder if found +if [ -e $PROJECT/target ]; then + docker run --rm -i -v $PROJECT:/src alpine:3.6 rm -rf /src/target +fi + +# Structure +docker run --rm -i \ + -v $PROJECT:/src \ + -v $PROJECT/target:/target \ + difi/vefa-structure:0.6.1 + +# Testing validation rules +docker run --rm -i -v $PROJECT:/src anskaffelser/validator:2.1.0 build -x -t -n eu.peppol.poacc.upgrade.v3 -a rules -target target/validator-test /src + +# Schematron +for sch in $PROJECT/rules/sch/*.sch; do + docker run --rm -i -v $PROJECT:/src -v $PROJECT/target/schematron:/target klakegg/schematron prepare /src/rules/sch/$(basename $sch) /target/$(basename $sch) +done + +# Fix ownership +docker run --rm -i -v $PROJECT:/src alpine:3.6 chown -R $(id -g $USER).$(id -g $USER) /src/target + +rm -rf $PROJECT/target/site/files/PEPPOLBIS-Upgrade-Schematron.zip +rm -rf $PROJECT/target/site/files/PEPPOLBIS-Examples.zip + +cd $PROJECT/target +zip -r site/files/PEPPOLBIS-Upgrade-Schematron.zip schematron/ + +cd $PROJECT +zip -r target/site/files/PEPPOLBIS-Examples.zip rules/examples + +# Guides +docker run --rm -i -v $PROJECT:/documents -v $PROJECT/target:/target difi/asciidoctor + +# Fix ownership +docker run --rm -i -v $PROJECT:/src alpine:3.6 chown -R $(id -g $USER).$(id -g $USER) /src/target diff --git a/build.sh b/build.sh index 0c6bddcf..4b8aa2de 100755 --- a/build.sh +++ b/build.sh @@ -24,12 +24,15 @@ done # Fix ownership docker run --rm -i -v $PROJECT:/src alpine:3.6 chown -R $(id -g $USER).$(id -g $USER) /src/target -sudo rm -rf $PROJECT/target/site/files/PEPPOLBIS-Upgrade-Schematron.zip -sudo zip -r $PROJECT/target/site/files/PEPPOLBIS-Upgrade-Schematron.zip target/schematron +rm -rf $PROJECT/target/site/files/PEPPOLBIS-Upgrade-Schematron.zip +rm -rf $PROJECT/target/site/files/PEPPOLBIS-Examples.zip + +cd $PROJECT/target +zip -r site/files/PEPPOLBIS-Upgrade-Schematron.zip schematron/ # Example files -sudo rm -rf $PROJECT/target/site/files/PEPPOLBIS-Examples.zip -sudo zip -r $PROJECT/target/site/files/PEPPOLBIS-Examples.zip $PROJECT/rules/examples +cd $PROJECT +zip -r target/site/files/PEPPOLBIS-Examples.zip rules/examples # Guides docker run --rm -i -v $PROJECT:/documents -v $PROJECT/target:/target difi/asciidoctor