Skip to content

Commit

Permalink
Merge pull request #270 from sasjonge/master
Browse files Browse the repository at this point in the history
Fixed Ontometrics call by moving to a POST call
  • Loading branch information
daniel86 authored Jul 26, 2022
2 parents b43026d + 3779410 commit 386d725
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 21 deletions.
40 changes: 31 additions & 9 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,6 @@ jobs:

- name: Copy all OWL files to be deployed
run: sudo cp -n ./owl/*.owl $GITHUB_WORKSPACE/build/owl/current

# - name: Metrics
# run: sudo ./scripts/OntoMetrics.sh $GITHUB_WORKSPACE/build/owl/current/SOMA.owl $GITHUB_WORKSPACE/build/files

# - name: Upload Metrics
# uses: actions/upload-artifact@v1
# with:
# name: Metrics
# path: ./build/files/metrics.json

- name: Compile NEEM Handbook
uses: docker://blang/latex:ubuntu
Expand Down Expand Up @@ -114,6 +105,37 @@ jobs:
#TARGET_FOLDER: owl/${{ GITHUB_REF/refs\/tags\// }}
#TARGET_FOLDER: owl/${{ GITHUB_REF#refs/tags/ }}

# Metrics have to be created after the deployment step, because
# OntoMetrics only allows POST with an URI at the moment
- name: Metrics
if: github.ref == 'refs/heads/master'
run: |
sudo ./scripts/OntoMetrics.sh \
https://raw.githubusercontent.com/ease-crc/soma/gh-pages/owl/current/SOMA.owl \
$GITHUB_WORKSPACE/build/files
- name: Metrics
if: startsWith(github.ref, 'refs/tags/')
run: |
sudo ./scripts/OntoMetrics.sh \
https://raw.githubusercontent.com/ease-crc/soma/gh-pages/owl/${{ github.event.release.tag_name }}/SOMA.owl \
$GITHUB_WORKSPACE/build/files
- name: Upload Metrics
uses: actions/upload-artifact@v1
with:
name: Metrics
path: ./build/files/metrics.json

- name: Deploy files current
uses: JamesIves/github-pages-deploy-action@releases/v3
if: github.ref == 'refs/heads/master'
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: build/files
TARGET_FOLDER: /files/current

- name: Deploy files tag
uses: JamesIves/github-pages-deploy-action@releases/v3
if: startsWith(github.ref, 'refs/tags/')
Expand Down
15 changes: 3 additions & 12 deletions scripts/OntoMetrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,13 @@ BASEDIR=$(dirname "$0")
# The local OWL file
OWL_FILE="$1"
# The server URL
HOST="http://opi.informatik.uni-rostock.de/api"
HOST="http://opi.informatik.uni-rostock.de/api?url"

echo "${BASEDIR}"

# the web-service return HTML with a link to XML data
echo "fetching result from https://ontometrics.informatik.uni-rostock.de"
echo "@${OWL_FILE}"
curl ${HOST} \
-H 'Server: Apache/2.4.38 (Debian)' \
-H 'saved: true' \
-H 'Content-Type: application/xml' \
-H 'Vary: Accept-Encoding' \
-H 'Content-Encoding: gzip' \
-H 'Keep-Alive: timeout=5, max=100' \
-H 'Connection: keep-alive' \
--data "@${OWL_FILE}" > $2/metrics.xml
echo "fetching result from ${HOST}=${OWL_FILE}"
curl ${HOST}=${OWL_FILE} > $2/metrics.xml

# convert to JSON
echo "writing metrics.json"
Expand Down

0 comments on commit 386d725

Please sign in to comment.