suivi/.woodpecker/deploy.yml

25 lines
646 B
YAML
Raw Normal View History

2023-11-03 18:07:10 +01:00
variables:
- &volumes
2023-11-03 22:09:22 +01:00
- /data/${CI_REPO}:/builds
2023-11-03 18:07:10 +01:00
when:
event: [deployment]
skip_clone: true
steps:
2024-03-29 13:04:39 +01:00
"Deploy the app":
2023-11-03 18:07:10 +01:00
image: deblan/mage
secrets: [ssh_user, ssh_host, ssh_priv_key, app_directory]
volumes: *volumes
commands:
- cd "/builds/$CI_COMMIT_SHA"
- mkdir "$HOME/.ssh"
2024-03-22 10:15:32 +01:00
- echo "$SSH_PRIV_KEY" > "$HOME/.ssh/id_rsa"
2023-11-03 18:07:10 +01:00
- chmod 700 "$HOME/.ssh"
2024-03-22 10:15:32 +01:00
- chmod 600 "$HOME/.ssh/id_rsa"
2023-11-03 18:07:10 +01:00
- 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
2024-03-29 12:54:30 +01:00
- mage deploy "$CI_PIPELINE_DEPLOY_TARGET" || (cat /tmp/* && exit 1)