mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-24 05:51:38 +02: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
|
fetch-depth: 0
|
||||||
- id: ldflags
|
- id: ldflags
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=ldflags::$(./scripts/client-ldflags)"
|
echo "::set-output name=value::$(./scripts/client-ldflags)"
|
||||||
|
|
||||||
# Trusted builder.
|
# Trusted builder.
|
||||||
build:
|
build:
|
||||||
|
10
Makefile
10
Makefile
@ -2,16 +2,10 @@ test:
|
|||||||
HISHTORY_TEST=1 go test -p 1 ./...
|
HISHTORY_TEST=1 go test -p 1 ./...
|
||||||
|
|
||||||
release:
|
release:
|
||||||
expr `cat VERSION` + 1 > VERSION
|
|
||||||
git tag v0.`cat VERSION`
|
git tag v0.`cat VERSION`
|
||||||
|
expr `cat VERSION` + 1 > VERSION
|
||||||
git push --tags
|
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
|
build-static: build-binary
|
||||||
docker build -t gcr.io/dworken-k8s/hishtory-static -f web/caddy/Dockerfile .
|
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
|
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'`\"}}}}}}"
|
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 {
|
func Update(url string) error {
|
||||||
var stdout bytes.Buffer
|
var stdout bytes.Buffer
|
||||||
var stderr 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.Stdout = &stdout
|
||||||
cmd.Stderr = &stderr
|
cmd.Stderr = &stderr
|
||||||
err := cmd.Run()
|
err := cmd.Run()
|
||||||
|
@ -49,7 +49,7 @@ func main() {
|
|||||||
fmt.Print(GitCommit)
|
fmt.Print(GitCommit)
|
||||||
fmt.Print("\n")
|
fmt.Print("\n")
|
||||||
case "update":
|
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:
|
default:
|
||||||
lib.CheckFatalError(fmt.Errorf("unknown command: %s", os.Args[1]))
|
lib.CheckFatalError(fmt.Errorf("unknown command: %s", os.Args[1]))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user