Skip to content

Commit

Permalink
Add Gitlab to VersionControl (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried authored and lihaoyi committed Dec 7, 2018
1 parent 3cc21b2 commit 2206994
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scalalib/src/mill/scalalib/publish/VersionControl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,20 @@ case class SCM(
)

object VersionControl {
def github(owner: String, repo: String, tag: Option[String] = None): VersionControl =
def github(owner: String, repo: String, tag: Option[String] = None): VersionControl =
VersionControl(
browsableRepository = Some(s"https://github.com/$owner/$repo"),
connection = Some(VersionControlConnection.gitGit("github.com", s"$owner/$repo.git")),
developerConnection = Some(VersionControlConnection.gitSsh("github.com", s":$owner/$repo.git", username = Some("git"))),
tag = tag
)
def gitlab(owner: String, repo: String, tag: Option[String] = None): VersionControl =
VersionControl(
browsableRepository = Some(s"https://gitlab.com/$owner/$repo"),
connection = Some(VersionControlConnection.gitGit("gitlab.com", s"$owner/$repo.git")),
developerConnection = Some(VersionControlConnection.gitSsh("gitlab.com", s":$owner/$repo.git", username = Some("git"))),
tag = tag
)
}

object VersionControlConnection {
Expand Down Expand Up @@ -70,7 +77,7 @@ object VersionControlConnection {

def gitGit(hostname: String,
path: String = "",
port: Option[Int] = None): String =
port: Option[Int] = None): String =
network("git", "git", hostname, path, port = port)

def gitHttp(hostname: String,
Expand Down

0 comments on commit 2206994

Please sign in to comment.