Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Revert 186 and 187 for injecting version during build #206

Merged
merged 3 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ ifeq (,$(wildcard /sys/kernel/btf/vmlinux))
BPF_HEADERS += -DBPF_NO_PRESERVE_ACCESS_INDEX
endif

RELEASE_VERSION ?= $(shell git describe --always --match "v[0-9]*")
IMG_NAME ?= hny/network-agent
IMG_TAG ?= local

.PHONY: version
#: display the current computed project version
version:
@echo $(RELEASE_VERSION)

.PHONY: generate
generate: export CFLAGS := $(BPF_HEADERS)
#: generate go/bpf interop code
Expand All @@ -36,10 +30,7 @@ docker-generate:
.PHONY: build
#: compile the agent executable
build:
CGO_ENABLED=1 GOOS=linux \
go build \
--ldflags "-X main.Version=$(RELEASE_VERSION)" \
-o hny-network-agent main.go
CGO_ENABLED=1 GOOS=linux go build -o hny-network-agent main.go

.PHONY: docker-build
#: build the agent image
Expand Down Expand Up @@ -110,4 +101,4 @@ port-forward-pyroscope:
.PHONY: unapply-pyroscope-server
#: tear down pyroscope server
unapply-pyroscope-server:
helm uninstall pyroscope
helm uninstall pyroscope
5 changes: 3 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Releasing

- Update `CHANGELOG.md` with the changes since the last release. Consider automating with a command such as one of these two:
- Update version number in `main.go`
- Update `CHANGELOG.md` with the changes since the last release. Consider automating with a command such as these two:
- `git log $(git describe --tags --abbrev=0)..HEAD --no-merges --oneline > new-in-this-release.log`
- `git log --pretty='%C(green)%d%Creset- %s | [%an](https://github.com/)'`
- Commit changes, push, and open a release preparation pull request for review.
- Once the pull request is merged, fetch the updated `main` branch.
- Apply an annotated tag (`git tag -a`) for the new version on the merged commit (e.g. `git tag -a v0.1.0-alpha -m "v0.1.0-alpha"`)
- Apply a tag for the new version on the merged commit (e.g. `git tag -a v0.1.0-alpha -m "v0.1.0-alpha"`)
- Push the tag upstream (this will kick off the release pipeline in CI) e.g. `git push origin v0.1.0-alpha`
- Ensure that there is a draft GitHub release created as part of CI publish steps.
- Click "generate release notes" in GitHub for full changelog notes and any new contributors
Expand Down
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import (
semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
)

var Version string = "dev"

const Version string = "0.0.15-alpha"
const defaultDataset = "hny-network-agent"
const defaultEndpoint = "https://api.honeycomb.io"

Expand Down