Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to sbt-gpg and GnuPG 2+ #5423

Merged
merged 5 commits into from
Jun 25, 2020
Merged

Upgrade to sbt-gpg and GnuPG 2+ #5423

merged 5 commits into from
Jun 25, 2020

Conversation

rbreslow
Copy link
Contributor

@rbreslow rbreslow commented Jun 18, 2020

Overview

Make the following changes in-order to align the release signing / publishing workflow with that of GeoTrellis satellite projects:

  • Replace usage of sbt-release with direct invocations of sbt-sonatype commands
  • Replace gitSnapshots and version.sbt file flow with a version variable in sharedSettings
  • Replace usage of sbt-pgp with sbt-gpg—use GnuPG within container image so that the builds no longer require state on build executor
  • Remove sbt-bintray which was blocking the new workflow with publish

In addition, the signing subkey was renewed out-of-band.

Checklist

  • Description of PR is in an appropriate section of the changelog and grouped with similar changes if possible
  • Swagger specification updated
  • New tables and queries have appropriate indices added
  • Any content changes are properly templated using BUILDCONFIG.APP_NAME
  • Any new SQL strings have tests
  • Any new endpoints have scope validation and are included in the integration test csv

Testing Instructions

See Jenkins CI build: http://jenkins.staging.rasterfoundry.com/job/Raster%20Foundry/job/raster-foundry/job/PR-5423/5/display/redirect.

The changes to Jenkinsfile.central incorporate the same flow that is used for releases to GeoTrellis projects. @notthatbreezy, can you let me know when the next release of Raster Foundry will be? The path of least resistance (and little consequence) will be to test those changes live.

Resolves #5265

- Replace usage of `sbt-release` with direct invocations of `sbt-sonatype` [commands](https://github.com/xerial/sbt-sonatype#commands)
- Replace `gitSnapshots` and `version.sbt` file flow with a `version` variable in `sharedSettings`
- Replace usage of `sbt-pgp` with `sbt-gpg`—use GnuPG within container image so that the builds no longer require state on build executor
- Remove `sbt-bintray` which was blocking the new workflow with `publish`
@rbreslow rbreslow self-assigned this Jun 18, 2020
@@ -28,7 +28,7 @@ node {

env.RF_SETTINGS_BUCKET = 'rasterfoundry-staging-config-us-east-1'

if (env.BRANCH_NAME == 'develop' || env.BRANCH_NAME =~ /test\// || env.BRANCH_NAME =~ /hotfix\// ) {
if (env.BRANCH_NAME == 'develop' || env.BRANCH_NAME =~ /test\// || env.BRANCH_NAME =~ /hotfix\// || env.BRANCH_NAME == 'PR-5423') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder to remove before merge.

Jenkinsfile.central Show resolved Hide resolved
Comment on lines -15 to -19
git.gitTagToVersionNumber in ThisBuild := { tag: String =>
if (tag matches "[0-9]+\\..*") Some(tag)
else None
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is from the docs for sbt-git. We don't use it in any of the GeoTrellis projects, so I'm removing it from here.

version := {
// TODO: leave an explaination as to why this is here. e.g. Vagrant -> not
// mounting .git -> separate sbt container for development
if (git.gitHeadCommit.value.isEmpty) "dev"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the containers used to compile Scala do not mount the .git folder in as a compromise made with Vagrant, so we can't always rely on git describe working to version artifacts.

@@ -130,7 +130,6 @@ services:
- $HOME/.coursier:/root/.coursier
- $HOME/.sbt:/root/.sbt
- $HOME/.aws:/root/.aws:ro
- $HOME/.gnupg:/root/.gnupg:ro
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer stateful 🎉 .

@@ -10,7 +10,7 @@ DIR="$(dirname "$0")"

function usage() {
echo -n \
"Usage: $(basename "$0")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest viewing this file with whitespace changes disabled.

@rbreslow rbreslow marked this pull request as ready for review June 18, 2020 18:59
@rbreslow rbreslow requested a review from hectcastro June 18, 2020 18:59
Copy link
Contributor

@hectcastro hectcastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice combined effort to get things up-to-date, but also to update the signing key.

I have a few high level questions that occured to me as I was reviewing the changes. Hard to know for sure whether they will lead to issues or not until we go through a proper release, but they felt valuable to raise.

@@ -48,11 +48,11 @@ node {
credentialsId: 'SONATYPE_PASSWORD',
variable: 'SONATYPE_PASSWORD'],
[$class: 'StringBinding',
credentialsId: 'PGP_HEX_KEY',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder to delete this (and PGP_PASSPHRASE) from Jenkins after this PR is merged.

Jenkinsfile.central Show resolved Hide resolved
app-backend/build.sbt Outdated Show resolved Hide resolved
app-backend/project/plugins.sbt Show resolved Hide resolved
@rbreslow rbreslow requested a review from hectcastro June 22, 2020 15:02
Copy link
Contributor

@hectcastro hectcastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. 👍 I was able to confirm that the signing key was renewed until 2021.

As far as the next RF release goes, it might be good to push for one now, if it makes sense, to avoid any unnecessary timeline pressure.

@rbreslow rbreslow merged commit 9fea6fd into develop Jun 25, 2020
rbreslow added a commit that referenced this pull request Jun 25, 2020
@rbreslow rbreslow deleted the feature/jrb/gpg branch December 15, 2020 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to sbt-gpg and GnuPG 2+
3 participants