...
 
Commits (36)
# this file is a template, and might need editing before it works on your project.
---
# Build JAVA applications using Apache Maven (http://maven.apache.org)
# For docker image tags see https://hub.docker.com/_/maven/
#
# For general lifecycle information see https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
#
# This template will build and test your projects as well as create the documentation.
#
# * Caches downloaded dependencies and plugins between invocation.
variables:
# This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
MAVEN_OPTS: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true -Dmaven.repo.local=/cache/maven.repository"
# As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
# when running from the command line.
# `installAtEnd` and `deployAtEnd`are only effective with recent version of the corresponding plugins.
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
# Cache downloaded dependencies and plugins between builds.
# cache:
# paths:
# - $HOME/.m2/repository/
stages:
- build
- test
- deploy
build:
script: "mvn package"
stage: build
script:
- "mvn clean package -Dhttps.proxyHost=192.168.10.1 -Dhttps.proxyPort=3128"
image: maven:3.3.9-jdk-8
cache:
paths:
- target/demoapp.jar
artifacts:
paths:
- target/demoapp.jar
tags:
- maven3
verify:
script: "mvn verify"
- docker
int-test:
stage: test
script:
- "ls ."
image: maven:3.3.9-jdk-8
tags:
- maven3
\ No newline at end of file
- docker
docker-build:
stage: deploy
script:
- "whoami"
- "ls ."
- "docker --version"
- "docker build -t 'demo-app:1.0.0' ./"
- "docker run --name=prova -d -p 20000:8080 demo-app:1.0.0"
tags:
- docker_build
......@@ -5,7 +5,7 @@
<groupId>com.dduportal.jenkins</groupId>
<artifactId>demoapp</artifactId>
<packaging>jar</packaging>
<version>1.0.0-SNAPSHOT</version>
<version>2.0.0</version>
<name>Demo DropWizard Application</name>
......