Skip to content

Commit

Permalink
Add dev-loop readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Prince Rachit Sinha committed May 17, 2022
1 parent 6cb679d commit 0676f48
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
11 changes: 10 additions & 1 deletion components/image-builder-bob/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
"showLog": true,
"trace": "log",
"logOutput": "rpc"
},
{
"name": "bob proxy",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "/workspace/gitpod/components/image-builder-bob/main.go",
"args": ["proxy"],
"envFile": "/workspace/gitpod/components/image-builder-bob/bob.env"
}
]
}
}
27 changes: 19 additions & 8 deletions components/image-builder-bob/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,26 @@ docker build -t localhost:5000/source:latest .
docker push localhost:5000/source:latest
```

Build and run
Build and Debug Locally

```
# build and install bob (do this after every change)
cd /workspace/gitpod/components/image-builder-bob
go install
# create a file using the contents of Google artifact registry https://www.notion.so/gitpod/Bob-proxy-env-vars-a8c3feb32092410296b7e913746fed45
touch /workspace/gitpod/components/image-builder-bob/bob.env
# Start bob proxy in debug mode using vs code `bob proxy`
# Use CMD+SHIFT+D to open menu and then select bob proxy and then run
# Add break points as per your needs
# export bob.env variables so that bob build uses correct values while trying to build an image
set -a
source <(cat bob.env | \
sed -e '/^#/d;/^\s*$/d' -e "s/'/'\\\''/g" -e "s/=\(.*\)/='\1'/g")
set +a
# run bob
BOB_BASE_REF=localhost:5000/source:latest BOB_TARGET_REF=localhost:5000/target:83 sudo -E $(which bob) build
# debug using delve
BOB_BASE_REF=localhost:5000/source:latest BOB_TARGET_REF=localhost:5000/target:83 sudo -E $(which dlv) --listen=:2345 --headless=true --api-version=2 exec $(which bob) build
# Run bob build. This will trigger several calls to the container registry
sudo -E $(which bob) build
```

0 comments on commit 0676f48

Please sign in to comment.