-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
30 lines (29 loc) · 887 Bytes
/
Copy pathJenkinsfile
File metadata and controls
30 lines (29 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
pipeline {
agent any
stages {
stage('Hello') {
steps {
echo 'Hello from Jenkins'
}
}
stage('Connect to server') {
steps {
withCredentials([
sshUserPrivateKey(
credentialsId: '73d234d2-3f9d-44e9-97fc-b6317070b462',
keyFileVariable: 'SSH_PRIVATE_KEY'
)
]) {
sh '''#!/bin/bash
ssh -i "$SSH_PRIVATE_KEY" -p 2222 saccada@saccada.xyz << EOF
cd ~/ws/django-example-app
git pull --rebase
docker compose pull
docker compose down
docker compose up -d
'''
}
}
}
}
}