adrema/.drone.yml

145 lines
3.2 KiB
YAML

# kind: pipeline
# type: ssh
# name: scoutrobot
#
# server:
# host: zoomyboy.de
# user: stammsilva
# ssh_key:
# from_secret: private_key
#
# clone:
# disable: true
#
# steps:
# - name: master
# commands:
# - /usr/local/bin/deploy_scoutrobot_master
# when:
# branch:
# - master
# event:
# - push
#
kind: pipeline
type: docker
name: default
workspace:
path: /drone/nami
steps:
- name: submodules
image: alpine/git
environment:
SSH_KEY:
from_secret: private_key
KNOWN_HOSTS:
from_secret: known_hosts
commands:
- mkdir $HOME/.ssh
- echo "$SSH_KEY" > $HOME/.ssh/id_rsa
- echo "$KNOWN_HOSTS" > $HOME/.ssh/known_hosts
- cat $HOME/.ssh/known_hosts
- chmod 600 $HOME/.ssh/id_rsa
- git submodule update --init --recursive
- name: composer
image: composer:2.2.7
commands:
- composer install --ignore-platform-reqs --no-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
commands:
- vendor/bin/phpunit
- name: phpstan_tests
image: php:8.1.6
commands:
- vendor/bin/phpstan analyse
- name: node
image: node:17.9.0-slim
commands:
- npm ci && npm run prod && npm run img && rm -R node_modules
- name: compress
image: php:7.3
commands:
- apt-get update -yqq
- apt-get install -yqq zip tar
- cd .. && tar -cvzf nami.tar.gz ./nami && mv nami.tar.gz nami/ && cd nami
when:
event: tag
- 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
- name: deploy silva
image: drillster/drone-rsync
settings:
hosts: ['zoomyboy.de']
user: stammsilva
source: ./
target: ~/nami
exclude: ['.git']
key:
from_secret: private_key
script:
- cd ~/nami
- /usr/bin/php8.1 artisan migrate --force
when:
branch: master
event: push
- name: deploy lennep
image: drillster/drone-rsync
settings:
hosts: ['zoomyboy.de']
user: dpsg-lennep
source: ./
target: ~/nami
exclude: ['.git']
key:
from_secret: private_key
script:
- cd ~/nami
- /usr/bin/php8.1 artisan migrate --force
when:
branch: master
event: push
services:
- name: db
image: mariadb/server:10.3
environment:
MARIADB_DATABASE: db
MARIADB_USER: db
MARIADB_PASSWORD: db
MARIADB_ALLOW_EMPTY_PASSWORD: yes
trigger:
event:
- push
- tag