adrema/.drone.yml

192 lines
5.3 KiB
YAML
Raw Normal View History

2021-08-22 11:59:01 +02:00
kind: pipeline
2022-11-22 15:00:04 +01:00
type: docker
name: default
2021-08-22 11:59:01 +02:00
2022-11-22 23:49:22 +01:00
workspace:
path: /drone/nami
2021-08-22 11:59:01 +02:00
steps:
2022-11-23 00:31:35 +01:00
- name: submodules
image: alpine/git
commands:
- git submodule update --init --recursive
2022-11-22 15:43:14 +01:00
2022-11-24 12:33:46 +01:00
- name: composer_dev
2022-11-23 00:31:35 +01:00
image: composer:2.2.7
commands:
2022-11-24 12:33:46 +01:00
- composer install --ignore-platform-reqs --dev
2022-11-23 00:36:10 +01:00
2022-11-24 11:15:43 +01:00
- name: mysql_healthcheck
image: mariadb/server:10.3
commands:
- while ! mysqladmin ping -h db -u db -pdb --silent; do sleep 1; done
2022-11-24 13:06:16 +01:00
- name: node
image: node:17.9.0-slim
commands:
2023-06-01 11:31:12 +02:00
- npm ci && npm run img && npm run prod && rm -R node_modules
2022-11-24 13:06:16 +01:00
2023-07-19 11:01:12 +02:00
- name: tests
2023-05-04 17:22:06 +02:00
image: php:8.1.6
commands:
2023-07-19 11:55:49 +02:00
- apt-get update > /dev/null
- apt-get install -y rsync libcurl3-dev apt-utils zlib1g-dev libpng-dev libicu-dev libonig-dev unzip > /dev/null
2023-07-19 12:57:58 +02:00
- apt-get install -y --no-install-recommends texlive-base texlive-latex-base texlive-pictures texlive-latex-extra texlive-lang-german texlive-plain-generic texlive-fonts-recommended texlive-fonts-extra > /dev/null
2023-07-19 11:55:49 +02:00
- docker-php-ext-install pdo_mysql curl gd intl mbstring pcntl > /dev/null
- pecl install redis && docker-php-ext-enable redis > /dev/null
2023-05-04 17:22:06 +02:00
- php artisan migrate
- php artisan test
- rm -f .env
2023-07-19 11:01:12 +02:00
- vendor/bin/phpstan analyse --memory-limit=2G
2023-05-04 17:22:06 +02:00
environment:
APP_NAME: Scoutrobot
APP_KEY:
from_secret: app_key
APP_ENV: local
APP_DEBUG: true
APP_URL: http://scoutrobot.test
APP_MODE: stamm
LOG_CHANNEL: stack
DB_CONNECTION: mysql
DB_HOST: db
REDIS_HOST: redis
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/bin/pdflatex
XELATEX_BIN: /usr/bin/xelatex
2022-11-24 15:36:59 +01:00
- name: composer_no_dev
image: composer:2.2.7
commands:
- composer install --ignore-platform-reqs --no-dev
2022-11-22 23:40:21 +01:00
- name: compress
2023-07-19 11:01:12 +02:00
image: php:8.1.6
2022-11-22 23:40:21 +01:00
commands:
- apt-get update -yqq
- apt-get install -yqq zip tar
2022-11-22 23:49:22 +01:00
- cd .. && tar -cvzf nami.tar.gz ./nami && mv nami.tar.gz nami/ && cd nami
2022-11-22 23:40:21 +01:00
when:
event: tag
2022-11-22 23:37:49 +01:00
- name: gitea_release
image: plugins/gitea-release
settings:
api_key:
from_secret: gitea_api_key
base_url: https://git.zoomyboy.de
2022-11-22 23:40:21 +01:00
files: ./nami.tar.gz
2022-11-22 17:27:25 +01:00
when:
2022-11-22 23:40:21 +01:00
event: tag
2022-11-22 17:27:25 +01:00
2022-11-23 00:40:35 +01:00
- name: deploy silva
2022-11-23 00:09:53 +01:00
image: drillster/drone-rsync
settings:
hosts: ['zoomyboy.de']
user: stammsilva
source: ./
2022-11-23 00:28:20 +01:00
target: ~/nami
exclude: ['.git']
2022-11-23 00:12:10 +01:00
key:
2023-05-08 17:11:45 +02:00
from_secret: deploy_private_key
2022-11-23 00:09:53 +01:00
script:
2022-11-23 00:36:10 +01:00
- cd ~/nami
- /usr/bin/php8.1 artisan migrate --force
2022-11-23 00:09:53 +01:00
when:
2022-11-23 00:40:35 +01:00
branch: master
event: push
- name: deploy lennep
image: drillster/drone-rsync
settings:
hosts: ['zoomyboy.de']
user: dpsg-lennep
source: ./
target: ~/nami
exclude: ['.git']
key:
2023-05-08 17:11:45 +02:00
from_secret: deploy_private_key
2022-11-23 00:40:35 +01:00
script:
- cd ~/nami
- /usr/bin/php8.1 artisan migrate --force
when:
branch: master
2022-11-23 00:09:53 +01:00
event: push
2022-11-24 11:15:43 +01:00
2023-02-26 22:30:19 +01:00
- name: deploy dpsgkoeln
image: drillster/drone-rsync
settings:
hosts: ['dpsg-koeln.de']
user: dpsg-koeln
source: ./
target: ~/adrema
exclude: ['.git']
key:
2023-05-08 17:11:45 +02:00
from_secret: deploy_private_key
2023-02-26 22:30:19 +01:00
script:
- cd ~/adrema
- /usr/bin/php8.1 artisan migrate --force
2023-03-04 09:58:19 +01:00
- sudo systemctl restart adrema-horizon
2023-02-26 22:30:19 +01:00
when:
branch: master
event: push
2023-06-15 15:19:54 +02:00
- name: deploy dpsgbergischland
image: drillster/drone-rsync
settings:
hosts: ['zoomyboy.de']
user: dpsgbergischland
source: ./
target: ~/adrema
exclude: ['.git']
key:
from_secret: deploy_private_key
script:
- cd ~/adrema
- /usr/bin/php8.1 artisan migrate --force
2023-06-15 15:40:58 +02:00
- sudo systemctl restart adremabl-horizon
2023-06-15 15:19:54 +02:00
when:
branch: master
event: push
2023-05-08 20:59:46 +02:00
- name: github push
image: alpine/git
environment:
SSH_KEY:
2023-05-08 16:09:40 +02:00
from_secret: github_private_key
2023-05-08 20:59:46 +02:00
commands:
- mkdir $HOME/.ssh
- git config core.sshCommand "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
- echo "$SSH_KEY"
- echo "$SSH_KEY" > $HOME/.ssh/id_rsa
- chmod 600 $HOME/.ssh/id_rsa
- git remote add gh git@github.com:zoomyboy/adrema.git
- git push -f gh HEAD:master
2023-05-08 16:09:40 +02:00
when:
2023-05-08 21:24:23 +02:00
branch: master
2023-05-08 16:09:40 +02:00
event: push
2022-11-24 11:15:43 +01:00
services:
- name: db
image: mariadb/server:10.3
environment:
2022-11-24 12:39:30 +01:00
MARIADB_DATABASE: db
2022-11-24 11:18:50 +01:00
MARIADB_USER: db
MARIADB_PASSWORD: db
MARIADB_ALLOW_EMPTY_PASSWORD: yes
2023-02-23 13:03:06 +01:00
- name: redis
image: redis
2022-11-24 11:15:43 +01:00
2022-11-22 23:37:49 +01:00
trigger:
event:
- push
- tag