Open a bash session to the agent and add the following scripts to the /tmp folder
hoop connect bash
cat - > /tmp/mongo1 <<'EOF'
#!/bin/bash| #!/bin/bash | |
| set -eo pipefail | |
| LINUX_TARGET_USER= | |
| while IFS= read -r line; do | |
| [ -z "$line" ] && continue | |
| USER_EMAIL=$(echo -n $line | awk '{print $1}') | |
| if [ $USER_EMAIL == "$HOOP_USER_EMAIL" ]; then | |
| LINUX_USER=$(echo -n $line | awk '{print $2}') |
| config: | |
| POSTGRES_DB_URI: 'postgres://root:default-pwd@hoopgateway-pg/postgres?sslmode=disable' | |
| API_URL: http://localhost:8009 | |
| defaultAgent: | |
| enabled: true | |
| postgres: | |
| enabled: true | |
| storageClassName: gp2 |
| config: | |
| POSTGRES_DB_URI: 'postgres://root:default-pwd@hoopgateway-pg/postgres?sslmode=disable' | |
| API_URL: http://localhost:8009 | |
| defaultAgent: | |
| enabled: true | |
| postgres: | |
| enabled: true |
| apiVersion: v1 | |
| kind: PersistentVolumeClaim | |
| metadata: | |
| name: postgres-pvc | |
| spec: | |
| accessModes: | |
| - ReadWriteOnce | |
| resources: | |
| requests: | |
| storage: 10Gi |
| #!/bin/bash | |
| PGPASSWORD=$(LC_ALL=C tr -dc A-Za-z0-9_ < /dev/urandom | head -c 43 | xargs) | |
| set -eo pipefail | |
| function echo_normal() { | |
| echo $'\e[1G----->' "$*" | |
| } |
| local wezterm = require 'wezterm' | |
| local projects = require 'projects' | |
| local act = wezterm.action | |
| local config = {} | |
| config.window_frame = { | |
| -- Berkeley Mono for me again, though an idea could be to try a | |
| -- serif font here instead of monospace for a nicer look? | |
| font = wezterm.font({ family = 'Jetbrains Mono', weight = 'Bold' }), | |
| font_size = 11, |
| -- $HOME/.config/wezterm/projects.lua | |
| local wezterm = require 'wezterm' | |
| local module = {} | |
| local function project_dirs() | |
| return { | |
| '~/work/personal/joi2', | |
| '~/work/hoopdev/hoop', | |
| '~/work/hoopdev/documentation', | |
| -- ... keep going, list all your projects |
| provider "aws" { | |
| region = local.region | |
| } | |
| data "terraform_remote_state" "eks" { | |
| backend = "s3" | |
| config = { | |
| bucket = "tfstate" | |
| key = "infra/eks" |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: postgres | |
| spec: | |
| selector: | |
| matchLabels: | |
| app: postgres | |
| strategy: | |
| type: Recreate |