-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
41 lines (39 loc) · 1.13 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
stages:
- build
- deploy
gradle-build:
image: gradle:6.7.1-jdk11
stage: build
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
script:
- gradle clean build
artifacts:
paths:
- build/libs/*.jar
cache:
key: gradle-cache
paths:
- .gradle/caches
heroku-deploy:
image: docker:stable
stage: deploy
variables:
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
services:
- docker:dind
before_script:
- docker login --username=$HEROKU_USER --password=$HEROKU_API_KEY registry.heroku.com
- apk add --update curl && rm -rf /var/cache/apk/*
script:
- docker build
--build-arg JAR_FILE=`ls build/libs/*.jar | head -1`
--build-arg DB_URI=${VET_APP_HEROKU_DB_URI}
--build-arg DB_USER=${VET_APP_HEROKU_DB_USER}
--build-arg DB_PASSWORD=${VET_APP_HEROKU_DB_PASSWORD}
--tag registry.heroku.com/$HEROKU_APP_NAME/web .
- docker push registry.heroku.com/$HEROKU_APP_NAME/web
- chmod -R 0777 release-docker-in-heroku.sh
- ./release-docker-in-heroku.sh $HEROKU_APP_NAME $HEROKU_API_KEY