Skip to content

Commit

Permalink
Update drone rules
Browse files Browse the repository at this point in the history
  • Loading branch information
et-nik committed Sep 4, 2021
1 parent cc65a3c commit d819651
Showing 1 changed file with 34 additions and 14 deletions.
48 changes: 34 additions & 14 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@ steps:

- name: tests
image: knik/php:7.3-fpm-stretch
environment:
APP_KEY: base64:QhlU2DzlLyaYVHzlh3RlSipTtBhwb3/5jPKbctx2lP8=
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: homestead
DB_USERNAME: homestead
DB_PASSWORD: secret
commands:
- mv .env.example .env
- sed -i "s/DB_HOST.*$/DB_HOST=db/" .env
- php artisan key:generate --force
- php artisan migrate:fresh --seed
- vendor/bin/phpunit --verbose
- sed -i "s/DB_HOST.*$/DB_HOST=127\.0\.0\.1/" .env
- mv .env .env.example
- rm -rf storage/app/certs
- rm -rf storage/framework/cache/data/*
- rm -rf storage/framework/sessions/*
Expand All @@ -38,15 +41,17 @@ steps:
image: knik/php:7.3-fpm-buster
environment:
SELENIUM_URL: http://selenium:4444/wd/hub
APP_KEY: base64:QhlU2DzlLyaYVHzlh3RlSipTtBhwb3/5jPKbctx2lP8=
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: homestead
DB_USERNAME: homestead
DB_PASSWORD: secret
APP_URL: http://webserver
commands:
- mv .env.example .env
- sed -i "s/DB_HOST.*$/DB_HOST=db/" .env
- sed -i "s/APP_URL.*$/APP_URL=http:\\/\\/webserver/" .env
- ./artisan migrate:fresh --seed
- ./artisan dusk --debug
- sed -i "s/APP_URL.*$/APP_URL=http:\\/\\/localhost/" .env
- sed -i "s/DB_HOST.*$/DB_HOST=127\.0\.0\.1/" .env
- mv .env .env.example
- rm -rf storage/app/certs
- rm -rf storage/framework/cache/data/*
- rm -rf storage/framework/sessions/*
Expand Down Expand Up @@ -81,6 +86,15 @@ steps:

- name: archive-shared
image: knik/php:7.3-fpm-stretch
environment:
APP_KEY: base64:QhlU2DzlLyaYVHzlh3RlSipTtBhwb3/5jPKbctx2lP8=
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: homestead
DB_USERNAME: homestead
DB_PASSWORD: secret
APP_URL: http://webserver
commands:
- apt update && apt -y install default-mysql-client zip unzip rsync
- rm -rf storage/app/certs
Expand All @@ -90,10 +104,7 @@ steps:
- rm -rf storage/debugbar/*
- rm -rf storage/logs/*
- mkdir -p gameap-shared/upload
- mv .env.example .env
- sed -i "s/DB_HOST.*$/DB_HOST=db/" .env
- php artisan migrate:fresh --seed --force
- sed -i "s/DB_HOST.*$/DB_HOST=127\.0\.0\.1/" .env
- mysqldump -h db -u homestead -p --password=secret homestead > gameap.sql
- curl -O http://packages.gameap.ru/gameap/shared-build-artifacts.zip
- rsync -rl --exclude=/gameap --exclude=/node_modules --exclude=/publish --exclude=/shared-build-artifacts.zip ./ gameap-shared/upload/
Expand Down Expand Up @@ -140,6 +151,7 @@ steps:
source:
- tests/Browser/screenshots/*
- tests/Browser/console/*
- storage/logs/*
- /var/log/gameap-daemon/*
target: /${DRONE_BRANCH}/${DRONE_BUILD_NUMBER}
path_style: true
Expand All @@ -161,6 +173,14 @@ services:

- name: webserver
image: knik/php:7.4-cli-alpine
environment:
APP_KEY: base64:QhlU2DzlLyaYVHzlh3RlSipTtBhwb3/5jPKbctx2lP8=
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: homestead
DB_USERNAME: homestead
DB_PASSWORD: secret
commands:
- while [[ ! -f composer_installed ]]; do sleep 2; echo "Waiting composer..."; done;
- ./artisan serve --host=webserver --port=80
Expand Down

0 comments on commit d819651

Please sign in to comment.