Skip to content

Commit

Permalink
Merge pull request #9 from stempler/master-3.3.18-we
Browse files Browse the repository at this point in the history
 configure for publishing in wetransform artifactory
  • Loading branch information
stempler authored Apr 18, 2018
2 parents 939eb74 + 429b085 commit 095c77d
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 0 deletions.
47 changes: 47 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM java:7-jdk as builder
# Multi stage build - https://docs.docker.com/engine/userguide/eng-image/multistage-build/

# install maven
RUN apt-get update && apt-get install -y --no-install-recommends maven

# build and extract deegree
RUN mkdir /build && mkdir /target
COPY ./ /build/
RUN cd /build/ && \
mvn clean install -DskipTests && \
cp /build/deegree-services/deegree-webservices/target/deegree-webservices-*.war /build/deegree-webservices.war && \
unzip -o /build/deegree-webservices.war -d /target

# add to image...
FROM tomcat:8.0-jre7
ENV LANG en_US.UTF-8

# add build info - see hooks/build and http://label-schema.org/
ARG BUILD_DATE
ARG VCS_REF
ARG VCS_URL
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url=$VCS_URL \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.schema-version="1.0.0-rc1"

EXPOSE 8080

# set default secrets ( override for production use! )
# consoleSecretKey="deegree"
ENV consoleSecretKey=000001544E797221:564344F65B8F9DDBA6A410E461E7801E10955F56D8679284966F400C68B6CEAB
ENV apiUser=deegree
ENV apiPass=deegree

RUN mkdir /root/.deegree && \
rm -r /usr/local/tomcat/webapps/ROOT

COPY --from=builder /target /usr/local/tomcat/webapps/ROOT

#cmd:
# 1. configure deegreeapi access
# 2. configure console access
# 3. start tomcat
CMD sed -i '44i <user username="'"$apiUser"'" password="'"$apiPasswd"'" roles="deegree" \/> /' /usr/local/tomcat/conf/tomcat-users.xml \
&& echo $consoleSecretKey >/root/.deegree/console.pw \
&& /usr/local/tomcat/bin/catalina.sh run
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# simple compose file for running the Docker image
deegree:
build: .
ports:
- "8080:8080"
17 changes: 17 additions & 0 deletions hooks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# see https://medium.com/microscaling-systems/labelling-automated-builds-on-docker-hub-f3d073fb8e1
# and https://docs.docker.com/docker-cloud/builds/advanced/#override-build-test-or-push-commands

# $IMAGE_NAME var is injected into the build so the tag is correct.

echo "Build hook running"
docker build \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=`git rev-parse HEAD` \
--build-arg VCS_URL=`git ls-remote --get-url origin` \
-t $IMAGE_NAME .

# Other options for getting VCS URL:
# git remote get-url origin # seems to be not available on Docker Hub
# git config --get remote.origin.url
22 changes: 22 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,22 @@
<enabled>true</enabled>
</snapshots>
</repository>
<!-- not sure why there are errors downloading artifacts with Maven inside Docker,
using the Artifactory proxying the deegree repo below seems to work -->
<repository>
<id>wetransform-repo</id>
<url>https://artifactory.wetransform.to/artifactory/deegree</url>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

<distributionManagement>
<!--
<repository>
<id>deegree-releases</id>
<url>http://repo.deegree.org/content/repositories/releases/</url>
Expand All @@ -37,13 +50,22 @@
<id>deegree-snapshots</id>
<url>http://repo.deegree.org/content/repositories/snapshots/</url>
</snapshotRepository>
-->
<site>
<id>apidoc.deegree.org</id>
<!--
<url>scp://apidoc.deegree.org/var/www/apidoc.deegree.org/${project.version}/</url>
-->
<url>file:///tmp/site/${project.version}/</url>
</site>
<repository>
<id>wetf-releases</id>
<url>https://artifactory.wetransform.to/artifactory/deegree-release-local</url>
</repository>
<snapshotRepository>
<id>wetf-snapshots</id>
<url>https://artifactory.wetransform.to/artifactory/deegree-snapshot-local</url>
</snapshotRepository>
</distributionManagement>

<prerequisites>
Expand Down

0 comments on commit 095c77d

Please sign in to comment.