Skip to content

Commit

Permalink
Merge pull request #387 from EscolaLMS/develop
Browse files Browse the repository at this point in the history
release 1.0.1
  • Loading branch information
qunabu authored Jan 9, 2025
2 parents 12ee9c8 + 9222304 commit 3633a11
Show file tree
Hide file tree
Showing 15 changed files with 413 additions and 306 deletions.
15 changes: 6 additions & 9 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,12 @@ docker/minio_storage
docker/postgres-data
!docker/conf

storage/h5p/temp
.env.local.testing
/coverage

storage/h5p/libraries/**
storage/h5p/editor/images/**
storage
storage/**/*

storage/h5p/cachedassets/*
storage/h5p/editor/**
storage/scorm/**
storage/imgcache

escolasoft/**/vendor
.DS_Store
Expand All @@ -45,7 +40,6 @@ bootstrap/cache/**/*
/public/scorm/**


storage/api-docs/api-docs.json
#composer.lock
yarn.lock

Expand All @@ -61,4 +55,7 @@ tests/badge.svg
tests/coverage.xml
tests/coverage.txt

caddy
caddy

.git
docs
144 changes: 122 additions & 22 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,123 @@
on: push
name: Integration Tests
jobs:
phpunit-mysql-php81:
# phpunit-mysql-php81:
# runs-on: ubuntu-latest
# container:
# image: escolalms/php:8.1-work

# services:
# mysql:
# image: mariadb:10.5
# env:
# MYSQL_ROOT_PASSWORD: password
# MYSQL_DATABASE: test
# ports:
# - 33306:3306
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 1

# - name: Copy environment configuration files
# run: |
# cp docker/envs/.env.ci.mysql .env
# cp docker/envs/.env.ci.mysql .env.testing
# cp docker/envs/phpunit.xml.mysql phpunit.xml

# - name: Update composer
# run: |
# apt-get install unzip -y
# composer self-update
# rm composer.lock # lock is for php >=8.2
# composer install --no-scripts

# - name: Prepare Laravel Application
# run: |
# php artisan key:generate
# php artisan migrate:fresh
# php artisan db:seed --class="Database\Seeders\PermissionsSeeder"
# php artisan passport:keys --force
# php artisan passport:client --personal --no-interaction
# cp storage/oauth-private.key vendor/orchestra/testbench-core/laravel/storage/oauth-private.key
# cp storage/oauth-public.key vendor/orchestra/testbench-core/laravel/storage/oauth-public.key
# mkdir vendor/escolalms/lrs/src/../../storage/
# cp storage/*.key vendor/escolalms/lrs/src/../../storage/

# - name: Special Migrations for Tests
# run: php artisan migrate --path=vendor/escolalms/courses/tests/Database/Migrations

# - name: Run Testsuite
# run: vendor/bin/phpunit

# phpunit-postgres-php81:
# runs-on: ubuntu-latest
# container:
# image: escolalms/php:8.1-work

# services:
# postgres:
# image: postgres:12
# env:
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: postgres
# POSTGRES_DB: test
# TZ: Europe/Warsaw
# ports:
# - 5432:5432

# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 1

# - name: Copy environment configuration files
# run: |
# cp docker/envs/.env.ci.postgres .env
# cp docker/envs/phpunit.xml.postgres phpunit.xml

# - name: Update composer
# run: |
# apt-get install git unzip -y
# composer self-update
# rm composer.lock # lock is for php >=8.2
# composer install --no-scripts

# - name: Prepare Laravel Application
# run: |
# php artisan key:generate
# php artisan migrate:fresh
# php artisan db:seed --class="Database\Seeders\PermissionsSeeder"
# php artisan passport:keys --force
# php artisan passport:client --personal --no-interaction
# cp storage/oauth-private.key vendor/orchestra/testbench-core/laravel/storage/oauth-private.key
# cp storage/oauth-public.key vendor/orchestra/testbench-core/laravel/storage/oauth-public.key
# mkdir vendor/escolalms/lrs/src/../../storage/
# cp storage/*.key vendor/escolalms/lrs/src/../../storage/

# - name: Special Migrations for Tests
# run: php artisan migrate --path=vendor/escolalms/courses/tests/Database/Migrations

# - name: Run Testsuite
# run: vendor/bin/phpunit

phpunit-postgres-php82:
runs-on: ubuntu-latest
container:
image: escolalms/php:8.1-work
image: escolalms/php:8.2-work

services:
mysql:
image: mariadb:10.5
postgres:
image: postgres:12
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
TZ: Europe/Warsaw
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
- 5432:5432

steps:
- uses: actions/checkout@v2
Expand All @@ -23,16 +126,14 @@ jobs:

- name: Copy environment configuration files
run: |
cp docker/envs/.env.ci.mysql .env
cp docker/envs/.env.ci.mysql .env.testing
cp docker/envs/phpunit.xml.mysql phpunit.xml
cp docker/envs/.env.ci.postgres .env
cp docker/envs/phpunit.xml.postgres phpunit.xml
- name: Update composer
run: |
apt-get install unzip -y
apt-get install git unzip -y
composer self-update
rm composer.lock # lock is for php >=8.2
composer install --no-scripts
composer update --no-scripts
- name: Prepare Laravel Application
run: |
Expand All @@ -52,10 +153,10 @@ jobs:
- name: Run Testsuite
run: vendor/bin/phpunit

phpunit-postgres-php81:
phpunit-postgres-php83:
runs-on: ubuntu-latest
container:
image: escolalms/php:8.1-work
image: escolalms/php:8.3-alpine

services:
postgres:
Expand All @@ -80,10 +181,9 @@ jobs:
- name: Update composer
run: |
apt-get install git unzip -y
#apt-get install git unzip -y
composer self-update
rm composer.lock # lock is for php >=8.2
composer install --no-scripts
composer update --no-scripts
- name: Prepare Laravel Application
run: |
Expand All @@ -103,10 +203,10 @@ jobs:
- name: Run Testsuite
run: vendor/bin/phpunit

phpunit-postgres-php82:
phpunit-postgres-php84:
runs-on: ubuntu-latest
container:
image: escolalms/php:8.2-work
image: escolalms/php:8.4-alpine

services:
postgres:
Expand All @@ -131,7 +231,7 @@ jobs:
- name: Update composer
run: |
apt-get install git unzip -y
#apt-get install git unzip -y
composer self-update
composer update --no-scripts
Expand Down
17 changes: 5 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
FROM escolalms/php:8.2-prod
FROM escolalms/php:8.3-alpine
WORKDIR /var/www/html
EXPOSE 80
EXPOSE 9000
COPY / /var/www/html
RUN pecl install excimer
RUN \
# general supervisord settings
cp docker/conf/supervisor/supervisord.conf /etc/supervisor/supervisord.conf \
# supervisord services
# && cp -r docker/conf/supervisor/services/* /etc/supervisor/custom.d \
# devilbox php.ini./ TODO this should be rather send to different custom file
&& cp docker/conf/php/xxx-devilbox-default-php.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini \
# overwrite some php-fpm settings
cp docker/conf/supervisor/supervisord.conf /etc/supervisord.conf \
&& cp docker/conf/php/xxx-devilbox-default-php.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini \
&& cp docker/conf/php/php-fpm-custom.conf /usr/local/etc/php-fpm.d/php-fpm-custom.conf
RUN composer self-update && composer install --no-scripts
RUN chown -R devilbox:devilbox /var/www/
RUN composer install --no-scripts

CMD /var/www/html/init.sh

Expand Down
18 changes: 7 additions & 11 deletions Dockerfile.develop
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
FROM escolalms/php:8.2-work
FROM escolalms/php:8.3-alpine
WORKDIR /var/www/html
EXPOSE 9000
COPY / /var/www/html
RUN pecl install excimer
RUN cp docker/conf/supervisor/supervisord.conf /etc/supervisor/supervisord.conf \
# supervisord services
# && cp -r docker/conf/supervisor/services/* /etc/supervisor/custom.d \
# devilbox php.ini./ TODO this should be rather send to different custom file
&& cp docker/conf/php/xxx-devilbox-default-php.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini \
# overwrite some php-fpm settings
RUN \
cp docker/conf/supervisor/supervisord.conf /etc/supervisord.conf \
&& cp docker/conf/php/xxx-devilbox-default-php.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini \
&& cp docker/conf/php/php-fpm-custom.conf /usr/local/etc/php-fpm.d/php-fpm-custom.conf
RUN composer self-update && composer install --no-scripts
RUN chown -R devilbox:devilbox /var/www/
RUN composer install --no-scripts

CMD /var/www/html/init.sh

HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=5 CMD [ "php", "artisan", "health:check" ]
HEALTHCHECK --interval=30s --timeout=30s --start-period=10s --retries=5 CMD [ "php", "artisan", "health:check" ]
Loading

0 comments on commit 3633a11

Please sign in to comment.