ci: add base of deploy
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Simon Vieille 2022-12-28 14:04:58 +01:00
parent 646d6799b1
commit c6e9a61f2a
Signed by: deblan
GPG key ID: 579388D585F70417
2 changed files with 8 additions and 8 deletions

View file

@ -1,10 +1,10 @@
magephp: magephp:
environments: environments:
prod: prod:
user: {ssh_user} user: ssh_user
from: ./ from: ./
to: {app_directory} to: app_directory
host_path: {app_directory} host_path: app_directory
rsync: '-avz --delete' rsync: '-avz --delete'
exclude: exclude:
- "/.git" - "/.git"
@ -19,7 +19,7 @@ magephp:
- "/var/log/*" - "/var/log/*"
- "/public/media" - "/public/media"
hosts: hosts:
- {ssh_host} - ssh_host
on-deploy: on-deploy:
- exec: { cmd: 'make clean', desc: 'cache' } - exec: { cmd: 'make clean', desc: 'cache' }
- exec: { cmd: 'make doctrine-migration', desc: 'migration' } - exec: { cmd: 'make doctrine-migration', desc: 'migration' }

View file

@ -35,7 +35,7 @@ pipeline:
- yarn - yarn
- npm run build - npm run build
deploy: deploy_prod:
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]
commands: commands:
@ -45,9 +45,9 @@ pipeline:
- chmod 600 "$HOME/.ssh/id_ed25519" - chmod 600 "$HOME/.ssh/id_ed25519"
- composer global require andres-montanez/magallanes - composer global require andres-montanez/magallanes
- cp .mage.yml.dist .mage.yml - cp .mage.yml.dist .mage.yml
- sed -i "s/{ssh_user}/$SSH_USER/g" .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/ssh_host/$SSH_HOST/g" .mage.yml
- sed -i "s/{app_directory}/$APP_DIRECTORY/g" .mage.yml - sed -i "s#app_directory#$APP_DIRECTORY#g" .mage.yml
- cat .mage.yml - cat .mage.yml
# - /root/.config/composer/vendor/bin/mage # - /root/.config/composer/vendor/bin/mage
# when: # when: