Add deployments

This commit is contained in:
Philipp Lang 2023-07-25 12:21:41 +02:00
parent 9d3abb4b23
commit 4d97c6ff8a
5 changed files with 102 additions and 81 deletions

View File

@ -93,6 +93,13 @@ steps:
when:
event: tag
- name: deploy
image: php:8.1.6
commands:
- ./vendor/bin/envoy run deploy
when:
event: tag
- name: composer_no_dev
image: composer:2.2.7
commands:
@ -117,76 +124,6 @@ steps:
when:
event: tag
- name: deploy silva
image: drillster/drone-rsync
settings:
hosts: ['zoomyboy.de']
user: stammsilva
source: ./
target: ~/nami
exclude: ['.git']
key:
from_secret: deploy_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: deploy_private_key
script:
- cd ~/nami
- /usr/bin/php8.1 artisan migrate --force
when:
branch: master
event: push
- name: deploy dpsgkoeln
image: drillster/drone-rsync
settings:
hosts: ['dpsg-koeln.de']
user: dpsg-koeln
source: ./
target: ~/adrema
exclude: ['.git']
key:
from_secret: deploy_private_key
script:
- cd ~/adrema
- /usr/bin/php8.1 artisan migrate --force
- sudo systemctl restart adrema-horizon
when:
branch: master
event: push
- 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
- sudo systemctl restart adremabl-horizon
when:
branch: master
event: push
- name: github push
image: alpine/git
environment:
@ -195,7 +132,6 @@ steps:
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

8
Envoy.blade.php Normal file
View File

@ -0,0 +1,8 @@
@servers(['docker' => ['stammsilva@zoomyboy.de']])
@task('deploy', ['on' => 'docker'])
cd $ADREMA_PATH
docker compose down
docker compose pull
docker compose up -d
@endtask

View File

@ -54,6 +54,7 @@
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/envoy": "^2.8",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/larastan": "^2.0",

73
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "4a9e7503e82efd2b15ee4f945a5f0856",
"content-hash": "e28b9b731dd4931fc9edbb41d09dc242",
"packages": [
{
"name": "beyondcode/laravel-dump-server",
@ -10693,6 +10693,68 @@
},
"time": "2020-07-09T08:09:16+00:00"
},
{
"name": "laravel/envoy",
"version": "v2.8.6",
"source": {
"type": "git",
"url": "https://github.com/laravel/envoy.git",
"reference": "24d2405dc785649684ccf531fddd2ac1f58ec861"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/envoy/zipball/24d2405dc785649684ccf531fddd2ac1f58ec861",
"reference": "24d2405dc785649684ccf531fddd2ac1f58ec861",
"shasum": ""
},
"require": {
"guzzlehttp/guzzle": "^6.0|^7.0",
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0",
"php": "^7.2|^8.0",
"symfony/console": "^4.3|^5.0|^6.0",
"symfony/process": "^4.3|^5.0|^6.0"
},
"require-dev": {
"phpunit/phpunit": "^8.0|^9.0"
},
"suggest": {
"ext-posix": "Required to determine the System user on Unix systems."
},
"bin": [
"bin/envoy"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"autoload": {
"psr-4": {
"Laravel\\Envoy\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "Elegant SSH tasks for PHP.",
"keywords": [
"laravel",
"ssh"
],
"support": {
"issues": "https://github.com/laravel/envoy/issues",
"source": "https://github.com/laravel/envoy/tree/v2.8.6"
},
"time": "2023-01-10T19:27:26+00:00"
},
{
"name": "laravel/sail",
"version": "v1.23.0",
@ -13238,14 +13300,7 @@
"time": "2023-05-30T22:51:52+00:00"
}
],
"aliases": [
{
"package": "zoomyboy/tex",
"version": "dev-main",
"alias": "1.0",
"alias_normalized": "1.0.0.0"
}
],
"aliases": [],
"minimum-stability": "dev",
"stability-flags": {
"zoomyboy/laravel-nami": 20,

View File

@ -13,6 +13,7 @@ services:
image: zoomyboy/adrema-app:latest
depends_on:
- db
command: /bin/entrypoint app
env_file:
- .app.env
environment:
@ -32,7 +33,27 @@ services:
depends_on:
- db
- php
command: /bin/horizon-entrypoint
command: /bin/entrypoint horizon
env_file:
- .app.env
environment:
DB_HOST: db
DB_DATABASE: db
DB_USERNAME: db
QUEUE_CONNECTION: redis
XELATEX_BIN: /usr/bin/xelatex
PDFLATEX_BIN: /usr/bin/pdflatex
REDIS_HOST: redis
volumes:
- ./data/storage:/app/storage/app
- ./cookies:/app/packages/laravel-nami/.cookies
schedule:
image: zoomyboy/adrema-app:latest
depends_on:
- db
- php
command: /bin/entrypoint schedule
env_file:
- .app.env
environment: