Skip to content

Instantly share code, notes, and snippets.

@paparaka
paparaka / app.py
Last active March 6, 2020 16:32
Flask.Exception.Chaining
"""
An example Flask app that uses Exceptions to return errors to clients
"""
from flask import Flask, jsonify
app = Flask(__name__)
class APIError(Exception):
"""All custom API Exceptions"""
@paparaka
paparaka / Dockerfile
Last active February 8, 2020 20:02
K8.Testing.CloudBuild
FROM gcr.io/cloud-builders/gcloud
RUN apt-get -y update && \
apt-get -y install python3 python3-dev python3-setuptools python3-pip
RUN pip3 install PyYAML Jinja2 simplejson kubernetes \
google-cloud-storage google-api-python-client
RUN apt-get -y remove python-dev python-setuptools wget && \
rm -rf /var/lib/apt/lists/* && \
@paparaka
paparaka / cloudbuild.tf
Last active February 4, 2025 10:47
K8.Jinja.Templating
############################################################################################
# A sample Terraform file that creates the cloud build trigger.
############################################################################################
resource "google_cloudbuild_trigger" "develop_trigger" {
description = "[DEVELOP] Build develop branch"
filename = "cloudbuild.yaml"
trigger_template {
branch_name = "^develop$"
repo_name = "houston"
}
@paparaka
paparaka / kubectl_cheatsheet
Last active October 22, 2019 09:20
Common commands for kubectl
# Change namespace:
kubectl config set-context --current --namespace=
# Run a Debug container. Remember to add namespace
kubectl run -it --rm --restart=Never alpine --image=alpine sh
## The in alpine run
apk add curl