mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2025-04-18 16:47:06 +00:00
test vars from github
This commit is contained in:
parent
693b7e6d71
commit
c0470dfaf0
2
.github/workflows/maven.yml
vendored
2
.github/workflows/maven.yml
vendored
@ -22,7 +22,7 @@ jobs:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
- name: Build with gradle
|
||||
run: ./gradlew build
|
||||
run: ./gradlew build -Dbranch=${{ github.ref }}
|
||||
- name: shadowJar with gradle
|
||||
run: ./gradlew shadowJar
|
||||
- name: Upload Bungee
|
||||
|
@ -32,20 +32,31 @@ description = "RedisBungee interafaces"
|
||||
blossom {
|
||||
replaceToken("@version@", "$version")
|
||||
// GIT
|
||||
val branchStdout = ByteArrayOutputStream()
|
||||
rootProject.exec {
|
||||
standardOutput = branchStdout
|
||||
commandLine("git", "branch", "--show-current")
|
||||
var branch: String = ""
|
||||
var commit: String = ""
|
||||
val branchProp = System.getProperty("branch")
|
||||
if (branchProp != null) {
|
||||
branch = branchProp;
|
||||
} else {
|
||||
val branchStdout = ByteArrayOutputStream()
|
||||
rootProject.exec {
|
||||
standardOutput = branchStdout
|
||||
commandLine("git", "branch", "--show-current")
|
||||
}
|
||||
branch = branchStdout.toString().replace("\n", "")
|
||||
branchStdout.close()
|
||||
}
|
||||
val commitStdout = ByteArrayOutputStream()
|
||||
rootProject.exec {
|
||||
standardOutput = commitStdout
|
||||
commandLine("git", "rev-parse", "HEAD")
|
||||
}
|
||||
replaceToken("@git_branch@", "$branchStdout".replace("\n", ""))
|
||||
replaceToken("@git_commit@", "$commitStdout".replace("\n", ""))
|
||||
branchStdout.close()
|
||||
commit = "$commitStdout".replace("\n", "");
|
||||
commitStdout.close()
|
||||
|
||||
replaceToken("@git_branch@", branch)
|
||||
replaceToken("@git_commit@", commit)
|
||||
|
||||
}
|
||||
|
||||
java {
|
||||
|
Loading…
Reference in New Issue
Block a user