Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/maven/fixes/9.1' into maven/rele…
Browse files Browse the repository at this point in the history
…ase/9.1
  • Loading branch information
metaventis-build committed Aug 2, 2024
2 parents 72a6552 + a13e8af commit 1bfd9b4
Show file tree
Hide file tree
Showing 17 changed files with 410 additions and 67 deletions.
15 changes: 15 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,23 @@ default:
image: maven:3.8.4-jdk-8

stages:
- lint
- deploy

check-helmreadme:
stage: lint
image: node:lts-alpine3.20
script:
- wget -qO- https://github.com/bitnami/readme-generator-for-helm/archive/refs/tags/2.6.1.tar.gz | tar -xz -C /tmp
- ln -s $CI_PROJECT_DIR/archetypes/project/src/main/resources/archetype-resources/deploy/docker/helm/src/main/chart /tmp/deploy
- ln -s $CI_PROJECT_DIR/archetypes/project/src/main/resources/archetype-resources/repository/deploy/docker/helm/src/main/chart /tmp/repository
- cp /tmp/deploy/README.md /tmp/README_deploy.md && cp /tmp/repository/README.md /tmp/README_repository.md
- cd /tmp; npm install ./readme-generator-for-helm-2.6.1; cd readme-generator-for-helm-2.6.1
- ./bin/index.js -v /tmp/deploy/values.yaml -r /tmp/README_deploy.md
- ./bin/index.js -v /tmp/repository/values.yaml -r /tmp/README_repository.md
- diff /tmp/README_deploy.md /tmp/deploy/README.md || (echo "README was not generated before committing." && exit 1)
- diff /tmp/README_repository.md /tmp/repository/README.md || (echo "README was not generated before committing." && exit 1)

deploy:
stage: deploy
rules:
Expand Down
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/bitnami/readme-generator-for-helm
rev: "2.6.1"
hooks:
- id: helm-readme-generator
pass_filenames: false
always_run: true
args: [--readme=archetypes/project/src/main/resources/archetype-resources/deploy/docker/helm/src/main/chart/README.md, --values=archetypes/project/src/main/resources/archetype-resources/deploy/docker/helm/src/main/chart/values.yaml]
- id: helm-readme-generator
pass_filenames: false
always_run: true
args: [--readme=archetypes/project/src/main/resources/archetype-resources/repository/deploy/docker/helm/src/main/chart/README.md, --values=archetypes/project/src/main/resources/archetype-resources/repository/deploy/docker/helm/src/main/chart/values.yaml]
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ ARG project_version=dev
########################################################################################################################

# TODO default value substituion doesn't work because of the '.' delimiter
LABEL git.branch=${git_branch}
LABEL git.closest.tag.name=${git_closest_tag_fixed}
LABEL git.commit.id=${git_commit_id}
LABEL git.dirty=${git_dirty}
LABEL mvn.project.artifactId=${project_artifactId}
LABEL mvn.project.groupId=${project_groupId}
LABEL mvn.project.version=${project_version}
LABEL git.branch=${git_branch} \
git.closest.tag.name=${git_closest_tag_fixed} \
git.commit.id=${git_commit_id} \
git.dirty=${git_dirty} \
mvn.project.artifactId=${project_artifactId} \
mvn.project.groupId=${project_groupId} \
mvn.project.version=${project_version}

12 changes: 11 additions & 1 deletion archetypes/helm/src/main/resources/archetype-resources/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ set -o pipefail

if [[ -z $1 ]] ; then
echo ""
echo "deploy.sh <release> <chart> [<version|path>]"
echo "deploy.sh [-s skip checks and deploy directly] <release> <chart> [<version|path>]"
echo ""
exit 0
fi

SKIP=false
while getopts s: opt; do
case $opt in
s) SKIP=true
esac
shift
done

RELEASE=${1?"release required"}
CHART=${2?"chart required"}
VERSION=${3:-"":->=0.0.0-0}
Expand Down Expand Up @@ -84,6 +92,7 @@ fi

popd >/dev/null || exit

if [ "$SKIP" = false ] ; then
echo ""
echo "--------------------------------------------------------------------------------"
echo ""
Expand Down Expand Up @@ -182,6 +191,7 @@ case ${answer:0:1} in
;;
esac

fi
echo ""
echo "--------------------------------------------------------------------------------"
echo ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@
# SERVICES_RENDERING_VIDEO_RESOLUTIONS=240,720,1080
# SERVICES_RENDERING_VIDEO_DEFAULT_RESOLUTION=720

# --- time untile the h5p cache is used instead of direct requests
# mainly used on persistency issues (e.g. slow hdd's)
# SERVICES_RENDERING_H5P_DISABLE_CACHE_DELAY=0

########################################################################################################################
# ONLY FOR DEBUGGING
########################################################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
#set( $symbol_escape = '\' )
${symbol_pound} ${rootArtifactId} - deploy docker

Prerequisites
-------------
## Prerequisites

- Docker Engine 18.06.0+
- Apache Maven 3.8.4+
- Java SE Development Kit 1.8 (<11)
- PHP Framework 7.4 (<8)
- Git SCM

Install
-------
## Install

1. Please login with your credentials (if necessary):

Expand All @@ -33,8 +31,7 @@ Install
./deploy.sh info
```

Build
-----
## Build

1. Please add following elements to `${symbol_dollar}HOME/.m2/settings.xml`

Expand Down Expand Up @@ -66,8 +63,7 @@ Build
mvn clean install
```

Test
----
## Test

1. [Build](#build) local docker images first.

Expand Down Expand Up @@ -95,8 +91,7 @@ Test
./deploy.sh logs
```

Debugging
---------
## Debugging

1. [Build](#build) local docker images first.

Expand Down Expand Up @@ -138,8 +133,7 @@ Debugging
./deploy.sh reload edu-sharing
```
Uninstall
---------
## Uninstall
1. Shut down an instance by calling:
Expand All @@ -153,6 +147,9 @@ Uninstall
./deploy.sh remove
```
## Parameters
---
If you need more information, please consult
our [edu-sharing community sdk](https://scm.edu-sharing.com/edu-sharing-community/edu-sharing-community-sdk) project.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
# --- relative login path from external authentication service
# REPOSITORY_SERVICE_AUTH_EXTERNAL_LOGIN=/shibboleth

# --- Shall the url of the repository be dynamically returned based on the input url (useful for multi-domain contexts)
# REPOSITORY_SERVICE_HOME_URL_DYNAMIC=false

# --- absolut path from external authentication provider
# REPOSITORY_SERVICE_HOME_AUTH_EXTERNAL_LOGIN_PROVIDERS_URL=

Expand Down Expand Up @@ -263,6 +266,11 @@
# SERVICES_RENDERING_VIDEO_TIMEOUT=3600
# SERVICES_RENDERING_VIDEO_THREADS=1

# --- time untile the h5p cache is used instead of direct requests
# mainly used on persistency issues (e.g. slow hdd's)
# SERVICES_RENDERING_H5P_DISABLE_CACHE_DELAY=0


########################################################################################################################
# ONLY FOR DEBUGGING
########################################################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,13 @@ backup() {
echo "backup postgres"

if [[ -n $compressed ]] ; then
$COMPOSE_EXEC exec -t repository-database sh -c "export PGPASSWORD=${REPOSITORY_DATABASE_PASS:-repository}; pg_dump --format custom --no-owner --no-privileges ${REPOSITORY_DATABASE_NAME:-repository} | gzip" >"$backupDir/repository-db.gz" || {
$COMPOSE_EXEC exec -t repository-database sh -c "export PGPASSWORD=${REPOSITORY_DATABASE_PASS:-repository}; pg_dump --username ${REPOSITORY_DATABASE_USER:-repository} --format custom --no-owner --no-privileges ${REPOSITORY_DATABASE_NAME:-repository} | gzip" >"$backupDir/repository-db.gz" || {
rm -rf "$backupDir"
echo "ERROR on creating postgres dump"
exit 1
}
else
$COMPOSE_EXEC exec -t repository-database sh -c "export PGPASSWORD=${REPOSITORY_DATABASE_PASS:-repository}; pg_dump --format custom --no-owner --no-privileges ${REPOSITORY_DATABASE_NAME:-repository}" > "$backupDir/repository-db.sql" || {
$COMPOSE_EXEC exec -t repository-database sh -c "export PGPASSWORD=${REPOSITORY_DATABASE_PASS:-repository}; pg_dump --username ${REPOSITORY_DATABASE_USER:-repository} --format custom --no-owner --no-privileges ${REPOSITORY_DATABASE_NAME:-repository}" > "$backupDir/repository-db.sql" || {
rm -rf "$backupDir"
echo "ERROR on creating postgres dump"
exit 1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## Parameters

### Global parameters

| Name | Description | Value |
| --------------------------------------- | ------------------------------------ | ------- |
| `global.cluster.istio.enabled` | Enable Istio Service mesh | `false` |
| `global.metrics.prometheus.enabled` | Enable global prometheus metrics | `false` |
| `global.metrics.prometheus.retention` | Set prometheus metric retention time | `1w` |
| `global.metrics.scrape.interval` | Set prometheus scrape interval | `10s` |
| `global.metrics.scrape.timeout` | Set prometheus scrape timeout | `10s` |
| `global.metrics.servicemonitor.enabled` | Enable metrics service monitor | `false` |

### Local parameters

| Name | Description | Value |
| -------------------------------------------------------------------------------------------- | -------------------------------------------------- | ------------------------------------------------------------ |
| `nameOverride` | Override name | `edusharing` |
| `image.pullSecrets` | How to pull secrets | `[]` |
| `edusharing_rediscluster.enabled` | Enable edusharing rediscluster | `true` |
| `edusharing_rediscluster.nameOverride` | Override edusharing rediscluster name | `edusharing-rediscluster` |
| `edusharing_rediscluster.image.name` | Set rediscluster image name | `${docker.edu_sharing.community.common.redis-cluster.name}` |
| `edusharing_rediscluster.image.tag` | Set rediscluster image tag | `${docker.edu_sharing.community.common.redis-cluster.tag}` |
| `edusharing_rediscluster.service.port.api` | Set port for rediscluster service api | `6379` |
| `edusharing_rediscluster.init.permission.image.name` | Set rediscluster init image name | `${docker.edu_sharing.community.common.minideb.name}` |
| `edusharing_rediscluster.init.permission.image.tag` | Set rediscluster init image tag | `${docker.edu_sharing.community.common.minideb.tag}` |
| `edusharing_rediscluster.init.sysctl.image.name` | Set rediscluster init sysctl image name | `${docker.edu_sharing.community.common.minideb.name}` |
| `edusharing_rediscluster.init.sysctl.image.tag` | Set rediscluster init sysctl image tag | `${docker.edu_sharing.community.common.minideb.tag}` |
| `edusharing_rediscluster.sidecar.metrics.image.name` | Set rediscluster sidecar metrics image name | `${docker.edu_sharing.community.common.redis.exporter.name}` |
| `edusharing_rediscluster.sidecar.metrics.image.tag` | Set rediscluster sidecar metrics image tag | `${docker.edu_sharing.community.common.redis.exporter.tag}` |
| `edusharing_repository.enabled` | Enable repository | `true` |
| `edusharing_repository.edusharing_repository_rediscluster.enabled` | Enable repository rediscluster | `false` |
| `edusharing_repository.edusharing_repository_service.nameOverride` | Override repository service name | `edusharing-repository-service` |
| `edusharing_repository.edusharing_repository_service.service.port.api.internal` | Set internal repository service api port | `8080` |
| `edusharing_repository.edusharing_repository_service.config.cache.host` | Set host for repository service redis config cache | `edusharing-rediscluster` |
| `edusharing_repository.edusharing_repository_service.config.cache.port` | Set port for repository service redis config cache | `6379` |
| `edusharing_services_rendering.enabled` | Enable rendering service | `true` |
| `edusharing_services_rendering.edusharing_services_rendering_rediscluster.enabled` | Enable rediscluster rendering service | `false` |
| `edusharing_services_rendering.edusharing_services_rendering_service.config.cache.host` | Set host for rendering service cache | `edusharing-rediscluster` |
| `edusharing_services_rendering.edusharing_services_rendering_service.config.cache.port` | Set port for rendering service cache | `6379` |
| `edusharing_services_rendering.edusharing_services_rendering_service.config.repository.host` | Set host for rendering service repository | `edusharing-repository-service` |
| `edusharing_services_rendering.edusharing_services_rendering_service.config.repository.port` | Set port for rendering service repository | `8080` |
Loading

0 comments on commit 1bfd9b4

Please sign in to comment.