Skip to content

Commit 44d69b8

Browse files
committed
Added cloud build for unit-tests
1 parent acdeeb0 commit 44d69b8

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

cloudbuild.yaml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright © 2020 Cask Data, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4+
# use this file except in compliance with the License. You may obtain a copy of
5+
# the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
# License for the specific language governing permissions and limitations under
13+
# the License.
14+
15+
steps:
16+
- name: 'gcr.io/cloud-builders/gsutil'
17+
args: ['-q', '-m', 'rsync', '-r', '${_GCS_CACHE_PATH}', '/m2_cache']
18+
volumes:
19+
- path: '/m2_cache'
20+
name: 'm2_cache'
21+
- name: 'maven:3-jdk-8'
22+
entrypoint: 'mvn'
23+
args: ['clean', 'test', '-fae', '-B', '-V', '-DcloudBuild']
24+
env:
25+
- 'MAVEN_CACHE_DIR=/m2_cache'
26+
- 'MAVEN_OPTS=-Xmx3000m -Dmaven.repo.local=/m2_cache'
27+
volumes:
28+
- path: '/m2_cache'
29+
name: 'm2_cache'
30+
- name: 'gcr.io/cloud-builders/gsutil'
31+
args: ['-q', '-m', 'rsync', '-r', '/m2_cache', '${_GCS_CACHE_PATH}']
32+
volumes:
33+
- path: '/m2_cache'
34+
name: 'm2_cache'
35+
options:
36+
machineType: 'N1_HIGHCPU_32'
37+
timeout: 10800s

pom.xml

+18
Original file line numberDiff line numberDiff line change
@@ -743,5 +743,23 @@
743743
</plugins>
744744
</build>
745745
</profile>
746+
<profile>
747+
<id>cloudBuild</id>
748+
<activation>
749+
<property><name>cloudBuild</name></property>
750+
</activation>
751+
<build>
752+
<plugins>
753+
<plugin>
754+
<groupId>org.apache.maven.plugins</groupId>
755+
<artifactId>maven-surefire-plugin</artifactId>
756+
<configuration>
757+
<useFile>false</useFile>
758+
<redirectTestOutputToFile>false</redirectTestOutputToFile>
759+
</configuration>
760+
</plugin>
761+
</plugins>
762+
</build>
763+
</profile>
746764
</profiles>
747765
</project>

0 commit comments

Comments
 (0)