Skip to content

Commit

Permalink
Added publishing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lossyrob committed Dec 18, 2016
1 parent 5b720c7 commit 2447bf8
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 0 deletions.
27 changes: 27 additions & 0 deletions 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
17 changes: 17 additions & 0 deletions 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
33 changes: 33 additions & 0 deletions 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.
22 changes: 22 additions & 0 deletions 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

0 comments on commit 2447bf8

Please sign in to comment.