Skip to content
Open
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
3 changes: 0 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
JAVA_VERSION=17.0.6+10
JRUBY_VERSION=9.3.9.0
HUGO_VERSION=0.110.0
SCHEMATRON_VERSION=2020-10-01
SCHUNIT_VERSION=0.4.0
31 changes: 7 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
PATH=$(shell pwd)/src/bin:$(shell echo $$PATH)
include .env
export
export

default: clean linux macos win
default: clean build

clean:
@rm -rf target
@rm -rf target tmp

linux: linux-amd64 linux-arm64

linux-amd64:
@fetch linux-amd64 linux nix
@package-tar linux-amd64

linux-arm64:
@fetch linux-arm64 linux nix
@package-tar linux-arm64

macos: macos-amd64

macos-amd64:
@fetch macos-amd64 macos nix
@package-tar macos-amd64

win: win-amd64

win-amd64:
@fetch win-amd64 win
@package-zip win-amd64
build:
@$(CURDIR)/src/bin/fetch
@$(CURDIR)/src/bin/package-tar
@$(CURDIR)/src/bin/package-zip
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
# PDK Environment

[![Version](https://img.shields.io/github/v/release/OpenPeppol/pdk-environment)](https://github.com/OpenPEPPOL/pdk-environment/releases)


This project prepares a bundle of software as an environment for running Peppol Development Kit (PDK).

The bundle consists of:

* [AdoptOpenJDK](https://adoptopenjdk.net/)
* [JRuby](https://www.jruby.org/)
* [Schematron](https://schematron.com/) (skeleton implementation)
* [SchUnit](https://schunit.com/)
* [Saxon](https://www.saxonica.com/) (home edition)
* [Hugo](https://gohugo.io/) (standard edition)


## Changelog

### V1.4.0
* Removed java, hugo and jruby, as they are
now part of the docker build.
* The releases are now platform independent.
* Made the scripts platform independent so that they can be also run locally on macOS


### V1.3.0

* updated schunit to 0.4.0

### V1.2.0

* updated windows hugo script
* updated environments
* Hugo version 0.110.0

15 changes: 13 additions & 2 deletions src/bin/_project
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#!/bin/sh
#!/bin/bash

echo -n $(dirname $(dirname $(dirname "$0")))
# Resolve the path to this script (even if invoked via PATH).
SCRIPT="$0"
case "$SCRIPT" in
/*) : ;; # absolute
*) SCRIPT="$(command -v -- "$SCRIPT")" ;;# found via PATH
esac

# Go up three levels from src/bin/_project → repo root
ROOT_DIR=$(cd "$(dirname "$SCRIPT")/../.." && pwd)

# Print it with a newline (portable)
printf '%s\n' "$ROOT_DIR"
28 changes: 11 additions & 17 deletions src/bin/fetch
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/bin/sh
#!/usr/bin/env bash
set -euo pipefail

# Variables to be used by fetchers
PROJECT=$(_project)
TARGET=$PROJECT/target
TMP=$PROJECT/tmp
DIST=$TARGET/dist/$1
PROJECT="$(_project)"
TARGET="$PROJECT/target"
TMP="$PROJECT/tmp"
DIST="$TARGET/dist/${1:-}"

# Create inital folders
mkdir -p $TARGET $TMP
mkdir -p "$TARGET" "$TMP"

# Function: download [filename] [url]
download() {
Expand All @@ -19,13 +18,8 @@ download() {
}

# Run fetchers
for arch in $@ common; do
if [ -e $PROJECT/src/fetcher/$arch ] && [ $(find $PROJECT/src/fetcher/$arch -name *.sh | wc -l) != "0" ]; then
for fetcher in $(ls $PROJECT/src/fetcher/$arch/*.sh); do
name=$(echo $fetcher | sed 's:\.sh$::')

echo "* Running $name"
. $fetcher
done
fi
for script in "$PROJECT/src/fetcher"/*.sh; do
[ -e "$script" ] || continue # nullglob guard (POSIX-compatible)
echo "* Running $script"
. "$script" # use `sh "$script"` if you don't need to source
done
4 changes: 2 additions & 2 deletions src/bin/package-tar
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -u

PROJECT=$(_project)
TARGET=$PROJECT/target
DIST=$1
DIST="pdk-environment"

echo "* Package $DIST"

Expand All @@ -14,7 +14,7 @@ mkdir -p $TARGET/pkg
test -e $TARGET/pkg/$DIST.tar.gz && rm -rf $TARGET/pkg/$DIST.tar.gz

# Create tar
cd $PROJECT/target/dist/$DIST
cd $PROJECT/target/dist/
tar rf $TARGET/pkg/$DIST.tar *

# Compress tar
Expand Down
4 changes: 2 additions & 2 deletions src/bin/package-zip
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -u

PROJECT=$(_project)
TARGET=$PROJECT/target
DIST=$1
DIST="pdk-environment"

echo "* Package $DIST"

Expand All @@ -14,5 +14,5 @@ mkdir -p $TARGET/pkg
test -e $TARGET/pkg/$DIST.zip && rm -rf $TARGET/pkg/$DIST.zip

# Create zip
cd $PROJECT/target/dist/$DIST
cd $PROJECT/target/dist/
zip -q9r $TARGET/pkg/$DIST.zip *
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

set -e
set -u
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ download saxon-$VERSION.zip \
https://deac-ams.dl.sourceforge.net/project/saxon/Saxon-HE/9.9/SaxonHE${VERSION}J.zip

# Unzip content
unzip -qo $TMP/saxon-$VERSION.zip -d $DIST/lib/saxon
unzip -qo $TMP/saxon-$VERSION.zip -d $DIST/lib/saxon
19 changes: 0 additions & 19 deletions src/fetcher/common/200-jruby.sh

This file was deleted.

17 changes: 0 additions & 17 deletions src/fetcher/linux-amd64/100-java.sh

This file was deleted.

17 changes: 0 additions & 17 deletions src/fetcher/linux-amd64/600-hugo.sh

This file was deleted.

17 changes: 0 additions & 17 deletions src/fetcher/linux-arm64/100-java.sh

This file was deleted.

17 changes: 0 additions & 17 deletions src/fetcher/linux-arm64/600-hugo.sh

This file was deleted.

18 changes: 0 additions & 18 deletions src/fetcher/macos-amd64/100-java.sh

This file was deleted.

15 changes: 0 additions & 15 deletions src/fetcher/macos-amd64/600-hugo.sh

This file was deleted.

19 changes: 0 additions & 19 deletions src/fetcher/win-amd64/100-java.sh

This file was deleted.

15 changes: 0 additions & 15 deletions src/fetcher/win-amd64/600-hugo.sh

This file was deleted.