LOG4J2-2291: Add Jenkins pipeline for SBT build Add credential id and config for publishing snapshots.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j-scala/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j-scala/commit/e12bfd6a Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j-scala/tree/e12bfd6a Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j-scala/diff/e12bfd6a Branch: refs/heads/master Commit: e12bfd6a347513df441af1208f4c155c4a809f6d Parents: 722c1f5 Author: Matt Sicker <[email protected]> Authored: Fri Mar 30 13:59:50 2018 -0500 Committer: Matt Sicker <[email protected]> Committed: Fri Mar 30 13:59:50 2018 -0500 ---------------------------------------------------------------------- Jenkinsfile | 12 ++++++++---- build.sbt | 17 +++++++++++------ 2 files changed, 19 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j-scala/blob/e12bfd6a/Jenkinsfile ---------------------------------------------------------------------- diff --git a/Jenkinsfile b/Jenkinsfile index 032d4d1..13614bb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,12 +42,16 @@ pipeline { when { branch 'master' } steps { ansiColor('xterm') { - sh './sbt -batch "+ publish"' - // FIXME: LOG4J2-2291 - archiveArtifacts artifacts: 'target/repository/**' + withCredentials([ + usernamePassword( + credentialsId: 'logging-snapshots', + passwordVariable: 'NEXUS_PASSWORD', + usernameVariable: 'NEXUS_USERNAME') + ]) { + sh './sbt -batch "+ publish"' + } } } } } } - http://git-wip-us.apache.org/repos/asf/logging-log4j-scala/blob/e12bfd6a/build.sbt ---------------------------------------------------------------------- diff --git a/build.sbt b/build.sbt index 6dba52b..386e479 100644 --- a/build.sbt +++ b/build.sbt @@ -46,15 +46,20 @@ lazy val publishSettings = Seq( publishArtifact in Test := false, publishTo := { if (isSnapshot.value) { - // FIXME: LOG4J2-2291 - //Some("Apache Snapshots" at "https://repository.apache.org/content/repositories/snapshots") - Some(Resolver.file("file", file("target/repository/"))) + Some("Apache Snapshots" at "https://repository.apache.org/content/repositories/snapshots") } else { Some("Apache Releases" at "https://repository.apache.org/service/local/staging/deploy/maven2") } - } -// credentials += Credentials(Path.userHome / ".ivy2" / ".credentials") -// managedResources + }, + credentials ++= { + for { + username <- sys.env.get("NEXUS_USERNAME") + password <- sys.env.get("NEXUS_PASSWORD") + } yield Credentials("Sonatype Nexus Repository Manager", "repository.apache.org", username, password) + }.toList, + // FIXME: https://github.com/sbt/sbt/issues/3519 + updateOptions := updateOptions.value.withGigahorse(false) + // managedResources // resourceGenerators in Compile += inlineTask(Seq(file("LICENSE.txt"), file("NOTICE.txt"))) )
