mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-06-10 08:37:02 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 29b4bad3ff | |||
| b55ab5eef4 | |||
| fa98d22724 |
@@ -30,99 +30,11 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
||||
with:
|
||||
node-version: 24.15.0
|
||||
|
||||
- name: Install dependencies
|
||||
run: cd php/tests && npm ci
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
run: cd php/tests && npx playwright install --with-deps chromium
|
||||
|
||||
- name: Set up php 8.5
|
||||
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
|
||||
with:
|
||||
extensions: apcu
|
||||
php-version: 8.5
|
||||
coverage: none
|
||||
ini-file: development
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Adjust some things and fix permissions
|
||||
run: |
|
||||
cd php
|
||||
rm -r ./data
|
||||
rm -r ./session
|
||||
composer install --no-dev
|
||||
composer clear-cache
|
||||
sudo chmod 777 -R ../
|
||||
|
||||
- name: Start fresh development server
|
||||
run: |
|
||||
docker rm --force nextcloud-aio-{mastercontainer,apache,notify-push,nextcloud,redis,database,domaincheck,whiteboard,imaginary,talk,collabora,borgbackup} || true
|
||||
docker volume rm nextcloud_aio_{mastercontainer,apache,database,database_dump,nextcloud,nextcloud_data,redis,backup_cache,elasticsearch} || true
|
||||
docker pull ghcr.io/nextcloud-releases/all-in-one:develop
|
||||
docker run \
|
||||
-d \
|
||||
--init \
|
||||
--name nextcloud-aio-mastercontainer \
|
||||
--restart always \
|
||||
--publish 8080:8080 \
|
||||
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
|
||||
--volume ./php:/var/www/docker-aio/php \
|
||||
--volume ./Containers/mastercontainer/internal.Caddyfile:/internal.Caddyfile \
|
||||
--volume ./Containers/mastercontainer/headers.Caddyfile:/headers.Caddyfile \
|
||||
--volume ./Containers/mastercontainer/start.sh:/start.sh \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
--env SKIP_DOMAIN_VALIDATION=true \
|
||||
--env APACHE_PORT=11000 \
|
||||
ghcr.io/nextcloud-releases/all-in-one:develop
|
||||
echo Waiting for 10 seconds for the development container to start ...
|
||||
sleep 10
|
||||
|
||||
- name: Run Playwright tests for initial setup
|
||||
run: |
|
||||
cd php/tests
|
||||
export DEBUG=pw:api
|
||||
if ! npx playwright test tests/initial-setup.spec.js; then
|
||||
docker logs nextcloud-aio-mastercontainer
|
||||
docker logs nextcloud-aio-borgbackup
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Start fresh development server
|
||||
run: |
|
||||
docker rm --force nextcloud-aio-{mastercontainer,apache,notify-push,nextcloud,redis,database,domaincheck,whiteboard,imaginary,talk,collabora,borgbackup} || true
|
||||
docker volume rm nextcloud_aio_{mastercontainer,apache,database,database_dump,nextcloud,nextcloud_data,redis,backup_cache,elasticsearch} || true
|
||||
docker run \
|
||||
-d \
|
||||
--init \
|
||||
--name nextcloud-aio-mastercontainer \
|
||||
--restart always \
|
||||
--publish 8080:8080 \
|
||||
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
|
||||
--volume ./php:/var/www/docker-aio/php \
|
||||
--volume ./Containers/mastercontainer/internal.Caddyfile:/internal.Caddyfile \
|
||||
--volume ./Containers/mastercontainer/headers.Caddyfile:/headers.Caddyfile \
|
||||
--volume ./Containers/mastercontainer/start.sh:/start.sh \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
--env SKIP_DOMAIN_VALIDATION=false \
|
||||
--env APACHE_PORT=11000 \
|
||||
ghcr.io/nextcloud-releases/all-in-one:develop
|
||||
echo Waiting for 10 seconds for the development container to start ...
|
||||
sleep 10
|
||||
run: ./php/tests/run.sh ./tests/initial-setup.spec.js
|
||||
|
||||
- name: Run Playwright tests for backup restore
|
||||
run: |
|
||||
cd php/tests
|
||||
export DEBUG=pw:api
|
||||
if ! npx playwright test tests/restore-instance.spec.js; then
|
||||
docker logs nextcloud-aio-mastercontainer
|
||||
docker logs nextcloud-aio-borgbackup
|
||||
exit 1
|
||||
fi
|
||||
run: ./php/tests/run.sh ./tests/restore-instance.spec.js
|
||||
|
||||
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
if: ${{ !cancelled() }}
|
||||
|
||||
@@ -15,72 +15,15 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
||||
with:
|
||||
node-version: 24.15.0
|
||||
|
||||
- name: Install dependencies
|
||||
run: cd php/tests && npm ci
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
run: cd php/tests && npx playwright install --with-deps chromium
|
||||
|
||||
- name: Start fresh development server
|
||||
run: |
|
||||
docker rm --force nextcloud-aio-{mastercontainer,apache,notify-push,nextcloud,redis,database,domaincheck,whiteboard,imaginary,talk,collabora,borgbackup} || true
|
||||
docker volume rm nextcloud_aio_{mastercontainer,apache,database,database_dump,nextcloud,nextcloud_data,redis,backup_cache,elasticsearch} || true
|
||||
docker pull ghcr.io/nextcloud-releases/all-in-one:develop
|
||||
docker run \
|
||||
-d \
|
||||
--init \
|
||||
--name nextcloud-aio-mastercontainer \
|
||||
--restart always \
|
||||
--publish 8080:8080 \
|
||||
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
--env SKIP_DOMAIN_VALIDATION=true \
|
||||
--env APACHE_PORT=11000 \
|
||||
ghcr.io/nextcloud-releases/all-in-one:develop
|
||||
echo Waiting for 10 seconds for the development container to start ...
|
||||
sleep 10
|
||||
|
||||
- name: Run Playwright tests for initial setup
|
||||
run: |
|
||||
cd php/tests
|
||||
export DEBUG=pw:api
|
||||
if ! npx playwright test tests/initial-setup.spec.js; then
|
||||
docker logs nextcloud-aio-mastercontainer
|
||||
docker logs nextcloud-aio-borgbackup
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Start fresh development server
|
||||
run: |
|
||||
docker rm --force nextcloud-aio-{mastercontainer,apache,notify-push,nextcloud,redis,database,domaincheck,whiteboard,imaginary,talk,collabora,borgbackup} || true
|
||||
docker volume rm nextcloud_aio_{mastercontainer,apache,database,database_dump,nextcloud,nextcloud_data,redis,backup_cache,elasticsearch} || true
|
||||
docker run \
|
||||
-d \
|
||||
--init \
|
||||
--name nextcloud-aio-mastercontainer \
|
||||
--restart always \
|
||||
--publish 8080:8080 \
|
||||
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
--env SKIP_DOMAIN_VALIDATION=false \
|
||||
--env APACHE_PORT=11000 \
|
||||
ghcr.io/nextcloud-releases/all-in-one:develop
|
||||
echo Waiting for 10 seconds for the development container to start ...
|
||||
sleep 10
|
||||
env:
|
||||
TEST_CODE_FROM_IMAGE: yes
|
||||
run: ./run.sh ./tests/initial-setup.spec.js
|
||||
|
||||
- name: Run Playwright tests for backup restore
|
||||
run: |
|
||||
cd php/tests
|
||||
export DEBUG=pw:api
|
||||
if ! npx playwright test tests/restore-instance.spec.js; then
|
||||
docker logs nextcloud-aio-mastercontainer
|
||||
docker logs nextcloud-aio-borgbackup
|
||||
exit 1
|
||||
fi
|
||||
env:
|
||||
TEST_CODE_FROM_IMAGE: yes
|
||||
run: ./php/tests/run.sh ./tests/restore-instance.spec.js
|
||||
|
||||
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
if: ${{ !cancelled() }}
|
||||
@@ -88,4 +31,4 @@ jobs:
|
||||
name: playwright-report
|
||||
path: php/tests/playwright-report/
|
||||
retention-days: 14
|
||||
overwrite: true
|
||||
overwrite: true
|
||||
@@ -0,0 +1,4 @@
|
||||
FROM docker.io/library/composer:latest
|
||||
|
||||
RUN pecl bundle -d /usr/src/php/ext apcu \
|
||||
&& docker-php-ext-install apcu
|
||||
@@ -0,0 +1,107 @@
|
||||
# This setup expects that you run the services via profiles!
|
||||
# Usage: docker compose --profile local-code up
|
||||
# or: docker compose --profile code-from-image up
|
||||
|
||||
name: nextcloud-aio
|
||||
services:
|
||||
composer:
|
||||
image: localhost/composer:latest
|
||||
build: Containers/composer
|
||||
pull_policy: never
|
||||
volumes:
|
||||
- ..:/app
|
||||
working_dir: /app
|
||||
command: |-
|
||||
bash -c '
|
||||
test -d ./data && rm -r ./data
|
||||
test -d ./session && rm -r ./session
|
||||
composer install --no-dev
|
||||
composer clear-cache
|
||||
'
|
||||
app-base:
|
||||
image: ghcr.io/nextcloud-releases/all-in-one:develop${ARM64_SUFFIX-}
|
||||
pull_policy: always # Always pull so we don't risk to run into the "Update for mastercontainer" page.
|
||||
init: true
|
||||
restart: always
|
||||
network_mode: bridge
|
||||
ports:
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- backup_vol:/mnt/test
|
||||
profiles:
|
||||
- none
|
||||
environment:
|
||||
SKIP_DOMAIN_VALIDATION: ${SKIP_DOMAIN_VALIDATION-true}
|
||||
APACHE_PORT: 11000
|
||||
entrypoint: bash /start.sh
|
||||
|
||||
app-code-from-image:
|
||||
extends: app-base
|
||||
container_name: nextcloud-aio-mastercontainer
|
||||
profiles:
|
||||
- code-from-image
|
||||
|
||||
app-local-code:
|
||||
extends: app-base
|
||||
container_name: nextcloud-aio-mastercontainer
|
||||
depends_on:
|
||||
composer:
|
||||
condition: service_completed_successfully
|
||||
volumes:
|
||||
- ..:/var/www/docker-aio/php
|
||||
- ../../Containers/mastercontainer/internal.Caddyfile:/internal.Caddyfile
|
||||
- ../../Containers/mastercontainer/headers.Caddyfile:/headers.Caddyfile
|
||||
- ../../Containers/mastercontainer/start.sh:/start.sh
|
||||
profiles:
|
||||
- local-code
|
||||
|
||||
test-runner-base:
|
||||
image: mcr.microsoft.com/playwright:v1.56.1
|
||||
volumes:
|
||||
- ..:/app
|
||||
working_dir: /app
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
ports:
|
||||
- '9323:9323' # to view test reports
|
||||
profiles:
|
||||
- none
|
||||
environment:
|
||||
BASE_URL: "https://host.docker.internal:8080"
|
||||
DEBUG: "pw:api"
|
||||
command: |-
|
||||
bash -c "
|
||||
cd tests
|
||||
# Install dependencies
|
||||
npm ci
|
||||
# Run the initial setup tests
|
||||
npx playwright test "${TESTS_FILE-}"
|
||||
exit $?
|
||||
"
|
||||
|
||||
test-runner-code-from-image:
|
||||
extends: test-runner-base
|
||||
container_name: test-runner
|
||||
profiles:
|
||||
- code-from-image
|
||||
depends_on:
|
||||
app:
|
||||
condition: service_healthy
|
||||
|
||||
|
||||
test-runner-local-code:
|
||||
extends: test-runner-base
|
||||
container_name: test-runner
|
||||
profiles:
|
||||
- local-code
|
||||
depends_on:
|
||||
app-local-code:
|
||||
condition: service_healthy
|
||||
|
||||
volumes:
|
||||
nextcloud_aio_mastercontainer:
|
||||
name: nextcloud_aio_mastercontainer
|
||||
backup_vol:
|
||||
|
||||
Executable
+62
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ "$1" = -* ]]; then
|
||||
echo "Usage $(basename $0) [PLAYWRIGHT_TESTS_FILE]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd $(dirname $0)/../..
|
||||
|
||||
DOCO="docker compose -f ./php/tests/compose.yaml"
|
||||
|
||||
if [[ $(uname -m) = 'arm64' ]]; then
|
||||
export ARM64_SUFFIX='-arm64'
|
||||
fi
|
||||
|
||||
run_tests() {
|
||||
export TESTS_FILE="$1"
|
||||
export SKIP_DOMAIN_VALIDATION
|
||||
|
||||
if [[ -n "$TEST_CODE_FROM_IMAGE" ]]; then
|
||||
profile="code-from-image"
|
||||
else
|
||||
profile="local-code"
|
||||
fi
|
||||
|
||||
# Clean up old containers and volumes
|
||||
docker container rm --force nextcloud-aio-{mastercontainer,apache,notify-push,nextcloud,redis,database,domaincheck,whiteboard,imaginary,talk,collabora,borgbackup} > /dev/null 2>&1
|
||||
docker volume rm nextcloud_aio_{mastercontainer,apache,database,database_dump,nextcloud,nextcloud_data,redis,backup_cache,elasticsearch} > /dev/null 2>&1
|
||||
$DOCO --profile $profile down -v
|
||||
sleep 1
|
||||
|
||||
echo -e "\n 📣 Running playwright tests for ${TESTS_FILE}\n"
|
||||
if ! $DOCO --profile $profile run --remove-orphans test-runner-$profile; then
|
||||
for container in nextcloud-aio-{mastercontainer,borgbackup}; do
|
||||
if docker container list --format="{{ .Names }}" | grep -q "$container"; then
|
||||
echo -e "\n 📣 Log output from container ${container}:\n"
|
||||
docker logs nextcloud-aio-mastercontainer
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
if [[ -n "$1" ]]; then
|
||||
if [[ ! -f "$1" ]]; then
|
||||
echo "Error: file '$1' does not exist."
|
||||
exit 1
|
||||
fi
|
||||
# Not using coreutil's `realpath --relative-to` here since that is not available on BSD/mac systems.
|
||||
fullpath="$(realpath "$1")"
|
||||
prefix="$(realpath ./php/tests)"
|
||||
relpath="${fullpath#"$prefix"/}"
|
||||
|
||||
: ${SKIP_DOMAIN_VALIDATION:-false}
|
||||
run_tests "$relpath"
|
||||
else
|
||||
SKIP_DOMAIN_VALIDATION=true
|
||||
run_tests tests/initial-setup.spec.js
|
||||
sleep 1
|
||||
SKIP_DOMAIN_VALIDATION=false
|
||||
run_tests tests/restore-instance.spec.js
|
||||
fi
|
||||
@@ -69,7 +69,7 @@ test('Initial setup', async ({ page: setupPage }) => {
|
||||
const initialNextcloudPassword = await containersPage.locator('#initial-nextcloud-password').innerText();
|
||||
|
||||
// Set backup location and create backup
|
||||
const borgBackupLocation = `/mnt/test/aio-${Math.floor(Math.random() * 2147483647)}`
|
||||
const borgBackupLocation = `/tmp/test/aio-${Math.floor(Math.random() * 2147483647)}`
|
||||
await containersPage.locator('#borg_backup_host_location').click();
|
||||
await containersPage.locator('#borg_backup_host_location').fill(borgBackupLocation);
|
||||
await containersPage.getByRole('button', { name: 'Submit backup location' }).click();
|
||||
|
||||
@@ -32,7 +32,7 @@ test('Restore instance', async ({ page: setupPage }) => {
|
||||
|
||||
// Reject invalid backup location
|
||||
await containersPage.locator('#borg_restore_host_location').click();
|
||||
await containersPage.locator('#borg_restore_host_location').fill('/mnt/test/aio-incorrect-path');
|
||||
await containersPage.locator('#borg_restore_host_location').fill('/tmp/test/aio-incorrect-path');
|
||||
await containersPage.locator('#borg_restore_password').click();
|
||||
await containersPage.locator('#borg_restore_password').fill(borgBackupPassword);
|
||||
await containersPage.getByRole('button', { name: 'Submit location and encryption password' }).click()
|
||||
|
||||
Reference in New Issue
Block a user