Skip to content

Commit

Permalink
Add Cloud Build for presubmit test (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
functicons authored Jun 14, 2019
1 parent eddbad5 commit f29ce54
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cloud_build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This Dockerfile creates an image for running presubmit tests.

FROM gcr.io/cloud-builders/gcloud

# Copy everything into the container
COPY . /dataproc-custom-images/
RUN ls -a /dataproc-custom-images

ENTRYPOINT ["bash", "/dataproc-custom-images/cloud_build/presubmit.sh"]
8 changes: 8 additions & 0 deletions cloud_build/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
steps:
# 1. Create a Docker image containing dataproc-custom-images repo
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--tag=gcr.io/google.com/cloud-dataproc-ci/dataproc-custom-images-presubmit', '-f', 'cloud_build/Dockerfile', '.']
# 2. Run presumit tests
- name: 'gcr.io/google.com/cloud-dataproc-ci/dataproc-custom-images-presubmit'
entrypoint: 'bash'
args: ['/dataproc-custom-images/cloud_build/presubmit.sh']
20 changes: 20 additions & 0 deletions cloud_build/presubmit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/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.

cd /dataproc-custom-images

# Run all tests
python2 -m unittest discover

0 comments on commit f29ce54

Please sign in to comment.