Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #13 from USGS-EROS/develop
Browse files Browse the repository at this point in the history
4.3.0 Release
  • Loading branch information
davidvhill authored Jan 2, 2020
2 parents c5dc50b + 7cd7231 commit 533363c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 16 deletions.
26 changes: 21 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
from nginx:latest
MAINTAINER USGS LCMAP http://eros.usgs.gov
FROM centos:centos7

RUN mkdir /usr/share/man/man1
RUN apt-get update
RUN apt-get install default-jdk curl vim -y
RUN yum update -y

## Install Java
RUN yum install -y java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64 java-1.8.0-openjdk-headless.x86_64

## Install NGINX
ENV nginxversion="1.16.1-1" \
os="centos" \
osversion="7" \
elversion="7"

RUN yum install -y wget openssl sed &&\
yum -y autoremove &&\
yum clean all &&\
wget http://nginx.org/packages/$os/$osversion/x86_64/RPMS/nginx-$nginxversion.el$elversion.ngx.x86_64.rpm &&\
rpm -iv nginx-$nginxversion.el$elversion.ngx.x86_64.rpm

## Install Mastodon
COPY resources/public/index.html /usr/share/nginx/html/index.html
COPY resources/public/js/compiled/mastodon_min.js /usr/share/nginx/html/js/compiled/mastodon_min.js
COPY resources/public/js/jquery.min.js /usr/share/nginx/html/js/jquery.min.js
Expand All @@ -17,4 +30,7 @@ COPY project.clj /project.clj
COPY target/lcmap-mastodon-*-standalone.jar /

RUN mkdir /data

# Run!
CMD /startup.sh

18 changes: 8 additions & 10 deletions bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ BRANCH="${TRAVIS_BRANCH:-`git rev-parse --abbrev-ref HEAD | tr / -`}"
echo Branch: $BRANCH

# ...same for the commit.
COMMIT="${TRAVIS_COMMIT:-`git rev-parse HEAD`}"
COMMIT=`git rev-parse --short HEAD`
echo Commit: $COMMIT

# Version is extracted from project.clj so that a meaningful tag can
Expand All @@ -32,22 +32,20 @@ else
exit 1
fi

# Including the short commit SHA ensures uniquely identified builds
# as its possible for users to commit changes without incrementing
# version numbers, resulting new builds with the same tag
BRANCH_TAG=$REPO:$BRANCH-$VERSION-$COMMIT
echo "BRANCH_TAG: ${BRANCH_TAG}"

# Travis will build topic branches, but Docker images should not be
# built for each one because this would result in a *lot* of images
# during periods of active development.
if [ "$BRANCH" == "master" ] || [ "$BRANCH" == "develop" ] ; then

# Using the commit SHA will ensure that built images persist on
# Docker Hub unless explicitly removed. A more meaningful tag
# is also created using the <branch>-<version> but that can be
# superseded by subsequent builds.
COMMIT_TAG=$REPO:$COMMIT
BRANCH_TAG=$REPO:$BRANCH-$VERSION

echo "Building Docker image for $COMMIT_TAG ($BRANCH_TAG)"
lein uberjar
docker build -f Dockerfile -t $COMMIT_TAG .
docker tag $COMMIT_TAG $BRANCH_TAG
docker build -f Dockerfile -t $BRANCH_TAG .
docker push $REPO
echo "Building Docker image ... done"

Expand Down
1 change: 1 addition & 0 deletions default.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
server {
listen 80;
server_name localhost;
server_tokens off;

location / {
root /usr/share/nginx/html;
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject lcmap-mastodon "4.2.4"
(defproject lcmap-mastodon "4.3.0"
:description "Functions for LCMAP data curation"
:url "https://eros.usgs.gov"
:license {:name "Unlicense"
Expand Down

0 comments on commit 533363c

Please # to comment.