-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
66 lines (58 loc) · 2.47 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
stages:
- build
- test
- package
- docker_build
- deploy_playground
cache:
key: "$CI_BUILD_REF_NAME"
paths:
- target/
# maven repo is set via variables.
untracked: true
image: maven:3-jdk-8
before_script:
- rm -rf *.jar* # required else it will still see older downloads and use a sequence number in jar download...
- if [ ! -f /cache/maven.repository/com/bold/mambu/bold-mambu-api/1.0-SNAPSHOT/bold-mambu-api-1.0-SNAPSHOT.pom ]; then mvn install:install-file -Dfile=tmp/pom.xml -DpomFile=tmp/pom.xml -DgroupId=com.bold.mambu -DartifactId=bold-mambu-api -Dversion=1.0-SNAPSHOT -Dpackaging=pom; fi
- if [ ! -f /cache/maven.repository/com/mambu/mambumodels/4.3/mambumodels-4.3.jar ]; then wget https://raw.githubusercontent.com/mambu-gmbh/Mambu-APIs-Java/master/lib/mambu-models-V4.3.jar; fi
- if [ ! -f /cache/maven.repository/com/mambu/mambumodels/4.3/mambumodels-4.3.jar ]; then mvn install:install-file -Dfile=mambu-models-V4.3.jar -DgroupId=com.mambu -DartifactId=mambumodels -Dversion=4.3 -Dpackaging=jar; fi
- if [ ! -f /cache/maven.repository/com/mambu/mambuapis/4.3/mambuapis-4.3.jar ]; then wget https://raw.githubusercontent.com/mambu-gmbh/Mambu-APIs-Java/master/build/Mambu-APIs-Java-4.3-bin.jar; fi
- if [ ! -f /cache/maven.repository/com/mambu/mambuapis/4.3/mambuapis-4.3.jar ]; then mvn install:install-file -Dfile=Mambu-APIs-Java-4.3-bin.jar -DgroupId=com.mambu -DartifactId=mambuapis -Dversion=4.3 -Dpackaging=jar; fi
variables:
MAVEN_OPTS: -Dmaven.repo.local=/cache/maven.repository
# Build the jar
build:
stage: build
script:
- mvn clean compile
test:
stage: test
script:
- mvn test
package:
stage: package
script:
- mvn package
# Build the Docker image and push it to ECR
docker_build:
image: dawizz/docker-aws:latest
environment: playground
only:
- master
#image: docker:1.11
variables:
DOCKER_DRIVER: overlay
before_script:
- docker info
- $(aws ecr get-login --region eu-west-1)
stage: docker_build
script:
- echo "Building ${CI_PROJECT_NAME}-${CI_BUILD_REF:0:8}"
- docker build -t 068713275162.dkr.ecr.eu-west-1.amazonaws.com/boldheroes-playground/${CI_PROJECT_NAME}:${CI_BUILD_REF:0:8} .
- echo "Pushing ${CI_PROJECT_NAME}-${CI_BUILD_REF:0:8}"
- docker push 068713275162.dkr.ecr.eu-west-1.amazonaws.com/boldheroes-playground/${CI_PROJECT_NAME}:${CI_BUILD_REF:0:8}
# deploy_playground:
# image: dawizz/docker-aws:latest
# script: make deploy
# environment:
# name: Playground