-
This is all to do with upgrade cycles ... At the moment we have: smallweb upgrade
You're compiling from source. Please update manually. If we add an LD flag on build and on install, then everything works for both build and install and other stuff like brew, etc. It will make testing easier too because the above will actually work when "go install" or "go build" or when "brew install", etc Have a ponder about it. It's not blocking me. Here are the minor changes off the top of my head: main.go: package main
var (
version = "dev" // version, set at compile time by ldflags
commit = "" // version's commit hash, set at compile time by ldflags
buildDate = "" // build date, set at compile time by ldflags
)
```sh
SMALLWEB_VERSION=main
SMALLWEB_LD_VERSION=main
SMALLWEB_LD_COMMIT=shell("git rev-parse HEAD")
SMALLWEB_LD_DATE=""
SMALLWEB_LD=-X 'github.com/pomdtr/smallweb/main.version=$(SMALLWEB_LD_VERSION)' -X 'github.com/pomdtr/smallweb/main.commit=$(SMALLWEB_LD_COMMIT)' -X 'github.com/pomdtr/smallweb/main.buildDate=$(SMALLWEB_LD_DATE)'
go install -ldflags="$(SMALLWEB_LD)" github.com/pomdtr/smallweb@$(SMALLWEB_VERSION) .goreleaser: builds:
- id: "spok"
dir: "."
main: "./main.go"
binary: "smallweb"
ldflags:
- -s -w
- -X github.com/pomdtr/smallweb/main.version={{.Version}}
- -X github.com/pomdtr/smallweb/main.commit={{.Commit}}
- -X github.com/pomdtr/smallweb/main.buildDate={{.Date}}
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- "386"
- amd64
- arm64
goarm:
- "7"
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Adding these compile flags make senses, but I don't really understand how it would address your upgrade needs. Can you give me more context on this ? |
Beta Was this translation helpful? Give feedback.
-
I agree that we don’t have to do it . My aim is so that we can do sturdy upgrades in place locally and on servers , so that devs don’t have to do complex cycles. Let’s leave it along for now . I am still pulling together autonomous deployment and upgrade setup and will PR or discuss it as I go , and we can see if we need LD Flags or not . |
Beta Was this translation helpful? Give feedback.
I agree that we don’t have to do it .
My aim is so that we can do sturdy upgrades in place locally and on servers , so that devs don’t have to do complex cycles.
Let’s leave it along for now . I am still pulling together autonomous deployment and upgrade setup and will PR or discuss it as I go , and we can see if we need LD Flags or not .