From c43c0ece42bd07cbbe876f2a484eb0a20ac6b253 Mon Sep 17 00:00:00 2001 From: Philipp Lang Date: Thu, 24 Nov 2022 12:33:46 +0100 Subject: [PATCH] update env --- .drone.yml | 53 ++++++++++++++++++++++++++++++++++--------- .env.example | 9 ++------ .env.testing | 55 --------------------------------------------- .gitignore | 1 + config/database.php | 26 --------------------- phpunit.xml | 1 - 6 files changed, 46 insertions(+), 99 deletions(-) delete mode 100644 .env.testing diff --git a/.drone.yml b/.drone.yml index 1882ef36..bae8be4f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -44,27 +44,55 @@ steps: - chmod 600 $HOME/.ssh/id_rsa - git submodule update --init --recursive - - name: composer + - name: composer_dev image: composer:2.2.7 commands: - - composer install --ignore-platform-reqs --no-dev + - composer install --ignore-platform-reqs --dev - name: mysql_healthcheck image: mariadb/server:10.3 commands: - while ! mysqladmin ping -h db -u db -pdb --silent; do sleep 1; done - - name: migrate - image: php:8.1.6 - commands: - - cp .env.testing .env - - php artisan key:generate - - php artisan migrate --database=mysqltest - - name: phpunit_tests image: php:8.1.6 + volumes: + - name: texlive + path: /usr/local/texlive commands: + - apt-get update && apt-get install -y libcurl3-dev apt-utils zlib1g-dev libpng-dev libicu-dev libonig-dev texlive + - docker-php-ext-install pdo_mysql curl gd intl mbstring + - echo "" > .env + - php artisan key:generate + - php artisan migrate - vendor/bin/phpunit + - rm -f .env + environment: + APP_NAME: Scoutrobot + APP_ENV: local + APP_DEBUG: true + APP_URL: http://scoutrobot.test + APP_MODE: stamm + LOG_CHANNEL: stack + DB_CONNECTION: mysql + DB_HOST: db + DB_PORT: 3306 + DB_DATABASE: db + DB_USERNAME: db + DB_PASSWORD: db + BROADCAST_DRIVER: log + CACHE_DRIVER: file + QUEUE_CONNECTION: sync + SESSION_DRIVER: file + SESSION_LIFETIME: 120 + MAIL_FROM_NAME: '${APP_NAME}' + PDFLATEX_BIN: /usr/local/texlive/bin/x86_64-linux/pdflatex + XELATEX_BIN: /usr/local/texlive/bin/x86_64-linux/xelatex + + - name: composer_no_dev + image: composer:2.2.7 + commands: + - composer install --ignore-platform-reqs --no-dev - name: phpstan_tests image: php:8.1.6 @@ -133,11 +161,16 @@ services: - name: db image: mariadb/server:10.3 environment: - MARIADB_DATABASE: db + MARIADB_DATABASE: dbtest MARIADB_USER: db MARIADB_PASSWORD: db MARIADB_ALLOW_EMPTY_PASSWORD: yes +volumes: + - name: texlive + host: + path: /usr/local/texlive + trigger: event: - push diff --git a/.env.example b/.env.example index 2106c72d..e0a9c4c5 100644 --- a/.env.example +++ b/.env.example @@ -11,7 +11,6 @@ DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel -DB_TEST_DATABASE=laraveltest DB_USERNAME=root DB_PASSWORD= @@ -39,17 +38,13 @@ AWS_SECRET_ACCESS_KEY= AWS_DEFAULT_REGION=us-east-1 AWS_BUCKET= -XELATEX= -PDFLATEX= +XELATEX_BIN= +PDFLATEX_BIN= PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= PUSHER_APP_CLUSTER=mt1 -NAMI_MGLNR=-1 -NAMI_GROUP=-1 -NAMI_PASSWORD=password - MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/.env.testing b/.env.testing deleted file mode 100644 index 1de6d057..00000000 --- a/.env.testing +++ /dev/null @@ -1,55 +0,0 @@ -APP_NAME=Scoutrobot -APP_ENV=local -APP_KEY= -APP_DEBUG=true -APP_URL=http://localhost -APP_MODE= - -LOG_CHANNEL=stack - -DB_CONNECTION=mysql -DB_HOST=127.0.0.1 -DB_PORT=3306 -DB_DATABASE=laravel -DB_TEST_DATABASE=laraveltest -DB_USERNAME=root -DB_PASSWORD= - -BROADCAST_DRIVER=log -CACHE_DRIVER=file -QUEUE_CONNECTION=sync -SESSION_DRIVER=file -SESSION_LIFETIME=120 - -REDIS_HOST=127.0.0.1 -REDIS_PASSWORD=null -REDIS_PORT=6379 - -MAIL_MAILER=smtp -MAIL_HOST=smtp.mailtrap.io -MAIL_PORT=2525 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null -MAIL_FROM_ADDRESS=null -MAIL_FROM_NAME="${APP_NAME}" - -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= -AWS_DEFAULT_REGION=us-east-1 -AWS_BUCKET= - -XELATEX= -PDFLATEX= - -PUSHER_APP_ID= -PUSHER_APP_KEY= -PUSHER_APP_SECRET= -PUSHER_APP_CLUSTER=mt1 - -NAMI_MGLNR=-1 -NAMI_GROUP=-1 -NAMI_PASSWORD=password - -MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" -MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/.gitignore b/.gitignore index f221667a..b9741ff1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ /vendor .env .env.backup +.env.testing .phpunit.result.cache Homestead.json Homestead.yaml diff --git a/config/database.php b/config/database.php index 9915ccb1..5301a807 100644 --- a/config/database.php +++ b/config/database.php @@ -3,7 +3,6 @@ use Illuminate\Support\Str; return [ - /* |-------------------------------------------------------------------------- | Default Database Connection Name @@ -34,7 +33,6 @@ return [ */ 'connections' => [ - 'sqlite' => [ 'driver' => 'sqlite', 'url' => env('DATABASE_URL'), @@ -63,26 +61,6 @@ return [ ]) : [], ], - 'mysqltest' => [ - 'driver' => 'mysql', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge').'test', - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'unix_socket' => env('DB_SOCKET', ''), - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', - 'prefix' => '', - 'prefix_indexes' => true, - 'strict' => true, - 'engine' => null, - 'options' => extension_loaded('pdo_mysql') ? array_filter([ - PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), - ]) : [], - ], - 'pgsql' => [ 'driver' => 'pgsql', 'url' => env('DATABASE_URL'), @@ -110,7 +88,6 @@ return [ 'prefix' => '', 'prefix_indexes' => true, ], - ], /* @@ -138,7 +115,6 @@ return [ */ 'redis' => [ - 'client' => env('REDIS_CLIENT', 'phpredis'), 'options' => [ @@ -161,7 +137,5 @@ return [ 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_CACHE_DB', '1'), ], - ], - ]; diff --git a/phpunit.xml b/phpunit.xml index 15025c89..df024514 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -23,7 +23,6 @@ -