Skip to content

randomcoww/etcd-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image build

TAG=ghcr.io/randomcoww/etcd-wrapper:$(date -u +'%Y%m%d').6

mkdir -p build
TMPDIR=$(pwd)/build podman build \
  -t $TAG .

podman push $TAG

Dev build

podman run -it --rm \
  -v $(pwd):/go/etcd-wrapper \
  -w /go/etcd-wrapper \
   golang:alpine sh

Test environment

Define the tw (terraform wrapper) command

mkdir -p $HOME/.aws

tw() {
  set -x
  podman run -it --rm --security-opt label=disable \
    --entrypoint='' \
    -v $(pwd):$(pwd) \
    -w $(pwd) \
    -v $HOME/.aws:/root/.aws \
    --net=host \
    docker.io/hashicorp/terraform:latest "$@"
  rc=$?; set +x; return $rc
}
tw terraform -chdir=testenv init
tw terraform -chdir=testenv apply

Run wrapper instances

podman play kube testenv/output/node0.yaml & \
podman play kube testenv/output/node1.yaml & \
podman play kube testenv/output/node2.yaml

Monitor logs

podman logs -f etcd-node0-wrapper-etcd-wrapper
podman logs -f etcd-node1-wrapper-etcd-wrapper
podman logs -f etcd-node2-wrapper-etcd-wrapper

Cleanup

podman play kube testenv/output/node0.yaml --down & \
podman play kube testenv/output/node1.yaml --down & \
podman play kube testenv/output/node2.yaml --down

tw terraform -chdir=testenv destroy

Cleanup formatting

tw find . -name '*.tf' -exec terraform fmt '{}' \;