Commit 5799c71b authored by Andrew Nicols's avatar Andrew Nicols

Create a class for Repo under test

parent bdd68d09
package org.moodle.ci;
class Target {
protected String url
protected String credentialsId
protected String branch
}
......@@ -3,7 +3,13 @@ package org.moodle.ci.repositories;
class Repository {
protected String url
protected String credentialsId
def getUrl() {
return url
}
def getCredential() {
return credentialsId
}
}
package org.moodle.ci.repositories;
class Security extends Repository {
Security() {
this.url = "git@git.in.moodle.com:integration/security.git"
this.credentialsId = 'security'
}
}
def call(String task, String branch, String repo, String phpversion, String database, Boolean notify) {
def call(String task, org.moodle.ci.Target Target, String phpversion, String database, Boolean notify) {
pipeline {
agent {
label 'docker'
......@@ -19,7 +19,7 @@ def call(String task, String branch, String repo, String phpversion, String data
$class: 'GitSCM',
branches: [
[
name: "${branch}"
name: "${Target.branch}"
]
],
doGenerateSubmoduleConfigurations: false,
......@@ -39,9 +39,12 @@ def call(String task, String branch, String repo, String phpversion, String data
submoduleCfg: [],
userRemoteConfigs: [
[
url: "${repo}"
]
url: "${Target.repo}",
credentialsId: "${Target.credentialsId}"
],
[
]
userRemoteConfigs: [[credentialsId: 'security', url: 'a']]])
]
)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment