jx-changelog is a small command line tool for generating release Changelog files
To debug jx changelog inside a Running container:
First modify you pipeline by editing release.yaml in your project and add
script: |
#!/usr/bin/env sh
# default script content before `jx changelog create` in https://github.com/jenkins-x/jx3-pipeline-catalog/blob/master/tasks/gradle/release.yaml or similar
while sleep 10; do echo "waiting for debug"; doneto the step promote-changelog
build your version of jx changelog locally, and copy it inside the container
make build
kubectl cp ./build/jx-changelog release-xxxxxxxx:/ -c step-promote-changelogonce the pipeline reaches the promote-changelog step, exec into the container:
kubectl exec -it release-xxxxxxxx -c step-promote-changelog -- shand run:
# apk update; apk add go doesn't work anymore, version of alpine too old
wget https://go.dev/dl/go1.22.1.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go install github.com/go-delve/delve/cmd/dlv@latestthen debug your binary using dlv
source /workspace/source/.jx/variables.sh # copied from pipeline
/tekton/home/go/bin/dlv --listen=:2345 --headless=true --api-version=2 exec /jx-changelog create -- --version v${VERSION}redirect traffic from your port 2345 to the container in another terminal
kubectl port-forward release-xxxxxxxx 2345attach your debugger and happy debugging.
Do not forget to make build and kubectl cp after each change
See the jx-changelog command reference