-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.sh
executable file
·41 lines (30 loc) · 1.3 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/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/
# Example files
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