-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitProperties deles nå i kontroller-modulen. Refakturert ut typescrip…
…t-kode til utils-fil.
- Loading branch information
1 parent
178aa2b
commit 6890806
Showing
23 changed files
with
202 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
kontroller/src/main/kotlin/no/ssb/kostra/felles/git/GitProperties.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package no.ssb.kostra.felles.git | ||
|
||
data class GitProperties( | ||
val tags: String | ||
) |
15 changes: 15 additions & 0 deletions
15
kontroller/src/main/kotlin/no/ssb/kostra/felles/git/GitPropertyLoader.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package no.ssb.kostra.felles.git | ||
|
||
import java.util.* | ||
|
||
object GitPropertiesLoader { | ||
const val DEFAULT_GIT_PROPERTIES_FILENAME = "/git.properties" | ||
const val NOT_AVAILABLE_VALUE = "" | ||
private const val GIT_TAGS_KEY = "git.tags" | ||
|
||
@JvmStatic | ||
fun loadGitProperties(gitPropertiesFilename: String): GitProperties = | ||
this::class.java.getResourceAsStream(gitPropertiesFilename)?.use { | ||
GitProperties(tags = Properties().apply { load(it) }.getProperty(GIT_TAGS_KEY, NOT_AVAILABLE_VALUE)) | ||
} ?: GitProperties(tags = NOT_AVAILABLE_VALUE) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
git.tags=LOCAL-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
web/src/main/kotlin/no/ssb/kostra/web/status/GitProperties.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.