mirror of
https://github.com/simon987/dataarchivist.net.git
synced 2025-04-10 14:06:41 +00:00
Jenkins deploy
This commit is contained in:
parent
71145e3fa9
commit
c35fb5a79e
40
jenkins/Jenkinsfile
vendored
Normal file
40
jenkins/Jenkinsfile
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
def remote = [:]
|
||||
remote.name = 'remote'
|
||||
remote.host = env.DEPLOY_HOST
|
||||
remote.user = env.DEPLOY_USER
|
||||
remote.identityFile = '/var/lib/jenkins/.ssh/id_rsa'
|
||||
remote.knownHosts = '/var/lib/jenkins/.ssh/known_hosts'
|
||||
remote.allowAnyHosts = true
|
||||
remote.retryCount = 3
|
||||
remote.retryWaitSec = 3
|
||||
logLevel = 'FINER'
|
||||
|
||||
pipeline {
|
||||
agent none
|
||||
environment {
|
||||
HOME='.'
|
||||
}
|
||||
stages {
|
||||
stage('Build') {
|
||||
agent none
|
||||
steps {
|
||||
sh 'git submodule init && git submodule update --remote'
|
||||
sh 'hugo && mv public/ webroot/'
|
||||
stash includes: 'webroot/', name: 'webdist'
|
||||
}
|
||||
}
|
||||
stage('Deploy') {
|
||||
agent none
|
||||
steps {
|
||||
node('master') {
|
||||
unstash 'webdist'
|
||||
sshCommand remote: remote, command: "cd 'dataarchivist.net' && rm -rf webroot/* deploy.sh"
|
||||
sshPut remote: remote, from: 'webroot/', into: 'dataarchivist.net'
|
||||
sshCommand remote: remote, command: 'chmod -R 755 dataarchivist.net'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user