Skip to content

Commit 567a5a1

Browse files
committed
Respect global NEXTCLOUD_VERSION argument for nextcloud version
1 parent 920382e commit 567a5a1

6 files changed

Lines changed: 27 additions & 10 deletions

File tree

.github/workflows/tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ jobs:
7373
env:
7474
CLIENT_ID: ${{ secrets.VAAS_CLIENT_ID }}
7575
CLIENT_SECRET: ${{ secrets.VAAS_CLIENT_SECRET }}
76-
run: ./scripts/run-app.sh 31.0.8 1
76+
run: |
77+
source nextcloud.env
78+
./scripts/run-app.sh "$NEXTCLOUD_VERSION" 1
7779
7880
- name: add builder into nextcloud network
7981
run: |

Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ appstore_package_name=$(appstore_build_directory)/$(app_real_name)
1111
npm=$(shell which npm 2> /dev/null)
1212
composer=$(shell which composer 2> /dev/null)
1313

14+
include nextcloud.env
15+
1416
all: build
1517

1618
# Fetches dependencies and builds it
@@ -30,7 +32,7 @@ endif
3032
.PHONY: oc
3133
oc:
3234
ifeq (,$(wildcard nextcloud-server))
33-
./scripts/get-nc-server.sh
35+
./scripts/get-nc-server.sh "$(NEXTCLOUD_VERSION)"
3436
endif
3537

3638
# Installs and updates the composer dependencies. If composer is not installed
@@ -80,20 +82,20 @@ unittests:
8082
# Run integration tests
8183
.PHONY: integrationtests
8284
integrationtests:
83-
./scripts/run-app.sh "33.0.0" 1
85+
./scripts/run-app.sh "$(NEXTCLOUD_VERSION)" 1
8486
composer install
8587
./vendor/bin/phpunit -c tests/integration/phpunit.xml tests/integration/ --testdox
8688

8789
# Run bats tests
8890
.PHONY: bats
8991
bats:
90-
./scripts/run-app.sh "33.0.0" 1
92+
./scripts/run-app.sh "$(NEXTCLOUD_VERSION)" 1
9193
bats --verbose-run --timing --trace ./tests/bats
9294

9395
# Complete production like but static Nextcloud and app setup
9496
.PHONY: prod
9597
prod: oc
96-
./scripts/run-app.sh "33.0.0" 1
98+
./scripts/run-app.sh "$(NEXTCLOUD_VERSION)" 1
9799

98100
# Same as clean but also removes dependencies and build related folders
99101
.PHONY: distclean
@@ -111,7 +113,7 @@ local: build
111113
docker compose kill || true
112114
docker stop nextcloud-container || true
113115
docker container rm nextcloud-container || true
114-
docker run --rm -d -p 8080:80 --name nextcloud-container -e SERVER_BRANCH="v33.0.0" -v .:/var/www/html/apps-extra/gdatavaas ghcr.io/juliusknorr/nextcloud-dev-php84:latest
116+
docker run --rm -d -p 8080:80 --name nextcloud-container -e SERVER_BRANCH="v$(NEXTCLOUD_VERSION)" -v .:/var/www/html/apps-extra/gdatavaas ghcr.io/juliusknorr/nextcloud-dev-php84:latest
115117
composer install
116118

117119
# Builds the app for production and prepares it for the appstore under ./build/artifacts

docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
services:
66
nextcloud-container:
7-
image: nextcloud:33.0.0
7+
image: nextcloud:${NEXTCLOUD_VERSION:?NEXTCLOUD_VERSION must be set}
88
ports:
99
- "8080:80"
1010
container_name: nextcloud-container

nextcloud.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Shared Nextcloud version for Makefile, scripts, compose, and CI.
2+
NEXTCLOUD_VERSION=33.0.3

scripts/get-nc-server.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@
44
#
55
# SPDX-License-Identifier: AGPL-3.0-or-later
66

7+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8+
79
rm -rf nextcloud-server/
8-
export NEXTCLOUD_VERSION=${1:-33.0.0}
10+
if [ -z "${NEXTCLOUD_VERSION:-}" ]; then
11+
source "$SCRIPT_DIR/../nextcloud.env"
12+
fi
13+
14+
export NEXTCLOUD_VERSION=${1:-${NEXTCLOUD_VERSION}}
915
git clone --depth 1 --recurse-submodules --single-branch --branch v"$NEXTCLOUD_VERSION" https://github.com/nextcloud/server.git ./nextcloud-server
1016
cd nextcloud-server || exit 1
1117
git submodule update --init

scripts/run-app.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66

77
set -e
88

9-
export NEXTCLOUD_VERSION=${1:-33.0.0}
9+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10+
if [ -z "${NEXTCLOUD_VERSION:-}" ]; then
11+
source "$SCRIPT_DIR/../nextcloud.env"
12+
fi
13+
14+
export NEXTCLOUD_VERSION=${1:-${NEXTCLOUD_VERSION}}
1015
export IS_CI=${2:-0}
1116

1217
if [ "$IS_CI" -eq 0 ]; then
@@ -24,7 +29,7 @@ setup_nextcloud () {
2429
docker container rm garaged || true
2530
docker compose -f docker-compose.yaml kill || true
2631
docker compose -f docker-compose.yaml down --volumes || true
27-
docker compose -f docker-compose.yaml up --build -d
32+
NEXTCLOUD_VERSION="$NEXTCLOUD_VERSION" docker compose -f docker-compose.yaml up --build -d
2833

2934
until docker exec --user www-data -i nextcloud-container php occ status | grep "installed: false"
3035
do

0 commit comments

Comments
 (0)