feat: Déploiement via SSH dans .gitlab-ci.yml
This commit is contained in:
@@ -89,8 +89,18 @@ analyse_code:
|
||||
|
||||
deploy_application:
|
||||
stage: deploy
|
||||
before_script:
|
||||
- apt-get update --fix-missing
|
||||
- apt-get install -qq git
|
||||
# Setup SSH deploy keys
|
||||
- 'which ssh-agent || ( apt-get install -qq openssh-client )'
|
||||
- eval $(ssh-agent -s)
|
||||
- ssh-add <(echo "$SSH_PRIVATE_KEY")
|
||||
- mkdir -p ~/.ssh
|
||||
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
|
||||
script:
|
||||
- echo "Starting deployment stage..."
|
||||
- ssh bot@35.204.191.160 "cd /var/www/mainframe/app && nohup sh ./update.sh"
|
||||
- echo "Application deployed successfully."
|
||||
needs:
|
||||
- analyse_code # Ce job dépend maintenant du job 'analyse_code'
|
||||
|
||||
Reference in New Issue
Block a user