Skip to content

Commit

Permalink
Prepare for automatic deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
bpross-52n committed Oct 31, 2019
1 parent 85ce5c3 commit 25b292f
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: java
jdk:
- oraclejdk8
dist: trusty
script: mvn -fae -U -B notice:check clean install
env:
global:
- SNAPSHOT_BRANCH: "master"
cache:
directories:
- $HOME/.m2
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM maven:3-jdk-8-alpine AS BUILDER

COPY . /app

WORKDIR /app

RUN mvn --batch-mode --errors --fail-fast \
--define maven.javadoc.skip=true \
--define skipTests=true install

FROM java:8-jre-alpine

ARG VERSION=0.0.1-SNAPSHOT

COPY --from=BUILDER /app/target/mean-speed-service-${VERSION}.jar /app.jar

ENTRYPOINT ["java", "-jar", "/app.jar"]
18 changes: 18 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
node {
def app

stage('Clone repository') {
checkout scm
}

stage('Build image') {
app = docker.build("ec-components/mean-speed-service")
}

stage('Push image') {
docker.withRegistry('http://registry:5000') {
app.push("${env.BUILD_NUMBER}")
app.push("latest")
}
}
}
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3'

services:
track-count:
image: ${REGISTRY}/mean-speed-service:latest
command: bash
networks:
- ecbase_shared
- eccomponents_ec-data-api

networks:
ecbase_shared:
external: true
eccomponents_ec-data-api:
external: true

0 comments on commit 25b292f

Please sign in to comment.