mirror of
https://github.com/InsanusMokrassar/PlaguBot.git
synced 2026-11-02 09:33:07 +00:00
Refactor exec calls to use InjectedExecOps
This commit is contained in:
1 parent
23f8ad316c
commit
68150dd455
1 file changed
+9
-4
@@ -1,9 +1,15 @@
|
||||
interface InjectedExecOps {
|
||||
@Inject //@javax.inject.Inject
|
||||
ExecOperations getExecOps()
|
||||
}
|
||||
private String getCurrentVersionChangelog() {
|
||||
OutputStream changelogDataOS = new ByteArrayOutputStream()
|
||||
exec {
|
||||
|
||||
def injected = project.objects.newInstance(InjectedExecOps)
|
||||
injected.execOps.exec {
|
||||
commandLine 'chmod', "+x", './changelog_parser.sh'
|
||||
}
|
||||
exec {
|
||||
injected.execOps.exec {
|
||||
standardOutput = changelogDataOS
|
||||
commandLine './changelog_parser.sh', "${project.version}", 'CHANGELOG.md'
|
||||
}
|
||||
@@ -11,6 +17,7 @@ private String getCurrentVersionChangelog() {
|
||||
return changelogDataOS.toString().trim()
|
||||
}
|
||||
|
||||
|
||||
def githubTokenVariableName = "GITHUB_RELEASE_TOKEN"
|
||||
def githubTokenVariableFromEnv = System.getenv(githubTokenVariableName)
|
||||
|
||||
@@ -25,8 +32,6 @@ if (secretFile.exists() || project.hasProperty(githubTokenVariableName) || (gith
|
||||
githubRelease {
|
||||
token githubReleaseToken
|
||||
|
||||
releaseAssets.from('bot/build/distributions')
|
||||
|
||||
owner = "InsanusMokrassar"
|
||||
repo = "PlaguBot"
|
||||
|
||||
|
||||
Reference in new issue
Block a user