simplify git url

This commit is contained in:
Clemens Lauermann 2020-04-16 23:30:17 +02:00
parent 478488bdca
commit 0a9e95a679

8
Jenkinsfile vendored
View File

@ -8,7 +8,7 @@ pipeline {
parameters { parameters {
string(name: 'USERNAME', defaultValue: 'Username', description: 'Benutzername') string(name: 'USERNAME', defaultValue: 'Username', description: 'Benutzername')
password(name: 'PASSWORD', defaultValue: '', description: 'Passwort') password(name: 'PASSWORD', defaultValue: '', description: 'Passwort')
string(name: 'REPOSITORY', defaultValue: '.git', description: 'URL Git-Repository DA - default Wert: Baue Vorlage') string(name: 'REPOSITORY', defaultValue: '.git', description: 'URL Git-Repository DA \n default Wert: Baue Vorlage \n Ohne https://')
string(name: 'BRANCH', defaultValue: 'master', description: 'Branch') string(name: 'BRANCH', defaultValue: 'master', description: 'Branch')
string(name: 'PATH', defaultValue: '', description: "Pfad zur DA in git (z.B.: dipl/)") string(name: 'PATH', defaultValue: '', description: "Pfad zur DA in git (z.B.: dipl/)")
} }
@ -40,10 +40,8 @@ pipeline {
steps { steps {
cleanWs() cleanWs()
sh ''' sh '''
login_url_sub="https://"${params.USERNAME}":"${params.PASSWORD}"@" login_url_sub="https://"${params.USERNAME}":"${params.PASSWORD}"@"${params.REPOSITORY}
sub='https;//' git clone --recurse-submodules --remote-submodules ${login_url_sub} .
echo ${login_url_sub}
git clone --recurse-submodules --remote-submodules $(${params.REPOSITORY}/${sub}/${login_url_sub}) .
''' '''
} }
} }