-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'THR-35-library-management-service' of ssh://github.com/…
…hpi-schul-cloud/schulcloud-server into THR-35-library-management-service
- Loading branch information
Showing
1,314 changed files
with
25,529 additions
and
60,998 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ on: | |
branches-ignore: | ||
- dependabot/** | ||
pull_request: | ||
types: [ labeled ] | ||
types: [labeled] | ||
|
||
permissions: | ||
contents: read | ||
|
@@ -32,14 +32,6 @@ jobs: | |
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Docker meta Service Name | ||
id: docker_meta_img | ||
uses: crazy-max/ghaction-docker-meta@v4 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
tags: | | ||
type=ref,event=branch,enable=false,priority=600 | ||
type=sha,enable=true,priority=600,prefix= | ||
|
||
- name: Login to registry | ||
uses: docker/login-action@v2 | ||
|
@@ -48,10 +40,17 @@ jobs: | |
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Docker meta Service Name | ||
id: docker_meta_img | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
tags: | | ||
type=ref,event=branch,enable=false,priority=600 | ||
type=sha,enable=true,priority=600,prefix= | ||
- name: test image exists | ||
run: | | ||
mkdir -p ~/.docker | ||
echo '{"experimental": "enabled"}' >> ~/.docker/config.json | ||
echo "IMAGE_EXISTS=$(docker manifest inspect ghcr.io/${{ github.repository }}:${{ needs.branch_meta.outputs.sha }} > /dev/null && echo 1 || echo 0)" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
|
@@ -69,6 +68,49 @@ jobs: | |
tags: ghcr.io/${{ github.repository }}:${{ needs.branch_meta.outputs.sha }} | ||
labels: ${{ steps.docker_meta_img.outputs.labels }} | ||
|
||
- name: Docker meta Service Name (file storage) | ||
id: docker_meta_img_file_storage | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
tags: | | ||
type=ref,event=branch,enable=false,priority=600,prefix=file-storage- | ||
type=sha,enable=true,priority=600,prefix=file-storage- | ||
labels: | | ||
org.opencontainers.image.title=schulcloud-file-storage | ||
- name: test image exists (file storage) | ||
run: | | ||
echo "IMAGE_EXISTS=$(docker manifest inspect ghcr.io/${{ github.repository }}:file-storage-${{ needs.branch_meta.outputs.sha }} > /dev/null && echo 1 || echo 0)" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx (file storage) | ||
if: ${{ env.IMAGE_EXISTS == 0 }} | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build and push ${{ github.repository }} (file storage) | ||
if: ${{ env.IMAGE_EXISTS == 0 }} | ||
uses: docker/build-push-action@v4 | ||
with: | ||
build-args: | | ||
BASE_IMAGE=ghcr.io/${{ github.repository }}:${{ needs.branch_meta.outputs.sha }} | ||
context: . | ||
file: ./Dockerfile.filestorage | ||
platforms: linux/amd64 | ||
push: true | ||
tags: ghcr.io/${{ github.repository }}:file-storage-${{ needs.branch_meta.outputs.sha }} | ||
labels: | | ||
${{ steps.docker_meta_img_file_storage.outputs.labels }} | ||
- name: Send Notification to Rocket Chat if docker image build failed | ||
if: ${{ failure() && github.ref == 'refs/heads/main' }} | ||
uses: RocketChat/[email protected] | ||
with: | ||
type: ${{ job.status }} | ||
job_name: 'docker image build from ${{ github.repository }} triggered from branch ${{ github.ref_name }}:' | ||
url: ${{ secrets.RC_MAIN_BROKEN_TOKEN }} | ||
channel: '#softwaredevelopment-teams-and-groups' | ||
username: Autodeployment Info | ||
|
||
branch_meta: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
|
@@ -87,7 +129,6 @@ jobs: | |
echo "sha=${{ github.sha }}" >> $GITHUB_OUTPUT | ||
fi | ||
deploy: | ||
needs: | ||
- build_and_push | ||
|
@@ -147,12 +188,12 @@ jobs: | |
uses: hpi-schul-cloud/e2e-system-tests/.github/workflows/remote-trigger.yml@main | ||
with: | ||
ref: ${{ needs.branch_meta.outputs.branch }} | ||
secrets: inherit | ||
|
||
secrets: | ||
service-account-token: ${{ secrets.CYPRESS_ONEPWD_SERVICE_ACCOUNT_TOKEN }} | ||
|
||
test-successful: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- end-to-end-tests | ||
steps: | ||
- run: echo "Test was successful" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ARG BASE_IMAGE | ||
FROM $BASE_IMAGE | ||
|
||
RUN apk add --no-cache imagemagick |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
galaxy_info: | ||
role_name: h5p-library-management | ||
author: Schul-Cloud Verbund | ||
description: h5p library role for the management of libraries | ||
company: Schul-Cloud Verbund | ||
license: license (AGPLv3) | ||
min_ansible_version: 2.8 | ||
galaxy_tags: [] | ||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- name: H5pLibraryManagement CronJob | ||
when: WITH_H5P_LIBRARY_MANAGEMENT is defined and WITH_H5P_LIBRARY_MANAGEMENT|bool == true | ||
kubernetes.core.k8s: | ||
kubeconfig: ~/.kube/config | ||
namespace: "{{ NAMESPACE }}" | ||
template: api-h5p-library-management-cronjob.yml.j2 |
35 changes: 35 additions & 0 deletions
35
ansible/roles/h5p-library-management/templates/api-h5p-library-management-cronjob.yml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
namespace: {{ NAMESPACE }} | ||
labels: | ||
app: api-library-management-cronjob | ||
name: api-library-management-cronjob | ||
spec: | ||
itemPath: "vaults/{{ ONEPASSWORD_OPERATOR_VAULT }}/items/h5p-library-manager-ionos-s3" | ||
spec: | ||
schedule: "{{ SERVER_H5P_LIBRARY_MANAGEMENT_CRONJOB|default("0 3 * * 3,6", true) }}" | ||
concurrencyPolicy: Forbid | ||
jobTemplate: | ||
spec: | ||
activeDeadlineSeconds: {{ SERVER_H5P_LIBRARY_MANAGEMENT_CRONJOB_TIMEOUT|default("39600", true) }} | ||
template: | ||
spec: | ||
containers: | ||
- name: api-h5p-library-management-cronjob | ||
image: {{ SCHULCLOUD_SERVER_IMAGE }}:{{ SCHULCLOUD_SERVER_IMAGE_TAG }} | ||
envFrom: | ||
- configMapRef: | ||
name: api-configmap | ||
- secretRef: | ||
name: api-secret | ||
command: ['/bin/sh', '-c'] | ||
args: ['npm run nest:start:h5p:library-management'] | ||
resources: | ||
limits: | ||
cpu: {{ API_H5P_LIBRARY_MANAGEMENT_CPU_LIMITS|default("2000m", true) }} | ||
memory: {{ API_H5P_LIBRARY_MANAGEMENT_MEMORY_LIMITS|default("2Gi", true) }} | ||
requests: | ||
cpu: {{ API_H5P_LIBRARY_MANAGEMENT_CPU_REQUESTS|default("100m", true) }} | ||
memory: {{ API_H5P_LIBRARY_MANAGEMENT_MEMORY_REQUESTS|default("150Mi", true) }} | ||
restartPolicy: OnFailure |
32 changes: 0 additions & 32 deletions
32
ansible/roles/library-cron-job/api-library-management-cronjob.yml.j2
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
galaxy_info: | ||
role_name: schulcloud-server-h5p | ||
author: Schul-Cloud Verbund | ||
description: h5p role for the schulcloud-server | ||
company: Schul-Cloud Verbund | ||
license: license (AGPLv3) | ||
min_ansible_version: 2.8 | ||
galaxy_tags: [] | ||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
- name: H5pEditorService | ||
kubernetes.core.k8s: | ||
kubeconfig: ~/.kube/config | ||
namespace: "{{ NAMESPACE }}" | ||
template: api-h5p-svc.yml.j2 | ||
when: WITH_H5P_EDITOR is defined and WITH_H5P_EDITOR|bool | ||
|
||
- name: H5pEditorDeployment | ||
kubernetes.core.k8s: | ||
kubeconfig: ~/.kube/config | ||
namespace: "{{ NAMESPACE }}" | ||
template: api-h5p-deployment.yml.j2 | ||
when: WITH_H5P_EDITOR is defined and WITH_H5P_EDITOR|bool | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.