-
Notifications
You must be signed in to change notification settings - Fork 20
/
build-actions.sh
executable file
·40 lines (29 loc) · 1.31 KB
/
build-actions.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
#!/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
sudo rm -rf $PROJECT/target/site/files/PEPPOLBIS-Upgrade-Schematron.zip
sudo rm -rf $PROJECT/target/site/files/PEPPOLBIS-Examples.zip
cd $PROJECT/target
sudo zip -r site/files/PEPPOLBIS-Upgrade-Schematron.zip schematron/
cd $PROJECT
sudo 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