mirror of
https://github.com/ddworken/hishtory.git
synced 2025-02-16 18:41:03 +01:00
trying again with ldflags + fixed update url
This commit is contained in:
parent
f2c6f86204
commit
108e1526b8
2
.github/workflows/slsa-goreleaser.yml
vendored
2
.github/workflows/slsa-goreleaser.yml
vendored
@ -20,7 +20,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
- id: ldflags
|
||||
run: |
|
||||
echo "::set-output name=ldflags::$(./scripts/client-ldflags)"
|
||||
echo "::set-output name=value::$(./scripts/client-ldflags)"
|
||||
|
||||
# Trusted builder.
|
||||
build:
|
||||
|
10
Makefile
10
Makefile
@ -2,16 +2,10 @@ test:
|
||||
HISHTORY_TEST=1 go test -p 1 ./...
|
||||
|
||||
release:
|
||||
expr `cat VERSION` + 1 > VERSION
|
||||
git tag v0.`cat VERSION`
|
||||
expr `cat VERSION` + 1 > VERSION
|
||||
git push --tags
|
||||
|
||||
build-binary:
|
||||
go build -trimpath -o web/landing/www/binaries/hishtory-linux -ldflags "-X main.GitCommit=`git rev-list -1 HEAD`"
|
||||
|
||||
install: build-binary
|
||||
web/landing/www/binaries/hishtory-linux install
|
||||
|
||||
build-static: build-binary
|
||||
docker build -t gcr.io/dworken-k8s/hishtory-static -f web/caddy/Dockerfile .
|
||||
|
||||
@ -26,5 +20,5 @@ deploy-api: build-api
|
||||
docker push gcr.io/dworken-k8s/hishtory-api
|
||||
kubectl patch deployment hishtory-api -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"ts\":\"`date|sed -e 's/ /_/g'|sed -e 's/:/-/g'`\"}}}}}}"
|
||||
|
||||
deploy: deploy-static deploy-api
|
||||
deploy: deploy-static deploy-api release
|
||||
|
||||
|
@ -385,7 +385,7 @@ func copyFile(src, dst string) error {
|
||||
func Update(url string) error {
|
||||
var stdout bytes.Buffer
|
||||
var stderr bytes.Buffer
|
||||
cmd := exec.Command("bash", "-c", "curl -o /tmp/hishtory-client "+url+"; chmod +x /tmp/hishtory-client")
|
||||
cmd := exec.Command("bash", "-c", "curl -L -o /tmp/hishtory-client "+url+"; chmod +x /tmp/hishtory-client")
|
||||
cmd.Stdout = &stdout
|
||||
cmd.Stderr = &stderr
|
||||
err := cmd.Run()
|
||||
|
@ -49,7 +49,7 @@ func main() {
|
||||
fmt.Print(GitCommit)
|
||||
fmt.Print("\n")
|
||||
case "update":
|
||||
lib.CheckFatalError(lib.Update("https://hishtory.dev/binaries/hishtory-linux"))
|
||||
lib.CheckFatalError(lib.Update("https://api.hishtory.dev/download/hishtory-linux-amd64"))
|
||||
default:
|
||||
lib.CheckFatalError(fmt.Errorf("unknown command: %s", os.Args[1]))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user