fix: Make a separate cmd/doggo package for main files
Closes https://github.com/mr-karan/doggo/issues/1pull/4/head
parent
724114e144
commit
4d618b892b
|
@ -16,7 +16,7 @@ builds:
|
||||||
- 7
|
- 7
|
||||||
ldflags:
|
ldflags:
|
||||||
- -s -w -X "main.buildVersion={{ .Tag }} ({{ .ShortCommit }} {{ .Date }})"
|
- -s -w -X "main.buildVersion={{ .Tag }} ({{ .ShortCommit }} {{ .Date }})"
|
||||||
dir: ./cmd/
|
dir: ./cmd/doggo/
|
||||||
|
|
||||||
archives:
|
archives:
|
||||||
- format: tar.gz
|
- format: tar.gz
|
||||||
|
|
13
Makefile
13
Makefile
|
@ -1,24 +1,21 @@
|
||||||
DOGGO-BIN := doggo
|
BIN := ./bin/doggo
|
||||||
|
|
||||||
HASH := $(shell git rev-parse --short HEAD)
|
HASH := $(shell git rev-parse --short HEAD)
|
||||||
BUILD_DATE := $(shell date '+%Y-%m-%d %H:%M:%S')
|
BUILD_DATE := $(shell date '+%Y-%m-%d %H:%M:%S')
|
||||||
VERSION := ${HASH}
|
VERSION := ${HASH}
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: ## Build the doggo binary
|
build:
|
||||||
mkdir -p bin/; \
|
go build -o ${BIN} -ldflags="-X 'main.buildVersion=${VERSION}' -X 'main.buildDate=${BUILD_DATE}'" ./cmd/doggo/
|
||||||
cd cmd/; \
|
|
||||||
go build -ldflags="-X 'main.buildVersion=${VERSION}' -X 'main.buildDate=${BUILD_DATE}'" -o ${DOGGO-BIN} ./... && \
|
|
||||||
mv ${DOGGO-BIN} ../bin/${DOGGO-BIN}
|
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run: build ## Build and Execute the binary after the build step
|
run: build ## Build and Execute the binary after the build step
|
||||||
./bin/${DOGGO-BIN}
|
${BIN}
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
go clean
|
go clean
|
||||||
- rm -f ./bin/${BIN}
|
- rm -f ${BIN}
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint:
|
lint:
|
||||||
|
|
|
@ -62,6 +62,14 @@ You can supply all arguments to the CLI directly to `docker run` command. Eg:
|
||||||
$ sudo snap install doggo
|
$ sudo snap install doggo
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### From Source
|
||||||
|
|
||||||
|
You need to have `go` installed in your system.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ go get github.com/mr-karan/doggo/cmd/doggo
|
||||||
|
```
|
||||||
|
|
||||||
**NOTE**: Since the [confinement](https://snapcraft.io/docs/snap-confinement) mode is strict as of now, it cannot access your host's `/etc/resolv.conf`.
|
**NOTE**: Since the [confinement](https://snapcraft.io/docs/snap-confinement) mode is strict as of now, it cannot access your host's `/etc/resolv.conf`.
|
||||||
I'll be making a request in the Snap forums soon so that it can be manually reviewed and allowed to use `--classic`. Until then, please specify a namesever manually
|
I'll be making a request in the Snap forums soon so that it can be manually reviewed and allowed to use `--classic`. Until then, please specify a namesever manually
|
||||||
if using `snap`.
|
if using `snap`.
|
||||||
|
|
Loading…
Reference in New Issue