Skip to content

Commit

Permalink
fixes paths inside zip
Browse files Browse the repository at this point in the history
  • Loading branch information
jerouris committed Sep 19, 2024
1 parent 011a9ea commit c601690
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 4 deletions.
40 changes: 40 additions & 0 deletions build-actions.sh
Original file line number Diff line number Diff line change
@@ -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
11 changes: 7 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c601690

Please sign in to comment.