Skip to content

Commit 04e76bc

Browse files
committed
Update scripts
1 parent d761fce commit 04e76bc

11 files changed

+67
-47
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
22
dist
3+
tmp

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ Note that the dashboard will still rely on the RDF in this repository.
171171
- Some example values for `urls.env` are
172172

173173
```yaml
174-
AP=https://data.vlaanderen.be/doc/applicatieprofiel/leermiddelen/ontwerpstandaard/2025-03-21/
175-
SHACL=https://data.vlaanderen.be/doc/applicatieprofiel/leermiddelen/kandidaatstandaard/2025-08-01/shacl/leermiddelen-SHACL.ttl
174+
AP_URL=https://data.vlaanderen.be/doc/applicatieprofiel/leermiddelen/ontwerpstandaard/2025-03-21/
175+
SHACL_URL=https://data.vlaanderen.be/doc/applicatieprofiel/leermiddelen/kandidaatstandaard/2025-08-01/shacl/leermiddelen-SHACL.ttl
176176
```
177177

178178
- You can run the pipeline locally via

scripts/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Scripts
2+
3+
- `run-pipeline-locally.sh`: this script runs the pipeline locally.
4+
- `set-up-repo.sh`: this script sets up the repo, including downloading the SHACL file, generating a template Excel file,
5+
and generating example data.
6+
- `generate-rdf-build-miravi-locally.sh`: this script generates the RDF and builds Miravi locally.
7+
It relies on the `generate-rdf-build-miravi.sh`.

scripts/clone-ap-data-to-dashboard.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ if [ -d "$DIRECTORY" ]; then
66
echo "Folder $DIRECTORY already exists, so no cloning"
77
else
88
echo "Cloning ap-data-to-dashboard"
9-
git clone --depth 1 https://github.com/RMLio/ap-data-to-dashboard.git $DIRECTORY
9+
git clone --depth 1 https://github.com/RMLio/ap-data-to-dashboard.git $DIRECTORY &> /dev/null
1010
fi
1111

scripts/copy-dashboard-config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
DIRECTORY=dashboard-config
3+
DIRECTORY="../dashboard-config"
44

55
if [ -d "$DIRECTORY" ]; then
66
echo "$DIRECTORY exists."

scripts/generate-rdf-build-miravi-locally.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env bash
22

3-
WORKDIR="dist"
3+
OUTPUT_DIR="dist"
44
BASE_URL="http://localhost:5500"
55

66
if compgen -G "data/*.xlsx" > /dev/null; then
77
./scripts/generate-rdf-build-miravi.sh $BASE_URL
88

9-
echo "1. Host RDF files via \"npx http-server $WORKDIR/output -p 5500 --cors true\""
10-
echo "2. Host Miravi via \"npx http-server $WORKDIR/docs -p 8080\""
9+
echo "1. Host RDF files via \"npx http-server $OUTPUT_DIR/output -p 5500 --cors true\""
10+
echo "2. Host Miravi via \"npx http-server $OUTPUT_DIR/docs -p 8080\""
1111
echo "3. Browse to http://localhost:8080"
1212
else
1313
echo "No Excel files found in the data folder."
Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,46 @@
11
#!/usr/bin/env bash
22

3-
WORKDIR="dist"
3+
SCRIPTS_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
4+
ROOT_DIR=`pwd`
5+
WORK_DIR=$ROOT_DIR"/tmp"
6+
OUTPUT_DIR=$ROOT_DIR/"dist"
47
BASE_URL=$1
58

6-
rm -rf $WORKDIR
7-
mkdir $WORKDIR
9+
mkdir -p $WORK_DIR
10+
rm -rf $OUTPUT_DIR
11+
mkdir $OUTPUT_DIR
812

9-
cd $WORKDIR
10-
11-
echo "Cloning ap-data-to-dashboard"
12-
git clone --revision=2bb5bd334f8d708d1e337eb7c4a9251856c636d1 --depth 1 https://github.com/RMLio/ap-data-to-dashboard.git ap-data-to-dashboard
13+
cd $WORK_DIR
14+
$SCRIPTS_DIR/clone-ap-data-to-dashboard.sh || exit 1
1315
rm -rf ap-data-to-dashboard/in
1416
mkdir ap-data-to-dashboard/in
1517

1618
echo "Copying ../data/* to ap-data-to-dashboard/in"
17-
cp ../data/* ap-data-to-dashboard/in
19+
cp $ROOT_DIR/data/* ap-data-to-dashboard/in
1820

1921
echo "Copying ../in-shacl/* to ap-data-to-dashboard/in-shacl"
20-
cp ../in-shacl/* ap-data-to-dashboard/in-shacl
22+
cp $ROOT_DIR/in-shacl/* ap-data-to-dashboard/in-shacl
2123

2224
echo "Installing ap-data-to-dashboard"
23-
cd ap-data-to-dashboard
24-
npm i
25-
npm run setup
26-
cd ..
25+
$SCRIPTS_DIR/install-ap-data-to-dashboard.sh
2726

2827
echo "Copying dashboard config"
29-
rm -rf ap-data-to-dashboard/miravi-initial-config
30-
mkdir ap-data-to-dashboard/miravi-initial-config
31-
cp -r ../dashboard-config/* ap-data-to-dashboard/miravi-initial-config
28+
$SCRIPTS_DIR/copy-dashboard-config.sh
3229

3330
echo "Running ap-data-to-dashboard"
3431
cd ap-data-to-dashboard
3532
./run.sh -u $BASE_URL
36-
cd ..
33+
cd $OUTPUT_DIR
3734

3835
echo "Moving Miravi dist to docs"
3936
rm -rf docs && mkdir docs
40-
mv ap-data-to-dashboard/node_modules/miravi/main/dist/* docs
37+
mv $WORK_DIR/ap-data-to-dashboard/node_modules/miravi/main/dist/* docs
4138

4239
echo "Moving RDF and mappings"
4340
rm -rf output
4441
mkdir output
4542
rm -rf mappings
4643
mkdir mappings
47-
mv ap-data-to-dashboard/out/serve-me/* output/
48-
mv ap-data-to-dashboard/out/*.rml.ttl mappings/
49-
mv ap-data-to-dashboard/out/*.yml mappings/
44+
mv $WORK_DIR/ap-data-to-dashboard/out/serve-me/* output/
45+
mv $WORK_DIR/ap-data-to-dashboard/out/*.rml.ttl mappings/
46+
mv $WORK_DIR/ap-data-to-dashboard/out/*.yml mappings/
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
#!/usr/bin/env bash
22

3+
TEST_FILE="install-setup-done"
4+
35
cd ap-data-to-dashboard
4-
npm i
5-
npm run setup
6+
7+
if [ -f "$TEST_FILE" ]; then
8+
echo "Installation and setup already done"
9+
else
10+
npm i &> /dev/null
11+
npm run setup &> /dev/null
12+
touch $TEST_FILE
13+
fi
14+
15+
cd ..

scripts/reset-repo.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ rm -rf example-data \
99
data \
1010
output \
1111
template.xlsx \
12-
dist
12+
dist \
13+
tmp
1314

1415
mkdir data
1516
touch data/.gitkeep

scripts/run-pipeline-locally.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/usr/bin/env bash
22

3+
SCRIPTS_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
4+
35
echo "Setting up repo"
4-
./scripts/set-up-repo.sh || exit 1
6+
$SCRIPTS_DIR/set-up-repo.sh || exit 1
57

68
echo "Generating RDF and building Miravi"
7-
./scripts/generate-rdf-build-miravi-locally.sh || exit 1
9+
$SCRIPTS_DIR/generate-rdf-build-miravi-locally.sh || exit 1
810

0 commit comments

Comments
 (0)