Fix docker dev and tests

This commit is contained in:
Michael Weimann 2022-04-12 22:39:43 +02:00 committed by Igor Scheller
parent 77450d194d
commit 09babc596b
4 changed files with 26 additions and 13 deletions

View File

@ -106,6 +106,8 @@ PRODUCTION_REMOTE_PATH # Same as STAGING_REMOTE_PATH but for the production env
## Docker ## Docker
If unspecific issues appear try using Docker version >= 20.10.14.
This repo [ships a docker setup](docker/dev) for a quick development start. This repo [ships a docker setup](docker/dev) for a quick development start.
If you use another uid/gid than 1000 on your machine you have to adjust it in [docker/dev/.env](docker/dev/.env). If you use another uid/gid than 1000 on your machine you have to adjust it in [docker/dev/.env](docker/dev/.env).
@ -121,26 +123,26 @@ Run these commands once initially and then as required after changes
```bash ```bash
# Install composer dependencies # Install composer dependencies
docker exec -it engelsystem_dev-es_workspace-1 composer i docker-compose exec es_workspace composer i
# Install node packages # Install node packages
docker exec -it engelsystem_dev-es_workspace-1 yarn install docker-compose exec es_workspace yarn install
# Run a front-end build # Run a front-end build
docker exec -it engelsystem_dev-es_workspace-1 yarn build docker-compose exec es_workspace yarn build
# Update the translation files # Update the translation files
docker exec -it engelsystem_dev-es_workspace-1 find /var/www/resources/lang -type f -name '*.po' -exec sh -c 'file="{}"; msgfmt "${file%.*}.po" -o "${file%.*}.mo"' \; docker-compose exec es_workspace find /var/www/resources/lang -type f -name '*.po' -exec sh -c 'file="{}"; msgfmt "${file%.*}.po" -o "${file%.*}.mo"' \;
# Run the migrations # Run the migrations
docker exec -it engelsystem_dev-es_workspace-1 bin/migrate docker-compose exec es_workspace bin/migrate
``` ```
While developing you may use the watch mode to rebuild the system on changes While developing you may use the watch mode to rebuild the system on changes
```bash ```bash
# Run a front-end build # Run a front-end build
docker exec -it engelsystem_dev-es_workspace-1 yarn build:watch docker-compose exec es_workspace yarn build:watch
``` ```
**Hint for using Xdebug with *PhpStorm*** **Hint for using Xdebug with *PhpStorm***

View File

@ -19,10 +19,10 @@ class AddNameMinutesAndTimestampsToSchedules extends Migration
$this->schema->table( $this->schema->table(
'schedules', 'schedules',
function (Blueprint $table) { function (Blueprint $table) {
$table->string('name')->after('id'); $table->string('name')->default('')->after('id');
$table->integer('shift_type')->after('name'); $table->integer('shift_type')->default(0)->after('name');
$table->integer('minutes_before')->after('shift_type'); $table->integer('minutes_before')->default(0)->after('shift_type');
$table->integer('minutes_after')->after('minutes_before'); $table->integer('minutes_after')->default(0)->after('minutes_before');
$table->timestamps(); $table->timestamps();
} }
); );
@ -34,6 +34,16 @@ class AddNameMinutesAndTimestampsToSchedules extends Migration
'minutes_after' => 15, 'minutes_after' => 15,
]); ]);
$this->schema->table(
'schedules',
function (Blueprint $table) {
$table->string('name')->default(null)->change();
$table->integer('shift_type')->default(null)->change();
$table->integer('minutes_before')->default(null)->change();
$table->integer('minutes_after')->default(null)->change();
}
);
// Add legacy reference // Add legacy reference
if ($this->schema->hasTable('ShiftTypes')) { if ($this->schema->hasTable('ShiftTypes')) {
$connection = $this->schema->getConnection(); $connection = $this->schema->getConnection();

View File

@ -16,4 +16,5 @@ ENV TRUSTED_PROXIES 10.0.0.0/8,::ffff:10.0.0.0/8,\
# Engelsystem development workspace # Engelsystem development workspace
# Contains all tools required to build / manage the system # Contains all tools required to build / manage the system
FROM es_php_fpm AS es_workspace FROM es_php_fpm AS es_workspace
RUN apk add --no-cache composer gettext nodejs npm yarn RUN apk add --no-cache gettext nodejs npm yarn
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

View File

@ -3,10 +3,10 @@
namespace Engelsystem\Test\Feature\Model; namespace Engelsystem\Test\Feature\Model;
use Engelsystem\Models\LogEntry; use Engelsystem\Models\LogEntry;
use PHPUnit\Framework\TestCase; use Engelsystem\Test\Feature\ApplicationFeatureTest;
use Psr\Log\LogLevel; use Psr\Log\LogLevel;
class LogEntryTest extends TestCase class LogEntryTest extends ApplicationFeatureTest
{ {
/** /**
* @covers \Engelsystem\Models\LogEntry::filter * @covers \Engelsystem\Models\LogEntry::filter