Compare commits
1 commit
develop
...
feature/ci
Author | SHA1 | Date | |
---|---|---|---|
a2372894fd |
|
@ -3,6 +3,8 @@ pipeline:
|
||||||
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]
|
||||||
|
|
||||||
db-create:
|
db-create:
|
||||||
image: mariadb:10.3
|
image: mariadb:10.3
|
||||||
|
@ -12,6 +14,7 @@ pipeline:
|
||||||
- eval "$MYSQLDUMP" | mysql -hdb -uroot -proot app
|
- eval "$MYSQLDUMP" | mysql -hdb -uroot -proot app
|
||||||
when:
|
when:
|
||||||
branch: [master, master-*, develop, develop-*]
|
branch: [master, master-*, develop, develop-*]
|
||||||
|
event: [push, pull_request]
|
||||||
|
|
||||||
app-config:
|
app-config:
|
||||||
image: deblan/php:8.1
|
image: deblan/php:8.1
|
||||||
|
@ -21,12 +24,15 @@ pipeline:
|
||||||
- echo DATABASE_URL=mysql://root:root@db/app >> .env.local
|
- echo DATABASE_URL=mysql://root:root@db/app >> .env.local
|
||||||
when:
|
when:
|
||||||
branch: [master, master-*, develop, develop-*]
|
branch: [master, master-*, develop, develop-*]
|
||||||
|
event: [push, pull_request]
|
||||||
|
|
||||||
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]
|
||||||
|
|
||||||
db-migrate:
|
db-migrate:
|
||||||
image: deblan/php:8.1
|
image: deblan/php:8.1
|
||||||
|
@ -36,6 +42,7 @@ pipeline:
|
||||||
- ./bin/doctrine-migrate
|
- ./bin/doctrine-migrate
|
||||||
when:
|
when:
|
||||||
branch: [master, master-*, develop, develop-*, feature/*]
|
branch: [master, master-*, develop, develop-*, feature/*]
|
||||||
|
event: [push, pull_request]
|
||||||
|
|
||||||
app-jsroutes:
|
app-jsroutes:
|
||||||
image: deblan/php:8.1
|
image: deblan/php:8.1
|
||||||
|
@ -43,6 +50,7 @@ pipeline:
|
||||||
- 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:
|
when:
|
||||||
branch: [master, master-*, develop, develop-*, feature/*]
|
branch: [master, master-*, develop, develop-*, feature/*]
|
||||||
|
event: [push, pull_request]
|
||||||
|
|
||||||
node-build:
|
node-build:
|
||||||
image: node:16-alpine
|
image: node:16-alpine
|
||||||
|
@ -57,17 +65,38 @@ 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]
|
||||||
|
|
||||||
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]
|
||||||
|
|
||||||
|
create-artifact:
|
||||||
|
image: alpine:latest
|
||||||
|
volumes:
|
||||||
|
- /var/www/html/artifacts:/var/www/html/artifacts
|
||||||
|
commands:
|
||||||
|
- ARTIFACT_PATH="/var/www/html/artifacts/deblan/deblan.io-murph/$CI_COMMIT_BRANCH"
|
||||||
|
- test -d && rm -fr "$ARTIFACT_PATH"
|
||||||
|
- mkdir -p "$ARTIFACT_PATH"
|
||||||
|
- cp -R * .* "$ARTIFACT_PATH"
|
||||||
|
when:
|
||||||
|
event: [push, pull_request]
|
||||||
|
|
||||||
app-deploy:
|
app-deploy:
|
||||||
image: deblan/php:8.1
|
image: deblan/php:8.1
|
||||||
secrets: [ssh_user, ssh_host, ssh_priv_key, app_directory]
|
secrets: [ssh_user, ssh_host, ssh_priv_key, app_directory]
|
||||||
|
volumes:
|
||||||
|
- /var/www/html/artifacts:/var/www/html/artifacts
|
||||||
commands:
|
commands:
|
||||||
|
- cd "/var/www/html/artifacts/deblan/deblan.io-murph/$CI_COMMIT_BRANCH"
|
||||||
|
- ls -lah
|
||||||
|
- exit 1
|
||||||
- apt-get update && apt-get -y install rsync openssh-client
|
- apt-get update && apt-get -y install rsync openssh-client
|
||||||
- mkdir "$HOME/.ssh"
|
- mkdir "$HOME/.ssh"
|
||||||
- echo "$SSH_PRIV_KEY" > "$HOME/.ssh/id_ed25519"
|
- echo "$SSH_PRIV_KEY" > "$HOME/.ssh/id_ed25519"
|
||||||
|
|
Loading…
Reference in a new issue