Skip to content

Commit 1112193

Browse files
Add gitlab scm function (#34)
* Add gitlab scm function * Fix gitlab name typo * Make it member function instead of extension
1 parent c6cfeb9 commit 1112193

File tree

1 file changed

+8
-1
lines changed
  • deployer/src/main/kotlin/io/deepmedia/tools/deployer/model

1 file changed

+8
-1
lines changed

deployer/src/main/kotlin/io/deepmedia/tools/deployer/model/Scm.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ open class Scm @Inject constructor(objects: ObjectFactory) {
2929
sourceUrl { _ /* tag */ -> "https://bitbucket.org/$user/$repository/src/" }
3030
}
3131

32+
fun fromGitlab(user: String, repository: String) {
33+
url.set("https://gitlab.com/$user/$repository")
34+
connection.set("scm:git:git://gitlab.com/$user/$repository.git")
35+
developerConnection.set("scm:git:ssh://gitlab.com:$user/$repository.git")
36+
sourceUrl { tag -> "https://gitlab.com/$user/$repository/tree/$tag" }
37+
}
38+
3239
internal fun fallback(to: Scm) {
3340
url.convention(to.url)
3441
connection.convention(to.connection)
@@ -62,4 +69,4 @@ interface ScmScope {
6269
scm.connection.set(connection)
6370
scm.developerConnection.set(developerConnection)
6471
}
65-
}
72+
}

0 commit comments

Comments
 (0)