-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.gitlab-ci.yml
85 lines (76 loc) · 1.63 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
stages:
- build
- assemble
- deploy
build:
stage: build
image: maven:latest
services:
- velmuruganv/mysql
script:
- mvn clean test jacoco:report package -Pprod
tags:
- docker
- shared
artifacts:
name: "${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}_${CI_PIPELINE_ID}"
paths:
- target/*.war
- target/site/
expire_in: 1 week
docker-build-app:
stage: assemble
image: docker:latest
variables:
IMAGE_TAG : $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
services:
- docker:dind
script:
- docker info
- docker build -t $IMAGE_TAG .
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker push $IMAGE_TAG
tags:
- docker
- shared
docker-build-sqlscript:
stage: assemble
image: docker:latest
variables:
IMAGE_TAG : $CI_REGISTRY_IMAGE:sqlscript
services:
- docker:dind
script:
- cd src/main/resources/sql/
- docker info
- docker build -t $IMAGE_TAG .
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker push $IMAGE_TAG
tags:
- docker
- shared
pages:
stage: deploy
dependencies:
- build
script:
- mv target/site/jacoco public/
artifacts:
name: "${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}_${CI_PIPELINE_ID}_pages"
paths:
- public
expire_in: 30 days
only:
- master
deploy_local_vm:
stage: deploy
script:
- curl -s https://raw.githubusercontent.com/velmuruganvelayutham/shell-scripts/master/deploy.sh | bash -s
environment:
name: local-vm
url: http://dev.mock-labs.com
only:
- master
when: manual
tags:
- shell-osboxes