-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
48 lines (41 loc) · 1.03 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
.job_template: &run_on_hq # TODO maybe change this to a shared project?
tags:
- docker
- hq
.job_template: &manual_trigger
when: manual
stages:
- Build
- Docker
Build:
image: openjdk:8-jdk-alpine
stage: Build
<<: *run_on_hq
script:
- export GRADLE_USER_HOME=`pwd`/.gradle
- ./gradlew build
cache:
paths:
- .gradle/wrapper
- .gradle/caches
artifacts:
paths:
- build/libs/example-0.1.0-SNAPSHOT-fat.jar
expire_in: 1 day
Deploy:
stage: Docker
<<: *run_on_hq
<<: *manual_trigger
image: docker:stable
services:
- docker:dind
dependencies:
- Build
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
REGISTRY: registry.gitlab.com
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $REGISTRY
- docker build -t $REGISTRY/youclap/backend/vertx-example .
- docker push $REGISTRY/youclap/backend/vertx-example