-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.bat
38 lines (28 loc) · 1.63 KB
/
build.bat
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
@echo off
setlocal
:: Get the directory of the script
set "PROJECT=%~dp0"
set "PROJECT=%PROJECT:~0,-1%" :: Remove trailing backslash if any
:: Delete target folder if found
if exist "%PROJECT%\target" (
docker run --rm -i -v "%PROJECT%:/src" alpine:3.6 rm -rf /src/target
)
:: 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 %%s in ("%PROJECT%\rules\sch\*.sch") do (
docker run --rm -i -v "%PROJECT%:/src" -v "%PROJECT%\target\schematron:/target" klakegg/schematron prepare /src/rules/sch/%%~nxs /target/%%~nxs
)
docker run --rm -i -v "%PROJECT%\target\site\files:/src" alpine:3.6 rm -rf /src/PEPPOLBIS-Upgrade-Schematron.zip
docker run --rm -i -v "%PROJECT%\target\schematron:/src" -v "%PROJECT%\target\site\files:/target" -w /src kramos/alpine-zip -r /target/PEPPOLBIS-Upgrade-Schematron.zip .
:: Example files
docker run --rm -i -v "%PROJECT%\target\site\files:/src" alpine:3.6 rm -rf /src/PEPPOLBIS-Examples.zip
docker run --rm -i -v "%PROJECT%\rules\examples:/src" -v "%PROJECT%\target\site\files:/target" -w /src kramos/alpine-zip -r /target/PEPPOLBIS-Examples.zip .
:: Guides
docker run --rm -i -v "%PROJECT%:/documents" -v "%PROJECT%\target:/target" difi/asciidoctor
:: Fix ownership (Windows doesn't use the same concept of user/group ownership, so this part is usually not necessary)
:: You can skip this part or just leave it for Unix-like environments using Docker.
endlocal
pause