webhook-testing/Jenkinsfile

38 lines
1.1 KiB
Plaintext
Raw Normal View History

2022-02-16 21:32:32 +00:00
pipeline {
agent any
stages {
2022-02-17 18:37:44 +00:00
stage('Deploy Main branch') {
when {
branch 'main'
}
2022-02-16 21:32:32 +00:00
steps {
2022-02-17 01:43:46 +00:00
sshagent(credentials: ['baltimore-wiki']) {
2022-02-17 15:06:20 +00:00
sh '''
2022-02-17 01:43:46 +00:00
[ -d ~/.ssh ] || mkdir ~/.ssh && chmod 0700 ~/.ssh
ssh-keyscan -t rsa,dsa baltimore-wiki.lxd >> ~/.ssh/known_hosts
2022-02-17 18:37:44 +00:00
ssh mdbook@baltimore-wiki.lxd << EOF
2022-02-17 15:06:20 +00:00
echo "main branch" >> ~/test
EOF
'''
2022-02-17 18:37:44 +00:00
}
}
}
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
2022-02-17 15:06:20 +00:00
echo "testing branch" >> ~/test
2022-02-17 02:12:10 +00:00
EOF
2022-02-17 01:54:17 +00:00
'''
2022-02-16 21:32:32 +00:00
}
}
2022-02-17 18:37:44 +00:00
}
2022-02-16 21:32:32 +00:00
}
}