From 2447bf8126334f4d19432ad96182777dfee626c6 Mon Sep 17 00:00:00 2001 From: lossyrob Date: Sat, 17 Dec 2016 20:09:57 -0500 Subject: [PATCH] Added publishing workflow --- publish/Dockerfile | 27 +++++++++++++++++++++++++++ publish/Makefile | 17 +++++++++++++++++ publish/README.md | 33 +++++++++++++++++++++++++++++++++ publish/publish-to-sonatype.sh | 22 ++++++++++++++++++++++ 4 files changed, 99 insertions(+) create mode 100644 publish/Dockerfile create mode 100644 publish/Makefile create mode 100644 publish/README.md create mode 100755 publish/publish-to-sonatype.sh diff --git a/publish/Dockerfile b/publish/Dockerfile new file mode 100644 index 0000000000..2f62a57a39 --- /dev/null +++ b/publish/Dockerfile @@ -0,0 +1,27 @@ +FROM java:8 + +USER root + +RUN apt-get install git + +RUN useradd -ms /bin/bash geotrellis + +USER geotrellis + +RUN set -x \ + && cd /home/geotrellis \ + && git clone https://github.com/locationtech/geotrellis /home/geotrellis/geotrellis \ + && cd /home/geotrellis/geotrellis \ + && git checkout 1.0 + +WORKDIR /home/geotrellis/geotrellis + +COPY .credentials /home/geotrellis/.ivy2/.credentials +COPY ./gnupg/ /home/geotrellis/.gnupg/ +COPY .credentials /home/geotrellis/.sbt/0.13/local.sbt + +USER root + +RUN chown -R geotrellis:geotrellis /home/geotrellis + +USER geotrellis diff --git a/publish/Makefile b/publish/Makefile new file mode 100644 index 0000000000..d8141e75cb --- /dev/null +++ b/publish/Makefile @@ -0,0 +1,17 @@ +IMG := geotrellis/publish-geotrellis-container +TAG := "latest" + +build: Dockerfile + @cp ~/.ivy2/.credentials .credentials + @cp ~/.sbt/0.13/local.sbt local.sbt + @cp -r ~/.gnupg ./gnupg + docker build --no-cache -t ${IMG}:${TAG} . + @rm .credentials + @rm -r ./gnupg + @rm local.sbt + +run: + docker run -it ${IMG}:${TAG} /bin/bash + +publish: + docker run -it ${IMG}:${TAG} publish/publish-to-sonatype.sh diff --git a/publish/README.md b/publish/README.md new file mode 100644 index 0000000000..2d7b5be528 --- /dev/null +++ b/publish/README.md @@ -0,0 +1,33 @@ +## Publishing GeoTrellis Releases + +This directory contains the elements needed to publish GeoTrellis to Sonatype. + +## Setup + +You'll need to have the proper Sonatype credentials in `~/.ivy2/.credentials`, +the proper PGP public and private key in `~/.gnupg`, +and the password for the private key (for jar signing) in `~/.sbt/0.13/local.sbt`. +As we change SBT versions, we'll need to modify the `Makefile` to point the correct +file locations. + +We also have to change the branch that is checked out in the `Dockerfile` to the +proper version branch as we change GeoTrellis versions. + +Note: Sonatype requires JARs be signd via PGP, so if you do not have keys +with a distributed public key, you'll have to work through the instructions here: +http://central.sonatype.org/pages/working-with-pgp-signatures.html + +## Building the container + +First build the container using `make build`. The image will always be rebuilt from +scratch, cloning geotrellis and checking out the version branch. + + +## Publishing + +Run `make publish`. This will run the `publish-to-sonatype.sh` script inside the +container, and push everything to the sonatype staging repository. + +After that, you'll have to log in with the appropriate authentication to +https://oss.sonatype.org/, and from there follow the release instructions +at http://central.sonatype.org/pages/releasing-the-deployment.html. diff --git a/publish/publish-to-sonatype.sh b/publish/publish-to-sonatype.sh new file mode 100755 index 0000000000..5b38725e92 --- /dev/null +++ b/publish/publish-to-sonatype.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# Publish to sonatype for all supported scala version 2.11 + +./sbt "project macros" publish-signed \ + && ./sbt "project vector" publish-signed \ + && ./sbt "project proj4" publish-signed \ + && ./sbt "project raster" publish-signed \ + && ./sbt "project spark" publish-signed \ + && ./sbt "project s3" publish-signed \ + && ./sbt "project accumulo" publish-signed \ + && ./sbt "project cassandra" publish-signed \ + && ./sbt "project hbase" publish-signed \ + && ./sbt "project spark-etl" publish-signed \ + && ./sbt "project geomesa" publish-signed \ + && ./sbt "project geotools" publish-signed \ + && ./sbt "project shapefile" publish-signed \ + && ./sbt "project slick" publish-signed \ + && ./sbt "project util" publish-signed \ + && ./sbt "project vectortile" publish-signed \ + && ./sbt "project raster-testkit" publish-signed \ + && ./sbt "project vector-testkit" publish-signed \ + && ./sbt "project spark-testkit" publish-signed