Skip to content

Commit

Permalink
Merge pull request #114 from OpenPEPPOL/2024-q4-dev
Browse files Browse the repository at this point in the history
2024 q4 dev
  • Loading branch information
jerouris authored Sep 19, 2024
2 parents a4b778b + 1890c62 commit 63b8c7d
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-deploy-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Build Spec
run: bash ./build.sh
run: bash ./build-actions.sh

- name: Deploy on S3
env:
Expand Down
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

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
15 changes: 11 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@ docker run --rm -i -v $PROJECT:/src anskaffelser/validator:2.1.0 build -x -t -n
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
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 .

# 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
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 .
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 63b8c7d

Please sign in to comment.