-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #530 from ing-bank/oss-release
OSS azure release
- Loading branch information
Showing
7 changed files
with
109 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
trigger: | ||
batch: true | ||
branches: | ||
include: | ||
- master | ||
|
||
pool: | ||
vmImage: 'ubuntu-latest' | ||
|
||
variables: | ||
- group: SonaTypeCredentials | ||
- group: gpg key | ||
- group: github_token | ||
|
||
steps: | ||
- task: DownloadSecureFile@1 | ||
name: pubring | ||
inputs: | ||
secureFile: pubring.asc | ||
|
||
- task: DownloadSecureFile@1 | ||
name: secring | ||
inputs: | ||
secureFile: secring.asc | ||
|
||
- task: Bash@3 | ||
displayName: 'Build, sign and publish' | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
echo $(tty) | ||
ls -la $(pubring.secureFilePath) | ||
ls -la $(secring.secureFilePath) | ||
mkdir ~/.gnupg | ||
chmod -R 700 ~/.gnupg | ||
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf | ||
gpg --import $(pubring.secureFilePath) | ||
gpg --batch --import $(secring.secureFilePath) | ||
gpg --version | ||
gpg --list-keys | ||
gpg --list-secret-keys | ||
git checkout master | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "baker release pipeline" | ||
git remote set-url origin "https://jacum:${GIT_AUTH_TOKEN}@github.com/ing-bank/baker" | ||
sbt -Divy.home=${IVY_HOME} -Dsbt.ivy.home=${IVY_HOME} "release with-defaults" | ||
rm -rf $(pubring.secureFilePath) | ||
rm -rf $(secring.secureFilePath) | ||
rm -rf ~/.gnupg | ||
env: | ||
# secrets must be extracted explicitly | ||
USERNAME: $(username) | ||
PASSWORD: $(password) | ||
# passphrase will be passed to sbt plugin from here | ||
PGP_PASSPHRASE: $(gpg key) | ||
# neeeded for gpg to work on headless azure agents | ||
GPG_TTY: /dev/pts/0 | ||
GIT_AUTH_TOKEN: $(github_token) |
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 |
---|---|---|
|
@@ -6,11 +6,20 @@ import xerial.sbt.Sonatype.SonatypeKeys._ | |
|
||
object Publish { | ||
|
||
lazy val settings = if (sys.env.get("FEEDURL").isDefined) AzureFeed else Sonatype | ||
lazy val settings = | ||
if (sys.env.contains("FEEDURL")) StableToAzureFeed | ||
else if ( (sys.env.contains("USERNAME"))) ReleaseToSonatype | ||
else SuppressJavaDocsAndSources | ||
|
||
import aether.AetherKeys._ | ||
|
||
val AzureFeed = Seq( | ||
val SuppressJavaDocsAndSources = Seq( | ||
sources in doc := Seq(), | ||
publishArtifact in packageDoc := false, | ||
publishArtifact in packageSrc := false | ||
) | ||
|
||
val StableToAzureFeed = Seq( | ||
credentials += Credentials(Path.userHome / ".credentials"), | ||
publishTo := Some("pkgs.dev.azure.com" at sys.env.getOrElse("FEEDURL", "")), | ||
publishMavenStyle := true, | ||
|
@@ -23,10 +32,28 @@ object Publish { | |
protected val ossSnapshots = "Sonatype OSS Snapshots" at nexus + "content/repositories/snapshots/" | ||
protected val ossStaging = "Sonatype OSS Staging" at nexus + "service/local/staging/deploy/maven2/" | ||
|
||
val Sonatype = Seq( | ||
val ReleaseToSonatype = Seq( | ||
credentials ++= Seq( | ||
Credentials( | ||
"Sonatype Nexus Repository Manager", | ||
"oss.sonatype.org", | ||
sys.env.getOrElse("USERNAME", ""), | ||
sys.env.getOrElse("PASSWORD", "") | ||
), | ||
Credentials( | ||
"GnuPG Key ID", | ||
"gpg", | ||
"303489A85EBB77F6E93E2A254CCF1479F92AE2B7", // key identifier | ||
"ignored" // this field is ignored; passwords are supplied by pinentry | ||
) | ||
), | ||
releaseIgnoreUntrackedFiles := true, | ||
sonatypeProfileName := "com.ing", | ||
licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT")), | ||
homepage := Some(url("https://github.com/ing-bank/baker")), | ||
scmInfo := Some(ScmInfo( | ||
browseUrl = url("https://github.com/ing-bank/baker"), | ||
connection = "scm:[email protected]:ing-bank/baker.git")), | ||
pomExtra := ( | ||
<developers> | ||
<developer> | ||
|
@@ -38,6 +65,8 @@ object Publish { | |
publishMavenStyle := true, | ||
publishTo := version((v: String) => Some(if (isSnapshot(v)) ossSnapshots else ossStaging)).value, | ||
publishArtifact in Test := false, | ||
publishArtifact in packageDoc := true, | ||
publishArtifact in packageSrc := true, | ||
pomIncludeRepository := (_ => false), | ||
releaseCrossBuild := true, | ||
releaseProcess := Seq[ReleaseStep]( | ||
|
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
addSbtPlugin("com.thesamet" % "sbt-protoc" % "0.99.31") | ||
|
||
libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.10.2" | ||
libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.10.3" |
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 |
---|---|---|
@@ -1 +1 @@ | ||
version in ThisBuild := "3.0.2-SNAPSHOT" | ||
version in ThisBuild := "3.0.4-SNAPSHOT" |