adrema/.drone.yml

201 lines
5.7 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
2023-10-18 17:58:50 +02:00
image: mysql:oracle
2022-11-24 11:15:43 +01:00
commands:
2023-10-18 18:07:56 +02:00
- while ! mysqladmin ping -h db -u db -pdb --silent; do sleep 1; done
2022-11-24 11:15:43 +01:00
2024-06-27 10:26:52 +02:00
- name: ocdb_healthcheck
image: mysql:oracle
commands:
- while ! mysqladmin ping -h ownclouddb -u owncloud -powncloud --silent; do sleep 1; done
- name: oc_healthcheck
image: zoomyboy/adrema-base:latest
commands:
- while ! curl --silent 'http://owncloudserver:8080/ocs/v1.php/cloud/capabilities?format=json' -u admin:admin | grep '"status":"ok"'; do sleep 1; done
2022-11-24 13:06:16 +01:00
- name: node
2024-01-01 23:04:25 +01:00
image: node:18.13.0-slim
2022-11-24 13:06:16 +01:00
commands:
2024-04-08 18:28:31 +02:00
- npm ci && cd packages/adrema-form && npm ci && npm run build && cd ../../ && 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-08-15 16:42:15 +02:00
image: zoomyboy/adrema-base:latest
2023-05-04 17:22:06 +02:00
commands:
2023-10-18 18:30:18 +02:00
- php artisan migrate
- php artisan test
2023-05-04 17:22:06 +02:00
- rm -f .env
2023-10-18 18:30:18 +02:00
- vendor/bin/phpstan analyse
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
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
2024-01-26 00:18:46 +01:00
SCOUT_DRIVER: database
2024-01-28 11:43:06 +01:00
MEILI_MASTER_KEY: abc
2023-05-04 17:22:06 +02:00
2023-07-20 16:08:34 +02:00
- name: docker_app_push
image: plugins/docker
settings:
dockerfile: ./.docker/php.Dockerfile
repo: zoomyboy/adrema-app
username: zoomyboy
password:
from_secret: docker_hub_token
tags:
- latest
2023-07-20 16:57:30 +02:00
- ${DRONE_TAG}
2023-07-20 16:08:34 +02:00
pull_image: true
when:
event: tag
- name: docker_webservice_push
image: plugins/docker
settings:
dockerfile: ./.docker/nginx.Dockerfile
repo: zoomyboy/adrema-webservice
username: zoomyboy
password:
from_secret: docker_hub_token
tags:
- latest
2023-07-20 16:57:30 +02:00
- ${DRONE_TAG}
2023-07-20 16:08:34 +02:00
pull_image: true
when:
event: tag
2023-07-25 12:21:41 +02:00
- name: deploy
image: php:8.1.6
2023-07-25 12:27:34 +02:00
environment:
SSH_KEY:
2023-07-25 15:35:20 +02:00
from_secret: deploy_private_key
2023-07-25 12:21:41 +02:00
commands:
2023-07-25 12:59:32 +02:00
- apt-get update > /dev/null
2023-07-25 13:28:36 +02:00
- apt-get install -y openssh-client
2023-07-25 12:27:34 +02:00
- mkdir $HOME/.ssh
- echo "UserKnownHostsFile=/dev/null" >> $HOME/.ssh/config
- echo "StrictHostKeyChecking=no" >> $HOME/.ssh/config
- echo "$SSH_KEY" > $HOME/.ssh/id_rsa
- chmod 600 $HOME/.ssh/id_rsa
2023-07-25 12:21:41 +02:00
- ./vendor/bin/envoy run deploy
when:
event: tag
2023-07-25 12:27:34 +02:00
- name: github push
image: alpine/git
2023-08-16 01:27:07 +02:00
environment:
SSH_KEY:
from_secret: github_private_key
2023-07-25 12:27:34 +02:00
commands:
2023-08-16 01:27:07 +02:00
- mkdir $HOME/.ssh
- git config core.sshCommand "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
- 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-07-25 12:27:34 +02:00
when:
branch: master
event: push
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
2023-07-25 12:30:28 +02:00
- name: gitea_release
image: plugins/gitea-release
settings:
api_key:
from_secret: gitea_api_key
base_url: https://git.zoomyboy.de
files: ./nami.tar.gz
when:
event: tag
2022-11-24 11:15:43 +01:00
services:
- name: db
2023-10-31 09:26:48 +01:00
image: mariadb:10.6.5
2022-11-24 11:15:43 +01:00
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
2023-10-18 18:07:56 +02:00
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: yes
2023-02-23 13:03:06 +01:00
- name: redis
image: redis
2024-01-26 00:35:00 +01:00
- name: meilisearch
image: getmeili/meilisearch:v1.6
commands:
- meilisearch --master-key="abc"
2024-06-27 10:26:52 +02:00
- name: ownclouddb
image: mariadb:10.11
environment:
MYSQL_ROOT_PASSWORD: owncloud
MYSQL_USER: owncloud
MYSQL_PASSWORD: owncloud
MYSQL_DATABASE: owncloud
MARIADB_AUTO_UPGRADE: 1
- name: owncloudserver
image: owncloud/server:10.10.0
environment:
OWNCLOUD_DOMAIN: http://owncloudserver:8080
OWNCLOUD_TRUSTED_DOMAINS: owncloudserver
OWNCLOUD_DB_TYPE: mysql
OWNCLOUD_DB_NAME: owncloud
OWNCLOUD_DB_USERNAME: owncloud
OWNCLOUD_DB_PASSWORD: owncloud
OWNCLOUD_DB_HOST: ownclouddb
OWNCLOUD_ADMIN_USERNAME: admin
OWNCLOUD_ADMIN_PASSWORD: admin
OWNCLOUD_MYSQL_UTF8MB4: true
OWNCLOUD_REDIS_ENABLED: false
OWNCLOUD_REDIS_HOST: false
2022-11-24 11:15:43 +01:00
2022-11-22 23:37:49 +01:00
trigger:
event:
- push
- tag