38 lines
1.1 KiB
Groovy
38 lines
1.1 KiB
Groovy
pipeline {
|
|
agent any
|
|
|
|
stages {
|
|
stage('Deploy Main branch') {
|
|
when {
|
|
branch 'main'
|
|
}
|
|
steps {
|
|
sshagent(credentials: ['baltimore-wiki']) {
|
|
sh '''
|
|
[ -d ~/.ssh ] || mkdir ~/.ssh && chmod 0700 ~/.ssh
|
|
ssh-keyscan -t rsa,dsa baltimore-wiki.lxd >> ~/.ssh/known_hosts
|
|
ssh mdbook@baltimore-wiki.lxd << EOF
|
|
echo "$(date): main branch" >> ~/test
|
|
EOF
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
stage('Deploy Testing branch') {
|
|
when {
|
|
branch 'testing'
|
|
}
|
|
steps {
|
|
sshagent(credentials: ['baltimore-wiki']) {
|
|
sh '''
|
|
[ -d ~/.ssh ] || mkdir ~/.ssh && chmod 0700 ~/.ssh
|
|
ssh-keyscan -t rsa,dsa baltimore-wiki.lxd >> ~/.ssh/known_hosts
|
|
ssh mdbook@baltimore-wiki.lxd << EOF
|
|
echo "$(date): testing branch" >> ~/test
|
|
EOF
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |