Skip to content

Commit

Permalink
Merge pull request #57 from eficode/2.1.10
Browse files Browse the repository at this point in the history
2.1.10
  • Loading branch information
farthinder authored May 23, 2024
2 parents 6f66b1b + 4c61ebc commit 13ef378
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.eficode.atlassian</groupId>
<artifactId>jirainstancemanager</artifactId>
<version>2.1.9</version>
<version>2.1.10</version>
<description>A groovy library for interacting with Jira REST API.</description>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,8 @@ final class JiraInstanceManagerRest {
assert installGroovySources("https://github.com/eficode/remoteSpock", deployBranch): "Error fetching and/or installing remoteSpock sources"
log.info("\tSuccessfully updated endpoint script")

String endpointFilePath = "com/eficode/atlassian/jira/remotespock/remoteSpockEndpoint.groovy"
//Replacement is needed because shading adds shaded/
String endpointFilePath = "com/eficode/atlassian/jira/remotespock/remoteSpockEndpoint.groovy".replace("shaded/", "")

if (withPlugins) {

Expand All @@ -1551,7 +1552,7 @@ final class JiraInstanceManagerRest {
String endpointBody = getScriptrunnerFile(endpointFilePath)
endpointBody = endpointBody.replaceFirst(/\/\/@With.*/, withPluginStatements.join("\n"))
assert updateScriptrunnerFile(endpointBody, endpointFilePath): "Error customizing remoteSpockEndpoint.groovy in JIRA"
log.debug("\t\tFinished customizing endpoint script")
log.debug("\t\tFinished customizing endpoint script: " + endpointFilePath)
}


Expand Down Expand Up @@ -1599,7 +1600,7 @@ final class JiraInstanceManagerRest {

log.info("Startign test: $fullClassName:${methodToRun ?: "(All)"}")
HttpResponse<Map> response = rest.post("/rest/scriptrunner/latest/custom/remoteSpock/spock/class")
.body(["className": fullClassName, "methodName": methodToRun ?: null, "outputType" : outputType.name(), "outputDirPath":outputDir])
.body(["className": fullClassName, "methodName": methodToRun ?: null, "outputType": outputType.name(), "outputDirPath": outputDir])
.contentType("application/json")
.cookie(acquireWebSudoCookies())
.connectTimeout(10 * 60000)
Expand Down Expand Up @@ -2251,6 +2252,13 @@ final class JiraInstanceManagerRest {

}

boolean installGrapeDependency(String group, String module, String version, String repoUrl = "", String classifier = "") {


return installGrapeDependency(group, module, version, [repoUrl], classifier)

}

/**
* Installs a Grape dependency
* Note clearCodeCaches() might needed to run after to apply changes
Expand All @@ -2261,16 +2269,19 @@ final class JiraInstanceManagerRest {
* @param classifier
* @return true on success
*/
boolean installGrapeDependency(String group, String module, String version, String repoUrl = "", String classifier = "") {
boolean installGrapeDependency(String group, String module, String version, ArrayList<String> repoUrls, String classifier = "") {

String installScript = ""

if (repoUrl) {

repoUrls?.findAll { it != "" }?.eachWithIndex { repoUrl, index ->

installScript += """
@GrabResolver(root='$repoUrl', name='$module-repo')
@GrabResolver(root='$repoUrl', name='$module-repo-$index')
"""
}


installScript += """
@Grab(group='$group', module='$module', version='$version' ${classifier ? ", classifier = '$classifier'" : ""})
Expand Down

0 comments on commit 13ef378

Please sign in to comment.