Skip to content

Commit

Permalink
Merge branch 'release/0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadain committed Jun 6, 2016
2 parents 01c2412 + 456dcc1 commit 8164e4c
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!geop/target/scala-2.10/*.jar
!scripts/docker-entrypoint.sh
41 changes: 28 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sudo: required

language: scala
language: bash

services:
- docker
Expand All @@ -12,19 +12,34 @@ cache:

script:
- mkdir -p ${HOME}/.sbt
- docker run -v ${HOME}/.ivy2:/root/.ivy2 -v ${HOME}/.sbt:/root/.sbt -v ${PWD}:/usace-program-analysis-geoprocessing -w /usace-program-analysis-geoprocessing quay.io/azavea/spark:latest ./sbt "project geop" compile
- docker-compose -f docker-compose.ci.yml run compile

before_deploy:
- docker run -v ${HOME}/.ivy2:/root/.ivy2 -v ${HOME}/.sbt:/root/.sbt -v ${PWD}:/usace-program-analysis-geoprocessing -w /usace-program-analysis-geoprocessing quay.io/azavea/spark:latest ./sbt "project geop" assembly
- sudo chown ${USER} geop/target/scala-2.10/usace-programanalysis-geop-assembly-${TRAVIS_TAG}.jar
- docker login -e . -p "${QUAY_PASSWORD}" -u "${QUAY_USER}" quay.io
- docker-compose -f docker-compose.ci.yml run assembly
- sudo chown ${USER} geop/target/scala-2.10/usace-programanalysis-geop-assembly-*.jar

deploy:
provider: releases
api_key:
secure: Kueq5wDVSor5lP9QuCouCu4tDd6TL7O1J3d9mISrYlM6PK3C1Z72cr9kxtySW+BOYYAI//J9SK3taXKNhHce7rZNdtJADyKaz8bMZ88NIKLPqujJxIXlyAmPURSXBLn2HZ9h8FjIqIw5240jFrPInDPJq2S8KiJsyEPSmI//zFUc7v32aId1XWAeRFRBGQyYiIngsrFAZ1csmwS7UlBxdl3moTZNvekgnYnYZ1GnJxaZClMa/Ii9seqHQCPtu/a7eye5WigI62rJ5a6WcLqL2/Ffx17o089TArYdLHXyfMMAsjImnNF7Lk+kMo3ybZI5u6/icL3zOY8mkn6zQxeCXTc7fwkTzSxLeIoDuoWASHJhkNrFQKg+ZsowpYefGsYv076bYkg+YtckWsIjWyNknuTkkDF5dKxLHZvffn6RmYjikbUbHo6J52q1nTFCvi6rhPU2ossIDiWjLUGRKUF6X9n9DKaFdthFj99ECsfF56zWvgcS1SSDdPmWh1r8v4oNr8I7ow9HqpOtye1XglRc4zNHHs8mjUueGCJOqOc2NZ15aMGrL8KIqTQzEDtw/ve6Fai3pmk4t8z6r2PyVZJL2RlPXfpmHlQL3JErW+hbtGNmLpP2QTVF2kz2OJkXNRZwIAY+wMX5Enw4tI447rBnfW+SPYJff/YxntoBLLJCKqo=
file:
- geop/target/scala-2.10/usace-programanalysis-geop-assembly-${TRAVIS_TAG}.jar
skip_cleanup: true
on:
repo: azavea/usace-program-analysis-geoprocessing
tags: true
- provider: releases
api_key:
secure: Kueq5wDVSor5lP9QuCouCu4tDd6TL7O1J3d9mISrYlM6PK3C1Z72cr9kxtySW+BOYYAI//J9SK3taXKNhHce7rZNdtJADyKaz8bMZ88NIKLPqujJxIXlyAmPURSXBLn2HZ9h8FjIqIw5240jFrPInDPJq2S8KiJsyEPSmI//zFUc7v32aId1XWAeRFRBGQyYiIngsrFAZ1csmwS7UlBxdl3moTZNvekgnYnYZ1GnJxaZClMa/Ii9seqHQCPtu/a7eye5WigI62rJ5a6WcLqL2/Ffx17o089TArYdLHXyfMMAsjImnNF7Lk+kMo3ybZI5u6/icL3zOY8mkn6zQxeCXTc7fwkTzSxLeIoDuoWASHJhkNrFQKg+ZsowpYefGsYv076bYkg+YtckWsIjWyNknuTkkDF5dKxLHZvffn6RmYjikbUbHo6J52q1nTFCvi6rhPU2ossIDiWjLUGRKUF6X9n9DKaFdthFj99ECsfF56zWvgcS1SSDdPmWh1r8v4oNr8I7ow9HqpOtye1XglRc4zNHHs8mjUueGCJOqOc2NZ15aMGrL8KIqTQzEDtw/ve6Fai3pmk4t8z6r2PyVZJL2RlPXfpmHlQL3JErW+hbtGNmLpP2QTVF2kz2OJkXNRZwIAY+wMX5Enw4tI447rBnfW+SPYJff/YxntoBLLJCKqo=
file:
- geop/target/scala-2.10/usace-programanalysis-geop-assembly-${TRAVIS_TAG}.jar
skip_cleanup: true
on:
repo: azavea/usace-program-analysis-geoprocessing
tags: true

- provider: script
script: "scripts/cibuild.sh"
skip_cleanup: true
on:
repo: azavea/usace-program-analysis-geoprocessing
branch: develop

- provider: script
script: "scripts/cibuild.sh"
skip_cleanup: true
on:
repo: azavea/usace-program-analysis-geoprocessing
tags: true
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.0

- Deploy containerized image to [Quay](https://quay.io/repository/usace/program-analysis-geoprocessing) in addition to GitHub Releases

## 0.0.1

- Initial Release. Contains /ping endpoint for testing.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM quay.io/azavea/spark:1.6.1

ENV VERSION 0.1.0

COPY geop/target/scala-2.10/usace-programanalysis-geop-assembly-${VERSION}.jar /opt/geoprocessing/usace-programanalysis-geop.jar
COPY scripts/docker-entrypoint.sh /opt/geoprocessing/

WORKDIR /opt/geoprocessing

EXPOSE 8090

VOLUME /tmp

ENTRYPOINT ["./docker-entrypoint.sh"]
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,19 @@ Alternatively, using `curl`:
$ curl http://localhost:8090/ping
OK

## Test with Web App

To test with the [main web app](https://github.com/azavea/usace-program-analysis), build the JAR and copy it to the [`/src/geoprocessing`](https://github.com/azavea/usace-program-analysis/tree/develop/src/geoprocessing) directory, and uncomment the volume mapping in [`docker-compose.yml`](https://github.com/azavea/usace-program-analysis/blob/develop/docker-compose.yml#L69-L71). Then run `docker-compose up`.

## Deploy

Deployments to GitHub Releases are handled via [Travis-CI](https://travis-ci.org/azavea/usace-program-analysis-geoprocessing). The following `git-flow` commands signal to Travis that we want to create a release. The `version` variable should be updated in `project/Version.scala.`
Deployments to [GitHub Releases](https://github.com/azavea/usace-program-analysis-geoprocessing/releases) and [Quay](https://quay.io/repository/usace/program-analysis-geoprocessing) are handled via [Travis-CI](https://travis-ci.org/azavea/usace-program-analysis-geoprocessing). The following `git-flow` commands signal to Travis that we want to create a release. The `version` variable should be updated in `project/Version.scala` and `Dockerfile`.

``` bash
$ git flow release start 0.0.1
$ vim CHANGELOG.md
$ vim project/Version.scala
$ vim Dockerfile
$ git commit -m "0.0.1"
$ git flow release publish 0.0.1
$ git flow release finish 0.0.1
Expand Down
19 changes: 19 additions & 0 deletions docker-compose.ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
assembly:
image: quay.io/azavea/spark:1.6.1
volumes:
- ./:/usace-program-analysis-geoprocessing
- ${HOME}/.ivy2:/root/.ivy2
- ${HOME}/.sbt:/root/.sbt
working_dir: /usace-program-analysis-geoprocessing
entrypoint: sbt
command: '"project geop" assembly'

compile:
image: quay.io/azavea/spark:1.6.1
volumes:
- ./:/usace-program-analysis-geoprocessing
- ${HOME}/.ivy2:/root/.ivy2
- ${HOME}/.sbt:/root/.sbt
working_dir: /usace-program-analysis-geoprocessing
entrypoint: sbt
command: '"project geop" compile'
4 changes: 2 additions & 2 deletions project/Version.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ object Version {
def either(environmentVariable: String, default: String): String =
Properties.envOrElse(environmentVariable, default)

val version = "0.0.1"
val version = "0.1.0"

val geotrellis = "0.10.0"
val scala = either("SCALA_VERSION", "2.10.6")
lazy val hadoop = either("SPARK_HADOOP_VERSION", "2.6.0")
lazy val spark = either("SPARK_VERSION", "1.5.2")
lazy val spark = either("SPARK_VERSION", "1.6.1")
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.8
sbt.version=0.13.11
16 changes: 16 additions & 0 deletions scripts/cibuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -e
set -x

if [ -z "${TRAVIS_TAG}" ]; then
QUAY_TAG="${TRAVIS_COMMIT:0:7}"
else
QUAY_TAG="${TRAVIS_TAG}"
fi

docker build -t "quay.io/usace/program-analysis-geoprocessing:${QUAY_TAG}" .

docker push "quay.io/usace/program-analysis-geoprocessing:${QUAY_TAG}"
docker tag -f "quay.io/usace/program-analysis-geoprocessing:${QUAY_TAG}" "quay.io/usace/program-analysis-geoprocessing:latest"
docker push "quay.io/usace/program-analysis-geoprocessing:latest"
5 changes: 5 additions & 0 deletions scripts/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -e

exec /opt/spark/bin/spark-submit "$@" usace-programanalysis-geop.jar 2>&1

0 comments on commit 8164e4c

Please sign in to comment.