diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 336daf1eb32d8de35f7e4e51e46f50dfd42842bb..9a8712eb44d661e3dc6e8be563c05b243d5f7837 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -162,9 +162,18 @@ verify-install-script: variables: SKIP_CHECKS: 1 script: - - apk add bash curl - - bash install.sh - - exit 0 + - "apk add bash curl" + - "curl -sSL https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/release-${DOC_VERSION}/install.sh | bash | grep 'Success!'" + +verify-dist: + image: docker.io/alpine:3.20 + stage: verify + only: + refs: + - /^release-.*/ + script: + - "apk add curl" + - "curl -v --output /dev/null --fail https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/${APP_VERSION}/dist.tar.gz" lint-helm-chart: image: docker.io/alpine:3.20 diff --git a/install.sh b/install.sh index 74206b9e0252cf2ce7e2656fc37e547827d7b17f..711bd024f27cedb7edc8662735c5075e5839c563 100644 --- a/install.sh +++ b/install.sh @@ -43,12 +43,18 @@ if [[ $SKIP_CHECKS -eq 0 ]] && [[ $DOWNLOAD_ONLY -ne 1 ]]; then fi MAX_MAP_COUNT=$(cat /proc/sys/vm/max_map_count) if [[ $MAX_MAP_COUNT -lt $MIN_MAP_COUNT ]]; then - echo "You do not have enough max. map counts:" - echo "" - echo " - we found max. ${MAX_MAP_COUNT} map count instead of necessary ${MIN_MAP_COUNT}" - echo " - update your /etc/sysctl.conf file and add the line 'vm.max_map_count=${MIN_MAP_COUNT}' at the end and apply it with 'sysctl -p'" - echo " - if you believe this is a mistake, skip startup checks with the SKIP_CHECKS=1 flag" - exit 4 + echo "You do not have enough max. map counts: found ${MAX_MAP_COUNT} instead of minimum ${MIN_MAP_COUNT}" + if [ $(id -u) -eq 0 ]; then + echo " - attempt to update the /etc/sysctl.conf file and add the line 'vm.max_map_count=${MIN_MAP_COUNT}' at the end" + echo "vm.max_map_count=${MIN_MAP_COUNT}" >> /etc/sysctl.conf + sysctl -p + if [[ $MAX_MAP_COUNT -lt $MIN_MAP_COUNT ]]; then + exit 4 + fi + else + echo " - you need to re-run the install.sh script as root to fix this" + exit 4 + fi else echo "MAP COUNT ${MAX_MAP_COUNT} OK" fi