Attempt to deploy
This commit is contained in:
parent
f98ab2896b
commit
ae6a7a0ae1
25
Jenkinsfile
vendored
25
Jenkinsfile
vendored
@ -31,20 +31,23 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Deploy') {
|
stage('Deploy to printer1') {
|
||||||
steps {
|
steps {
|
||||||
echo 'Deploying application...'
|
script {
|
||||||
sshagent(['printer1.tombutcher.local']) {
|
def remote = [
|
||||||
sh '''
|
name: 'printer1',
|
||||||
# Create backup of current build
|
host: 'printer1.tombutcher.local',
|
||||||
if [ -d /path/to/app/build ]; then mv /path/to/app/build /path/to/app/build.backup; fi
|
user: 'ci',
|
||||||
|
port: 22,
|
||||||
|
credentialsId: 'ci_ssh',
|
||||||
|
allowAnyHosts: true
|
||||||
|
]
|
||||||
|
|
||||||
# Transfer new build
|
// Upload the build folder
|
||||||
scp -r build/* /path/to/app/build/
|
sshPut remote: remote, from: 'build/', into: '/srv/farmcontrol-server/', flatten: false
|
||||||
|
|
||||||
# Restart the service
|
// Restart the service
|
||||||
sudo systemctl restart your-service-name
|
sshCommand remote: remote, command: 'sudo /bin/systemctl restart farmcontrol-server.service'
|
||||||
'''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user