-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First draft at setting up Cloudbuild
Revert dependencies
- Loading branch information
1 parent
00a1e0d
commit 54c6cdc
Showing
9 changed files
with
609 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip | ||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This Dockerfile creates an image for running presubmit tests. | ||
FROM openjdk:8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
steps: | ||
# 1. Create a Docker image containing hadoop-connectors repo | ||
- name: 'gcr.io/cloud-builders/docker' | ||
id: 'docker-build' | ||
args: ['build', '--tag=gcr.io/$PROJECT_ID/dataproc-hive-bigquery-storage-handler-presubmit', '-f', 'cloudbuild/Dockerfile', '.'] | ||
|
||
# 2. Fetch maven and dependencies | ||
- name: 'gcr.io/$PROJECT_ID/dataproc-hive-bigquery-storage-handler-presubmit' | ||
id: 'init' | ||
waitFor: ['docker-build'] | ||
entrypoint: 'bash' | ||
args: ['/workspace/cloudbuild/presubmit.sh', 'init'] | ||
env: | ||
- 'CODECOV_TOKEN=${_CODECOV_TOKEN}' | ||
|
||
# 3. Run unit tests | ||
- name: 'gcr.io/$PROJECT_ID/dataproc-hive-bigquery-storage-handler-presubmit' | ||
id: 'unit-tests' | ||
waitFor: ['init'] | ||
entrypoint: 'bash' | ||
args: ['/workspace/cloudbuild/presubmit.sh', 'unittest'] | ||
env: | ||
- 'CODECOV_TOKEN=${_CODECOV_TOKEN}' | ||
|
||
# Tests take around 30 mins in general. | ||
timeout: 1800s | ||
|
||
options: | ||
machineType: 'N1_HIGHCPU_32' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 | ||
https://maven.apache.org/xsd/settings-1.0.0.xsd"> | ||
<mirrors> | ||
<mirror> | ||
<id>google-maven-central</id> | ||
<name>GCS Maven Central mirror</name> | ||
<url>https://maven-central.storage-download.googleapis.com/maven2/</url> | ||
<mirrorOf>central</mirrorOf> | ||
</mirror> | ||
</mirrors> | ||
</settings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2019 Google Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the 'License'); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an 'AS IS' BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -euxo pipefail | ||
|
||
readonly MVN="./mvnw -B -e -s /workspace/cloudbuild/gcp-settings.xml -Dmaven.repo.local=/workspace/.repository" | ||
readonly STEP=$1 | ||
|
||
cd /workspace | ||
|
||
case $STEP in | ||
# Download maven and all the dependencies | ||
init) | ||
$MVN install -DskipTests | ||
exit | ||
;; | ||
|
||
# Run unit tests | ||
unittest) | ||
$MVN test | ||
;; | ||
|
||
*) | ||
echo "Unknown step $STEP" | ||
exit 1 | ||
;; | ||
esac | ||
|
Oops, something went wrong.