diff --git a/Jenkinsfile b/Jenkinsfile index b1e3133..51dd7f7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,13 +6,23 @@ pipeline { steps { sh '/bin/true' sshagent(credentials: ['baltimore-wiki']) { - sh ''' + 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 "testing" >> ~/test + ''' + 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 + ''' + } } } }