Skip to content

Commit fe4fb00

Browse files
committed
combine shape related repos
1 parent 8beea22 commit fe4fb00

File tree

124 files changed

+8502
-96
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+8502
-96
lines changed

.github/workflows/ci_catalog.yaml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Continuous Integration GXFS Catalog
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
tags:
8+
- "*"
9+
10+
jobs:
11+
build-and-push:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Image tag
23+
shell: bash {0}
24+
run: |
25+
tag="$(awk -F '=' '/SERVICE_VERSION/{ print $2; exit; }' Dockerfile)"
26+
echo "tag=$tag" >> $GITHUB_ENV
27+
28+
- name: Repo environment variable
29+
run: echo "repository=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
30+
31+
- name: Set up QEMU
32+
uses: docker/setup-qemu-action@v2
33+
34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v2
36+
37+
- name: Login to GitHub Container Registry
38+
uses: docker/login-action@v2
39+
with:
40+
registry: ghcr.io
41+
username: ${{ github.actor }}
42+
password: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: Build and push
45+
uses: docker/build-push-action@v4
46+
with:
47+
file: gxfs-catalog/Dockerfile
48+
push: true
49+
tags: ghcr.io/${{ env.repository }}:${{ env.tag }},ghcr.io/${{ env.repository }}:latest
50+
51+
- name: Dispatch update
52+
run: |
53+
curl -H "Accept: application/vnd.github+json" \
54+
-H "Authorization: token ${{ secrets.GIT_OPS_TOKEN }}" \
55+
--request POST \
56+
--data '{"event_type": "image_update", "client_payload": { "environment": "*", "tag": "${{ env.tag }}", "key": ".image.tag", "app": "gxfs-catalog" }}' https://api.github.com/repos/merlot-education/gitops/dispatches

.github/workflows/ci_wizard.yaml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Continuous Integration Wizard API
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
tags:
8+
- "*"
9+
10+
jobs:
11+
build-and-push:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Demo image tag
23+
if: startsWith(github.ref, 'refs/tags/')
24+
shell: bash {0}
25+
run: |
26+
tag=$(git describe --tags HEAD)
27+
echo "tag=$tag" >> $GITHUB_ENV
28+
echo "environment=demo" >> $GITHUB_ENV
29+
30+
- name: Dev image tag
31+
if: startsWith(github.ref, 'refs/heads/')
32+
shell: bash {0}
33+
run: |
34+
tag="$(git rev-parse --short HEAD)"
35+
echo "tag=$tag" >> $GITHUB_ENV
36+
echo "environment=dev" >> $GITHUB_ENV
37+
38+
- name: Repo environment variable
39+
run: echo "repository=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
40+
41+
- name: Set up QEMU
42+
uses: docker/setup-qemu-action@v2
43+
44+
- name: Set up Docker Buildx
45+
uses: docker/setup-buildx-action@v2
46+
47+
- name: Login to GitHub Container Registry
48+
uses: docker/login-action@v2
49+
with:
50+
registry: ghcr.io
51+
username: ${{ github.actor }}
52+
password: ${{ secrets.GITHUB_TOKEN }}
53+
54+
- name: Build and push
55+
uses: docker/build-push-action@v4
56+
with:
57+
file: sd-creation-wizard-api/Dockerfile
58+
push: true
59+
tags: ghcr.io/${{ env.repository }}:${{ env.tag }},ghcr.io/${{ env.repository }}:latest
60+
61+
- name: Dispatch update
62+
run: |
63+
curl -H "Accept: application/vnd.github+json" \
64+
-H "Authorization: token ${{ secrets.GIT_OPS_TOKEN }}" \
65+
--request POST \
66+
--data '{"event_type": "image_update", "client_payload": { "environment": "${{ env.environment }}", "tag": "${{ env.tag }}", "key": ".image.tag", "app": "creation-wizard-api" }}' https://api.github.com/repos/merlot-education/gitops/dispatches

.github/workflows/release.yaml

-35
This file was deleted.

catalog-shapes/merge_shapes.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import os
2+
import rdflib
3+
4+
shape_base_folder = os.path.join(os.path.dirname(__file__), "shacl/shapes/")
5+
shape_output_path = os.path.join(shape_base_folder, "mergedShapes.ttl")
6+
7+
graph = rdflib.Graph()
8+
9+
for root, _, files in os.walk(shape_base_folder, topdown=False):
10+
for name in files:
11+
file_path = os.path.join(root, name)
12+
if file_path == shape_output_path:
13+
continue
14+
print(file_path)
15+
with open(file_path, "r") as f:
16+
try:
17+
graph.parse(file_path, format='ttl')
18+
except Exception as e:
19+
raise Exception("An error occurred while parsing " + str(file_path) + ": " + str(e))
20+
21+
graph.serialize(shape_output_path, format='ttl')

0 commit comments

Comments
 (0)