This repository has been archived by the owner on Jan 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.gitlab-ci.yml
135 lines (123 loc) · 3.5 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#
# Builds interim version, pushes to repo.incode.work
#
#
# It requires the following gitlab secret variables
#
# - GCPAPPENGINEREPO_USERNAME
# - GCPAPPENGINEREPO_PASSWORD
# - GCPAPPENGINEREPO_URL
#
image: maven:3.5.3-jdk-8
before_script:
- export BASELINE=1.17.0
- export REVISION=$BASELINE.$(date +%Y%m%d)-$(date +%H%M)-$(echo $CI_COMMIT_SHA | cut -c1-8)
#
# TODO: uncomment next 2 sections if decide to configure & build webapp/incode-platformapp as a Docker image
#
#services:
# - docker:dind
#variables:
# DOCKER_HOST: tcp://docker:2375
# DOCKER_DRIVER: overlay2
# APP_NAME: "incode-extended-app"
stages:
- build-and-publish
publish-to-gcp:
stage: build-and-publish
script:
- echo ""
- echo "$REVISION"
- echo "GCPAPPENGINEREPO_URL=$GCPAPPENGINEREPO_URL"
- echo ""
- >
mvn --batch-mode \
clean install \
-Drevision=$REVISION \
$CORE_ADDITIONAL_OPTS
- echo ""
- cd modules
- >
mvn -s .m2/settings.xml \
--batch-mode \
deploy \
-Drevision=$REVISION \
-Ddeploy-modules \
-Dskip.default-modules \
-DskipTests \
-Dgcpappenginerepo-deploy \
-Dgcpappenginerepo-deploy.repositoryUrl=$GCPAPPENGINEREPO_URL \
$CORE_ADDITIONAL_OPTS
- cd ..
#
# Previously this script also uploaded to a Sonatype Nexus.
# Here's the stuff that did it.
#
# - NEXUS_USERNAME
# - NEXUS_PASSWORD
# - NEXUS_REPO_URL
#
#publish-to-nexus:
# stage: build-and-publish
# script:
# - echo ""
# - echo "$REVISION"
# - echo "NEXUS_REPO_URL=$NEXUS_REPO_URL"
# - echo ""
# - >
# mvn --batch-mode \
# clean install \
# -Drevision=$REVISION \
# $CORE_ADDITIONAL_OPTS
# - echo ""
# - cd modules
# - >
# mvn -s .m2/settings.xml \
# --batch-mode \
# deploy \
# -Drevision=$REVISION \
# -Ddeploy-modules \
# -Dskip.default-modules \
# -DskipTests \
# -Dnexus-deploy \
# -Dnexus-deploy.repositoryUrl=$NEXUS_REPO_URL \
# $CORE_ADDITIONAL_OPTS
# - cd ..
#
# TODO: uncomment if we decide to configure & build webapp/incode-platformapp as a Docker image
#
#
# requires the additional following gitlab secret variables
#
# - DOCKER_REGISTRY_USERNAME
# - DOCKER_REGISTRY_PASSWORD
# - DOCKER_REGISTRY_EMAIL
# - DOCKER_REGISTRY_NAME # eg "registry-1.docker.io" (for docker hub)
# or "docker-dev.incode.cloud" (eg a cloud-based nexus)
# - DOCKER_REGISTRY_URL # eg "https://index.docker.io/v1/" (for docker hub)
# or "https://repo.incode.cloud/repository/docker-dev/" (eg a cloud-based nexus)
#
#
#
# - cd webapp
# - >
# mvn --batch-mode \
# install \
# -Drevision=$REVISION \
# -Disis.version=$REVISION \
# -Dmavenmixin-docker \
# -Ddocker-plugin.imageName=$DOCKER_REGISTRY_NAME/$DOCKER_REGISTRY_USERNAME/$APP_NAME
# - >
# mvn -s .m2/settings.xml \
# --batch-mode \
# docker:push@push-image-tagged \
# -pl webapp \
# -Drevision=$REVISION \
# -Disis.version=$REVISION \
# -DskipTests \
# -Dskip.isis-swagger \
# -Dmavenmixin-docker \
# -Ddocker-plugin.imageName=$DOCKER_REGISTRY_NAME/$DOCKER_REGISTRY_USERNAME/$APP_NAME \
# -Ddocker-plugin.serverId=docker-registry \
# -Ddocker.registryUrl=$DOCKER_REGISTRY_URL
# - cd ../../..