Skip to content

Instantly share code, notes, and snippets.

@b0noI
Last active April 9, 2019 16:47
Show Gist options
  • Save b0noI/0bb86e0b7b6fa5eb6e28e61708c36e87 to your computer and use it in GitHub Desktop.
Save b0noI/0bb86e0b7b6fa5eb6e28e61708c36e87 to your computer and use it in GitHub Desktop.
# These are Cloud Build steps. You can read more about cloud build here:
# https://cloud.google.com/cloud-build/docs/
# All these steps sharing a filesystem between each other.
steps:
# ↓↓↓↓↓↓↓ Start of Continuous Integration Part ↓↓↓↓↓↓↓↓↓↓↓↓ #####
######### This part will test if Notebook fully executable #####
# First, we need to clone the repository that we need to test.
# This will also clone submodules that are used as dependancies.
- name: 'gcr.io/cloud-builders/git'
args: ['clone', '--recurse-submodules', 'https://github.com/b0noI/notebooks-ci-showcase']
# Next, we need to checkout the exact commit that we need to test. Otherwise, Cloud Build will be testing the master.
# Variable $COMMIT_SHA provided by the Cloud Build. You can find more about Cloud Build variables here:
# https://cloud.google.com/cloud-build/docs/configuring-builds/substitute-variable-values
- name: 'gcr.io/cloud-builders/git'
args: ['checkout', '$COMMIT_SHA']
dir: 'notebooks-ci-showcase'
# This will start notebook background execution.
# You can read more about the background execution here:
# https://blog.kovalevskyi.com/how-to-submit-jupyter-notebook-for-overnight-training-on-gcp-4ce1b0cd4d0d
- name: 'google/cloud-sdk:237.0.0'
args: ['-c', './run_test.sh']
dir: 'notebooks-ci-showcase'
entrypoint: '/bin/bash'
# Secret is needed since we are using Google Map API Key in the Notebook. Notebook just reads the key from the env variables.
# You can read more about Cloud Build Secrets here:
# https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-secrets-credentials
secretEnv: ['API_KEY']
# ↑↑↑↑↑↑↑ End of Continuous Integration Part ↑↑↑↑↑↑↑↑↑↑↑↑↑###############
######### Execution will not process further if notebook is broken #####
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment