webhook-testing/Jenkinsfile

30 lines
845 B
Groovy

pipeline {
agent any
stages {
stage('Do nothing') {
steps {
sh '/bin/true'
sshagent(credentials: ['baltimore-wiki']) {
sh '''
[ -d ~/.ssh ] || mkdir ~/.ssh && chmod 0700 ~/.ssh
ssh-keyscan -t rsa,dsa baltimore-wiki.lxd >> ~/.ssh/known_hosts
'''
if(env.BRANCHNAME == 'main') {
sh '''
ssh mdbook@baltimore-wiki.lxd << EOF
echo "main branch" >> ~/test
EOF
'''
if(env.BRANCHNAME == 'testing') {
sh '''
ssh mdbook@baltimore-wiki.lxd << EOF
echo "testing branch" >> ~/test
EOF
'''
}
}
}
}
}
}