Skip to content

Commit 0676f48

Browse files
author
Prince Rachit Sinha
committed
Add dev-loop readme
1 parent 6cb679d commit 0676f48

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

components/image-builder-bob/.vscode/launch.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
"showLog": true,
1313
"trace": "log",
1414
"logOutput": "rpc"
15+
},
16+
{
17+
"name": "bob proxy",
18+
"type": "go",
19+
"request": "launch",
20+
"mode": "debug",
21+
"program": "/workspace/gitpod/components/image-builder-bob/main.go",
22+
"args": ["proxy"],
23+
"envFile": "/workspace/gitpod/components/image-builder-bob/bob.env"
1524
}
1625
]
17-
}
26+
}

components/image-builder-bob/README.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,26 @@ docker build -t localhost:5000/source:latest .
2727
docker push localhost:5000/source:latest
2828
```
2929

30-
Build and run
30+
Build and Debug Locally
31+
3132
```
32-
# build and install bob (do this after every change)
33-
cd /workspace/gitpod/components/image-builder-bob
34-
go install
33+
# create a file using the contents of Google artifact registry https://www.notion.so/gitpod/Bob-proxy-env-vars-a8c3feb32092410296b7e913746fed45
34+
35+
touch /workspace/gitpod/components/image-builder-bob/bob.env
36+
37+
# Start bob proxy in debug mode using vs code `bob proxy`
38+
# Use CMD+SHIFT+D to open menu and then select bob proxy and then run
39+
40+
# Add break points as per your needs
41+
42+
# export bob.env variables so that bob build uses correct values while trying to build an image
43+
44+
set -a
45+
source <(cat bob.env | \
46+
sed -e '/^#/d;/^\s*$/d' -e "s/'/'\\\''/g" -e "s/=\(.*\)/='\1'/g")
47+
set +a
3548
36-
# run bob
37-
BOB_BASE_REF=localhost:5000/source:latest BOB_TARGET_REF=localhost:5000/target:83 sudo -E $(which bob) build
3849
39-
# debug using delve
40-
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
50+
# Run bob build. This will trigger several calls to the container registry
51+
sudo -E $(which bob) build
4152
```

0 commit comments

Comments
 (0)