update ci
This commit is contained in:
parent
5612ea2acd
commit
f81e2a99a7
|
@ -1,17 +1,17 @@
|
||||||
variables:
|
variables:
|
||||||
- &volumes
|
- &volumes
|
||||||
- node16_cache:/root/.npm
|
|
||||||
- node16_cache:/root/.npm
|
- node16_cache:/root/.npm
|
||||||
- /data/deblan/deblan.io-murph:/data/deblan/deblan.io-murph
|
- /data/deblan/deblan.io-murph:/data/deblan/deblan.io-murph
|
||||||
|
|
||||||
|
when:
|
||||||
|
event: [push, pull_request, tag, manual]
|
||||||
|
branch: [master, master-*, develop, develop-*, feature/*]
|
||||||
|
|
||||||
pipeline:
|
pipeline:
|
||||||
db-wait:
|
db-wait:
|
||||||
image: gitnet.fr/deblan/timeout:latest
|
image: gitnet.fr/deblan/timeout:latest
|
||||||
commands:
|
commands:
|
||||||
- /bin/timeout -t 30 -v -c 'while true; do nc -z -v db 3306 2>&1 | grep succeeded && exit 0; sleep 0.5; done'
|
- /bin/timeout -t 30 -v -c 'while true; do nc -z -v db 3306 2>&1 | grep succeeded && exit 0; sleep 0.5; done'
|
||||||
when:
|
|
||||||
event: [push, pull_request, tag, manual]
|
|
||||||
branch: [master, master-*, develop, develop-*, feature/*]
|
|
||||||
|
|
||||||
db-create:
|
db-create:
|
||||||
image: mariadb:10.3
|
image: mariadb:10.3
|
||||||
|
@ -19,9 +19,6 @@ pipeline:
|
||||||
commands:
|
commands:
|
||||||
- mysql -hdb -uroot -proot -e "CREATE DATABASE app"
|
- mysql -hdb -uroot -proot -e "CREATE DATABASE app"
|
||||||
- eval "$MYSQLDUMP" | mysql -hdb -uroot -proot app
|
- eval "$MYSQLDUMP" | mysql -hdb -uroot -proot app
|
||||||
when:
|
|
||||||
event: [push, pull_request, tag, manual]
|
|
||||||
branch: [master, master-*, develop, develop-*, feature/*]
|
|
||||||
|
|
||||||
app-config:
|
app-config:
|
||||||
image: deblan/php:8.1
|
image: deblan/php:8.1
|
||||||
|
@ -29,18 +26,12 @@ pipeline:
|
||||||
- echo APP_ENV=prod >> .env.local
|
- echo APP_ENV=prod >> .env.local
|
||||||
- echo APP_SECRET=$(openssl rand -hex 32) >> .env.local
|
- echo APP_SECRET=$(openssl rand -hex 32) >> .env.local
|
||||||
- echo DATABASE_URL=mysql://root:root@db/app >> .env.local
|
- echo DATABASE_URL=mysql://root:root@db/app >> .env.local
|
||||||
when:
|
|
||||||
event: [push, pull_request, tag, manual]
|
|
||||||
branch: [master, master-*, develop, develop-*, feature/*]
|
|
||||||
|
|
||||||
php-composer:
|
php-composer:
|
||||||
image: deblan/php:8.1
|
image: deblan/php:8.1
|
||||||
commands:
|
commands:
|
||||||
- apt-get update && apt-get -y install git
|
- apt-get update && apt-get -y install git
|
||||||
- composer install --no-scripts
|
- composer install --no-scripts
|
||||||
when:
|
|
||||||
event: [push, pull_request, tag, manual]
|
|
||||||
branch: [master, master-*, develop, develop-*, feature/*]
|
|
||||||
|
|
||||||
db-migrate:
|
db-migrate:
|
||||||
image: deblan/php:8.1
|
image: deblan/php:8.1
|
||||||
|
@ -48,17 +39,11 @@ pipeline:
|
||||||
- PHP=php
|
- PHP=php
|
||||||
commands:
|
commands:
|
||||||
- ./bin/doctrine-migrate
|
- ./bin/doctrine-migrate
|
||||||
when:
|
|
||||||
event: [push, pull_request, tag, manual]
|
|
||||||
branch: [master, master-*, develop, develop-*, feature/*]
|
|
||||||
|
|
||||||
app-jsroutes:
|
app-jsroutes:
|
||||||
image: deblan/php:8.1
|
image: deblan/php:8.1
|
||||||
commands:
|
commands:
|
||||||
- php bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json
|
- php bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json
|
||||||
when:
|
|
||||||
event: [push, pull_request, tag, manual]
|
|
||||||
branch: [master, master-*, develop, develop-*, feature/*]
|
|
||||||
|
|
||||||
node-build:
|
node-build:
|
||||||
image: node:16-alpine
|
image: node:16-alpine
|
||||||
|
@ -74,18 +59,12 @@ pipeline:
|
||||||
- yarn
|
- yarn
|
||||||
- test -f public/js/fos_js_routes.json || echo "{}" > public/js/fos_js_routes.json
|
- test -f public/js/fos_js_routes.json || echo "{}" > public/js/fos_js_routes.json
|
||||||
- npm run build
|
- npm run build
|
||||||
when:
|
|
||||||
event: [push, pull_request, tag, manual]
|
|
||||||
branch: [master, master-*, develop, develop-*, feature/*]
|
|
||||||
|
|
||||||
security-check:
|
security-check:
|
||||||
image: gitnet.fr/deblan/osv-detector:v0.9
|
image: gitnet.fr/deblan/osv-detector:v0.9
|
||||||
commands:
|
commands:
|
||||||
- osv-detector composer.lock yarn.lock
|
- osv-detector composer.lock yarn.lock
|
||||||
failure: ignore
|
failure: ignore
|
||||||
when:
|
|
||||||
event: [push, pull_request, tag, manual]
|
|
||||||
branch: [master, master-*, develop, develop-*, feature/*]
|
|
||||||
|
|
||||||
cache-build:
|
cache-build:
|
||||||
image: deblan/php:8.1
|
image: deblan/php:8.1
|
||||||
|
@ -93,29 +72,6 @@ pipeline:
|
||||||
commands:
|
commands:
|
||||||
- cd /data/deblan/deblan.io-murph/
|
- cd /data/deblan/deblan.io-murph/
|
||||||
- mv "$CI_WORKSPACE" "$CI_COMMIT_SHA"
|
- mv "$CI_WORKSPACE" "$CI_COMMIT_SHA"
|
||||||
when:
|
|
||||||
event: [push, pull_request, tag, manual]
|
|
||||||
branch: [master, master-*, develop, develop-*, feature/*]
|
|
||||||
|
|
||||||
app-deploy:
|
|
||||||
image: deblan/php:8.1
|
|
||||||
secrets: [ssh_user, ssh_host, ssh_priv_key, app_directory]
|
|
||||||
volumes: *volumes
|
|
||||||
commands:
|
|
||||||
- apt-get update && apt-get -y install rsync openssh-client
|
|
||||||
- cd "/data/deblan/deblan.io-murph/$CI_COMMIT_SHA"
|
|
||||||
- mkdir "$HOME/.ssh"
|
|
||||||
- echo "$SSH_PRIV_KEY" > "$HOME/.ssh/id_ed25519"
|
|
||||||
- chmod 700 "$HOME/.ssh"
|
|
||||||
- chmod 600 "$HOME/.ssh/id_ed25519"
|
|
||||||
- composer global require andres-montanez/magallanes
|
|
||||||
- cp .mage.yml.dist .mage.yml
|
|
||||||
- sed -i "s/ssh_user/$SSH_USER/g" .mage.yml
|
|
||||||
- sed -i "s/ssh_host/$SSH_HOST/g" .mage.yml
|
|
||||||
- sed -i "s#app_directory#$APP_DIRECTORY#g" .mage.yml
|
|
||||||
- /root/.config/composer/vendor/bin/mage deploy "$CI_BUILD_DEPLOY_TARGET"
|
|
||||||
when:
|
|
||||||
event: [deployment]
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
25
.woodpecker/deploy.yml
Normal file
25
.woodpecker/deploy.yml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
variables:
|
||||||
|
- &volumes
|
||||||
|
- /data/deblan/deblan.io-murph:/data/deblan/deblan.io-murph
|
||||||
|
|
||||||
|
when:
|
||||||
|
event: [deployment]
|
||||||
|
|
||||||
|
pipeline:
|
||||||
|
app-deploy:
|
||||||
|
image: deblan/php:8.1
|
||||||
|
secrets: [ssh_user, ssh_host, ssh_priv_key, app_directory]
|
||||||
|
volumes: *volumes
|
||||||
|
commands:
|
||||||
|
- apt-get update && apt-get -y install rsync openssh-client
|
||||||
|
- cd "/data/deblan/deblan.io-murph/$CI_COMMIT_SHA"
|
||||||
|
- mkdir "$HOME/.ssh"
|
||||||
|
- echo "$SSH_PRIV_KEY" > "$HOME/.ssh/id_ed25519"
|
||||||
|
- chmod 700 "$HOME/.ssh"
|
||||||
|
- chmod 600 "$HOME/.ssh/id_ed25519"
|
||||||
|
- composer global require andres-montanez/magallanes
|
||||||
|
- cp .mage.yml.dist .mage.yml
|
||||||
|
- sed -i "s/ssh_user/$SSH_USER/g" .mage.yml
|
||||||
|
- sed -i "s/ssh_host/$SSH_HOST/g" .mage.yml
|
||||||
|
- sed -i "s#app_directory#$APP_DIRECTORY#g" .mage.yml
|
||||||
|
- /root/.config/composer/vendor/bin/mage deploy "$CI_BUILD_DEPLOY_TARGET"
|
Loading…
Reference in a new issue