Skip to content

Commit

Permalink
Fixing passphrase (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexflav23 authored Aug 15, 2016
1 parent 82467ed commit 2f5473a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ lazy val phantom = (project in file("."))
sharedSettings ++ noPublishSettings
).settings(
name := "phantom",
moduleName := "phantom"
moduleName := "phantom",
pgpPassphrase := PublishTasks.pgpPass
).aggregate(
fullProjectList: _*
)
Expand Down
1 change: 1 addition & 0 deletions build/publish_develop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ then

echo "Setting MAVEN_PUBLISH mode to true"
export MAVEN_PUBLISH="true"
export pgp_passphrase=${maven_password}
sbt +publishSigned sonatypeReleaseAll

else
Expand Down
6 changes: 4 additions & 2 deletions project/PublishTasks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import sbt.Keys._
import sbt._
import com.typesafe.sbt.pgp.PgpKeys._

import scala.util.Properties

object PublishTasks {


Expand Down Expand Up @@ -61,7 +63,7 @@ object PublishTasks {
licenses += ("Apache-2.0", url("https://github.com/outworkers/phantom/blob/develop/LICENSE.txt"))
) ++ defaultPublishingSettings

lazy val pgpPass = Option(System.getenv("maven_password"))
lazy val pgpPass = Properties.envOrNone("pgp_passphrase").map(_.toCharArray)

lazy val mavenPublishingSettings: Seq[Def.Setting[_]] = Seq(
credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"),
Expand All @@ -70,7 +72,7 @@ object PublishTasks {
if (RunningUnderCi && pgpPass.isDefined) {
println("Running under CI and PGP password specified under settings.")
println(s"Password longer than five characters: ${pgpPass.map(_.length > 5).getOrElse(false)}")
pgpPass.map(_.toCharArray)
pgpPass
} else {
println("Could not find settings for a PGP passphrase.")
println(s"pgpPass defined in environemnt: ${pgpPass.isDefined}")
Expand Down

0 comments on commit 2f5473a

Please sign in to comment.