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
#!/usr/bin/env bash | |
# promts for sudo and can be installed via: | |
# wget -O - https://gist.githubusercontent.com/tomdavidson/64828803dbd4718514a465be1d7e908a/raw/75ec0521175b3d8b7d92c188d3dc0d251dbf5469/install-node-zx.sh | bash | |
! type sudo >/dev/null 2>&1 && apt install sudo && usermod -aG sudo "$(whoami)" | |
export CLOUDSDK_CORE_PROJECT='dots-333103' | |
# install NodeJS & zx if not already installed |
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
#!/usr/bin/env bash | |
shopt -s extglob | |
# Lowercased, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with '-'. | |
# No leading or trailing '-'. Useful with URLs, host names, domain names, and stack names. | |
slugify() { | |
: "${1:?'Usage: slugify NAME'}" | |
local next="$1" | |
next="${next,,}" # lowercase | |
next="${next//+([^a-z0-9])/-}" # replace non-alphanumeric wiht '-' | |
next="${next#-}" # remove - from the start |
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
#!/usr/bin/env bash | |
set -euo pipefail | |
DEBUG=${DEBUG:-} | |
help() { | |
cat <<EOF | |
Simple monorepo lifecycle/pipeline tool for running one or more commands on one | |
or more directories that have diffs compared to an ancestor. The primary |
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
#!/usr/bin/env zx | |
const shellFiles = globby.globbySync(['**/*.sh', '**/*.bash'], { gitignore: true }); | |
nothrow($`npx -y shellcheck -f diff ssa-pg/scripts/deploy-infra.sh | git apply`); |
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
$ cat Dockerfile | |
FROM docker.io/hello-world | |
$ docker build --tag uscm5 . | |
STEP 1: FROM docker.io/hello-world | |
STEP 2: COMMIT uscm5 | |
--> d1165f22123 | |
Successfully tagged localhost/uscm5:latest | |
Successfully tagged docker.io/library/hello-world:latest | |
d1165f2212346b2bab48cb01c1e39ee8ad1be46b87873d9ca7a4e434980a7726 |
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
# http://editorconfig.org | |
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = false |
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
variable "config_files_path" { | |
default = "../../teams/*.yaml" | |
description = "The path to team config files" | |
} | |
data "local_file" "configs" { | |
for_each = { for k, file in fileset(dirname(var.config_files_path), basename(var.config_files_path)) : | |
k => abspath("${dirname(var.config_files_path)}/${file}") | |
} |
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
#!/usr/bin/env bash | |
help() { | |
cat <<EOF | |
Simple monorepo lifecycle/pipeline tool for running one or more commands on one | |
or more directories that have diffs compared to an ansector. The primary | |
use case is for selective CI jobs within a trunk based workflow. | |
Takes two arguments, <glob> <command>. The command is invoked from each | |
directory context matching the glob. |
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
## Existing list of teams with members list: | |
"0" = { | |
"description" = "No one cared enough to add a description to this team" | |
"members" = [ | |
{ | |
"role" = "maintainer" | |
"username" = "bob" | |
}, | |
{ |
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
variable "filter" { | |
type = string | |
default = "*.yaml" | |
description = "The pattern used to filter files, i.e. '*.yaml'." | |
} | |
variable "search_dir" { | |
type = string | |
default = "." | |
description = "The the directory to search from. Default is '.'." |