2022-11-22 15:00:04 +01:00
|
|
|
# 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
|
|
|
|
#
|
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
|
|
|
|
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
|
2022-11-22 15:43:14 +01:00
|
|
|
|
2022-11-23 00:31:35 +01:00
|
|
|
- name: composer
|
|
|
|
image: composer:2.2.7
|
|
|
|
commands:
|
|
|
|
- composer install --ignore-platform-reqs --no-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
|
|
|
|
|
|
|
|
- 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
|
|
|
|
|
2022-11-23 00:31:35 +01:00
|
|
|
- name: node
|
|
|
|
image: node:17.9.0-slim
|
|
|
|
commands:
|
|
|
|
- npm ci && npm run prod && npm run img && rm -R node_modules
|
2022-11-22 23:37:49 +01:00
|
|
|
|
2022-11-22 23:40:21 +01:00
|
|
|
- name: compress
|
|
|
|
image: php:7.3
|
|
|
|
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:
|
|
|
|
from_secret: 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:
|
|
|
|
from_secret: private_key
|
|
|
|
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
|
|
|
|
|
|
|
services:
|
|
|
|
- name: db
|
|
|
|
image: mariadb/server:10.3
|
|
|
|
environment:
|
|
|
|
MYSQL_DATABASE: db
|
|
|
|
MYSQL_USER: db
|
|
|
|
MYSQL_PASSWORD: db
|
|
|
|
|
2022-11-22 23:37:49 +01:00
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- tag
|