Hopefully a working jenkins file
Gitea/webhook-testing/pipeline/head This commit looks good
Details
Gitea/webhook-testing/pipeline/head This commit looks good
Details
parent
3613d83934
commit
e52a9bf189
|
@ -2,30 +2,37 @@ pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Do nothing') {
|
stage('Deploy Main branch') {
|
||||||
|
when {
|
||||||
|
branch 'main'
|
||||||
|
}
|
||||||
steps {
|
steps {
|
||||||
sh '/bin/true'
|
|
||||||
sshagent(credentials: ['baltimore-wiki']) {
|
sshagent(credentials: ['baltimore-wiki']) {
|
||||||
sh '''
|
sh '''
|
||||||
[ -d ~/.ssh ] || mkdir ~/.ssh && chmod 0700 ~/.ssh
|
[ -d ~/.ssh ] || mkdir ~/.ssh && chmod 0700 ~/.ssh
|
||||||
ssh-keyscan -t rsa,dsa baltimore-wiki.lxd >> ~/.ssh/known_hosts
|
ssh-keyscan -t rsa,dsa baltimore-wiki.lxd >> ~/.ssh/known_hosts
|
||||||
'''
|
ssh mdbook@baltimore-wiki.lxd << EOF
|
||||||
if(env.BRANCHNAME == 'main') {
|
|
||||||
sh '''
|
|
||||||
ssh mdbook@baltimore-wiki.lxd << EOF
|
|
||||||
echo "main branch" >> ~/test
|
echo "main branch" >> ~/test
|
||||||
EOF
|
EOF
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
if(env.BRANCHNAME == 'testing') {
|
}
|
||||||
sh '''
|
}
|
||||||
ssh mdbook@baltimore-wiki.lxd << 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 "testing branch" >> ~/test
|
echo "testing branch" >> ~/test
|
||||||
EOF
|
EOF
|
||||||
'''
|
'''
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue