Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024 q4 dev #114

Merged
merged 9 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading