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
FROM python:3.9-buster | |
# Prevents issues with cloning private PIP packages from GitHub | |
RUN --mount=type=ssh mkdir -p ~/.ssh && ssh-keyscan -H github.com >> ~/.ssh/known_hosts | |
RUN pip install --upgrade pip | |
RUN pip install pipenv | |
COPY . . | |
# Use the forwarded SSH agent when installing pip packages |
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
<?php | |
// Load application-specific configuration | |
try { | |
$basepath = __DIR__ . '/config'; | |
$configuration = Yaml::parse($basepath . '/config.yml'); | |
} catch (\InvalidArgumentException $exception) { | |
exit("Are you sure the configuration files exist?"); | |
} |
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
#!/bin/bash | |
if [ "$#" -ne 1 ] | |
then | |
echo "Usage: restart_namespace \$NAMESPACE" | |
exit 1 | |
fi | |
NAMESPACE=$1 | |
echo "Restarting all deployments in $NAMESPACE..." |
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
#!/bin/bash | |
URI=https://www.yahoo.com | |
INTERVAL_IN_SECONDS=0.5 | |
RESULTS_PER_LINE=50 | |
echo "Checking $URI at ${INTERVAL_IN_SECONDS}s intervals..." | |
check_uri () { |
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
#!/bin/bash | |
# Random number between 1 and 10 | |
WAIT=`shuf -i 1-10 -n 1` | |
# Subtract 1 from the random number, check if it is now 0 | |
is_random_number_zero () { | |
let WAIT=WAIT-1 | |
return $([[ "$WAIT" -eq "0" ]]) | |
} |
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
resource "google_compute_firewall" "allow_nodes_from_cloud_iap" { | |
name = "allow-gke-nodes-ssh-from-cloud-iap" | |
description = "Allow Cloud IAP to communicate with the the GKE nodes." | |
network = var.network | |
allow { | |
protocol = "tcp" | |
ports = ["22"] | |
} |
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
apiVersion: networking.gke.io/v1beta2 | |
kind: ManagedCertificate | |
metadata: | |
name: {{ .Values.domain | replace "." "-" }} | |
namespace: kise | |
spec: | |
domains: | |
- {{ .Values.domain }} |
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
locals { | |
project_ids = [123456789012, 234567890123, 345678901234] | |
bucket_region = "us" | |
bucket_project = "something-123456" | |
bucket_name = "${local.bucket_region}.artifacts.${local.bucket_project}.appspot.com" | |
} | |
# Allow Cloud Build in every other project access to GCR images hosted in the central project | |
resource "google_storage_bucket_iam_member" "container_registry" { | |
for_each = var.project_ids |
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
locals { | |
project_ids = [123456789012, 234567890123, 345678901234] | |
} | |
# Allow every other project access to GCE VM images in a central project | |
resource "google_project_iam_member" "image_user" { | |
for_each = local.project_ids | |
project = "tools-275721" | |
role = "roles/compute.imageUser" |
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
resource "google_service_account" "service_account" { | |
account_id = "test | |
display_name = "Test" | |
} | |
resource "google_service_account_key" "service_account" { | |
service_account_id = google_service_account.service_account.name | |
public_key_type = "TYPE_X509_PEM_FILE" | |
} |