diff --git a/.gitignore b/.gitignore index e6c0ea5..0f246c7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ ddayconfig.yml !docs/ddayconfig.yml doomsday-darwin-amd64 doomsday-darwin-arm64 +doomsday-darwin doomsday-linux +doomsday-linux-amd64 !client/doomsday node_modules diff --git a/Makefile b/Makefile index e39c152..b1ed322 100644 --- a/Makefile +++ b/Makefile @@ -1,46 +1,39 @@ BUILD_TARGET ?= cmd/*.go APP_NAME := doomsday OUTPUT_NAME ?= $(APP_NAME) -SHELL := /bin/bash +SHELL := $(shell which bash) COMMIT_HASH := $(shell git log --pretty='format:%h' -n 1) DIRTY_LINE := $(shell git diff --shortstat 2> /dev/null | tail -n1) ifneq ("$(DIRTY_LINE)", "") DIRTY := + endif VERSION ?= development -LOCAL_GOOS=$(shell go env GOOS) -LOCAL_GOARCH=$(shell go env GOARCH) -LDFLAGS := -X "github.com/doomsday-project/doomsday/version.Version=$(VERSION)-$(COMMIT_HASH)$(DIRTY)" +LDFLAGS := -X "main.Version=$(VERSION)-$(COMMIT_HASH)$(DIRTY)" BUILD := go build -v -ldflags='$(LDFLAGS)' -o $(OUTPUT_NAME) $(BUILD_TARGET) -.PHONY: build darwin darwin-amd64 darwin-arm64 linux all clean embed server tsc +.PHONY: build server darwin darwin-amd64 darwin-arm64 linux linux-amd64 embed tsc all clean .DEFAULT: build - -#: Generic server build for all platfomrs build: embed server -server: +server: @echo $(VERSION)-$(COMMIT_HASH)$(DIRTY) - GOOS=$(GOOS) GOARCH=$(GOARCH) $(BUILD) + GOOS=$(GOOS) GOARCH=$(GOARCH) VERSION=$(VERSION) $(BUILD) -#: Builds all OSX executable darwin: darwin-amd64 darwin-arm64 -#: Builds arm64 OSX executable +darwin-amd64: + GOOS=darwin GOARCH=amd64 OUTPUT_NAME=$(APP_NAME)-darwin-amd64 $(MAKE) server + darwin-arm64: - GOOS=darwin GOARCH=arm64 OUTPUT_NAME=$(APP_NAME)-darwin-arm64 VERSION="$(VERSION)" $(MAKE) server + GOOS=darwin GOARCH=arm64 OUTPUT_NAME=$(APP_NAME)-darwin-arm64 $(MAKE) server -#: Builds amd64 OSX executable -darwin-amd64: - GOOS=darwin GOARCH=amd64 OUTPUT_NAME=$(APP_NAME)-darwin-amd64 VERSION="$(VERSION)" $(MAKE) server +linux: linux-amd64 -#: Builds amd64 linux executable -linux: - GOOS=linux GOARCH=amd64 OUTPUT_NAME=$(APP_NAME)-linux VERSION="$(VERSION)" $(MAKE) server +linux-amd64: + GOOS=linux GOARCH=amd64 OUTPUT_NAME=$(APP_NAME)-linux-amd64 $(MAKE) server -#: Build client and server doomsday components -all: embed darwin linux server +all: embed darwin linux embed: tsc GOOS="" GOARCH="" go run web/embed/main.go web/embed/mappings.yml @@ -50,4 +43,4 @@ tsc: tsc --project web/tsconfig.json clean: - rm -f $(APP_NAME) $(APP_NAME)-darwin-* $(APP_NAME)-linux + rm -f $(APP_NAME) $(APP_NAME)-darwin-amd64 $(APP_NAME)-darwin-arm64 $(APP_NAME)-linux-amd64 diff --git a/go.mod b/go.mod index b022ea7..4245923 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,9 @@ module github.com/doomsday-project/doomsday -go 1.13 +go 1.18 require ( code.cloudfoundry.org/credhub-cli v0.0.0-20191230184144-6e537b521d9d - github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect - github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect github.com/cloudfoundry-community/vaultkv v0.1.1 github.com/gorilla/mux v1.7.3 github.com/olekukonko/tablewriter v0.0.4 @@ -14,7 +12,19 @@ require ( github.com/starkandwayne/goutils v0.0.0-20190115202530-896b8a6904be github.com/thomasmitchell/go-shout v0.0.0-20200117221442-ad6c1a8d1669 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 - golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098 // indirect gopkg.in/alecthomas/kingpin.v2 v2.2.6 gopkg.in/yaml.v2 v2.3.0 ) + +require ( + github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect + github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect + github.com/cloudfoundry/go-socks5 v0.0.0-20180221174514-54f73bdb8a8e // indirect + github.com/cloudfoundry/socks5-proxy v0.2.0 // indirect + github.com/google/uuid v1.0.0 // indirect + github.com/hashicorp/go-version v0.0.0-20171129150820-4fe82ae3040f // indirect + github.com/mattn/go-isatty v0.0.3 // indirect + github.com/mattn/go-runewidth v0.0.7 // indirect + golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 // indirect + golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098 // indirect +) diff --git a/go.sum b/go.sum index 7787ce4..6f7771d 100644 --- a/go.sum +++ b/go.sum @@ -33,7 +33,6 @@ github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0 github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= diff --git a/web/package-lock.json b/web/package-lock.json index 1153153..a01c109 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -1,28 +1,6 @@ { - "name": "web", - "lockfileVersion": 2, "requires": true, - "packages": { - "": { - "dependencies": { - "@types/jquery": "^3.5.1", - "@types/sizzle": "^2.3.3" - } - }, - "node_modules/@types/jquery": { - "version": "3.5.14", - "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.14.tgz", - "integrity": "sha512-X1gtMRMbziVQkErhTQmSe2jFwwENA/Zr+PprCkF63vFq+Yt5PZ4AlKqgmeNlwgn7dhsXEK888eIW2520EpC+xg==", - "dependencies": { - "@types/sizzle": "*" - } - }, - "node_modules/@types/sizzle": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz", - "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==" - } - }, + "lockfileVersion": 1, "dependencies": { "@types/jquery": { "version": "3.5.14",