Use Jenkins gitea-ssh credential for agent checkout
This commit is contained in:
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
@@ -14,15 +14,17 @@ pipeline {
|
|||||||
stages {
|
stages {
|
||||||
stage('Checkout') {
|
stage('Checkout') {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sshagent(credentials: ['gitea-ssh']) {
|
||||||
if [ -d .git ]; then
|
sh '''
|
||||||
git remote set-url origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git
|
if [ -d .git ]; then
|
||||||
git fetch --tags --force --progress origin
|
git remote set-url origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git
|
||||||
else
|
git fetch --tags --force --progress origin
|
||||||
git clone ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git .
|
else
|
||||||
fi
|
git clone ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git .
|
||||||
git checkout -f origin/master
|
fi
|
||||||
'''
|
git checkout -f origin/master
|
||||||
|
'''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
|
|||||||
Reference in New Issue
Block a user