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
--- | |
formatter: "markdown table" | |
version: ">= 0.13" | |
header-from: "README.header.md" | |
content: "" | |
output: |
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
--- | |
services: | |
terraform: | |
image: hashicorp/terraform:1.4.0 | |
working_dir: ${PWD} | |
entrypoint: ../tf.sh | |
volumes: | |
- ${PWD}:/${PWD} | |
- /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem:/etc/ssl/certs/ca-certificates.crt | |
environment: |
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
provider "gitlab" { | |
token = var.gitlab_token | |
base_url = var.gitlab_url | |
} |
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
TF_HTTP_ADDRESS=https://gitlab.com/api/v4/projects/4480/terraform/state/${TF_VAR_foo} | |
TF_HTTP_LOCK_METHOD=POST | |
TF_HTTP_LOCK_ADDRESS=https://gitlab.com/api/v4/projects/4480/terraform/state/${TF_VAR_foo}/lock | |
TF_HTTP_UNLOCK_ADDRESS=https://gitlab.com/api/v4/projects/4480/terraform/state/${TF_VAR_foo}/lock | |
TF_HTTP_UNLOCK_METHOD=DELETE | |
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
# Mount the current directory as the working directory in the contianer (great for linting etc) | |
alias docker-run='docker run -it --workdir ${PWD} -v ${PWD}:${PWD}' | |
# Generate a Dockerfile from an image | |
alias dfimage="docker-run -v /var/run/docker.sock:/var/run/docker.sock --rm alpine/dfimage" | |
# Python linting | |
alias flake8="docker-run python:3-alpine flake8" |
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
_gbclean () { | |
default_branch=$( git remote show origin | sed -n '/HEAD branch/s/.*: //p') | |
git checkout "${default_branch}" && git pull && \ | |
for branch in $(git branch -l | grep -v -e "${default_branch}" ); do | |
git branch -d $branch | |
done | |
} | |
alias gbclean='_gbclean' |
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 python | |
# This is a trick, to output the bash commands we need to run in shell, and just execute this script inside an eval within our shell, so it imports what we need | |
# Possibly tie this in with https://gist.github.com/mbainter/b38a4cb411c0b5c1bae6 for MFA support | |
# Will need to durably store MFA access tokens, possibly in some other env vars | |
# Could also store all different keys/info in different vars, to reuse as needed (lots of env vars though, file may be better) | |
import os | |
import sys | |
import getpass |