Skip to content

Commit

Permalink
Merge pull request #47 from aquilax/monorepo
Browse files Browse the repository at this point in the history
Restructured to monorepo
  • Loading branch information
aquilax authored Apr 7, 2022
2 parents c6759f1 + 13b6971 commit 39b992e
Show file tree
Hide file tree
Showing 104 changed files with 1,573 additions and 1,337 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18

- name: Build
run: go build -v ./...
run: go build -v $(go list -m)

- name: Test
run: go test -v ./...
run: go test -v $(go list -m -f '{{.String}}/...')
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ _testmain.go
*.exe
*.test
*.prof
hranoprovod-cli
/hranoprovod-cli
.vscode
dist/
snap-token.txt
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ builds:
- linux
goarch:
- amd64
main: ./hranoprovod/
dir: ./cmd/hranoprovod-cli
binary: hranoprovod-cli

archives:
Expand Down
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
FROM golang:alpine AS builder
FROM golang:alpine3.15 AS builder

RUN apk update && apk add --no-cache git

WORKDIR .
RUN mkdir /build

WORKDIR /build

COPY . .

ENV GOPATH /tmp

RUN go get -d -v
RUN cd cmd/hranoprovod-cli && go get -d -v

ENV CGO_ENABLED 0

RUN go build -o /go/bin/hranoprovod-cli
RUN cd cmd/hranoprovod-cli && go build -o /go/bin/hranoprovod-cli


FROM scratch
Expand Down
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ unexport HR_LOGFILE
unexport HR_CONFIG
unexport HR_DATE_FORMAT

GO=go1.18
SHELL=/bin/bash
TARGET=hranoprovod-cli
MDEXEC=mdexec
SRC=$(shell find . -type f -name '*.go' -not -path "./vendor/*")
DOC_TARGETS=${TARGET} docs/command-line.md docs/usage.md README.md docs/usage.cast
MODULES=$(shell ${GO} list -m)

.DEFAULT_GOAL: $(TARGET)

all: $(TARGET) docs

$(TARGET): $(SRC)
go build -o $(TARGET) hranoprovod/main.go
$(GO) build -o $(TARGET) github.com/aquilax/hranoprovod-cli/v3/cmd/hranoprovod-cli

docs: $(TARGET) docs/command-line.md docs/usage.md README.md

Expand All @@ -30,7 +32,7 @@ README.md: $(TARGET) documentation/README.md
$(MDEXEC) documentation/README.md > $@

test:
go test -v ./...
$(GO) test -v $(MODULES)

test-release:
goreleaser --snapshot --skip-publish --rm-dist
Expand All @@ -43,10 +45,10 @@ documentation/usage.cast: $(TARGET) scripts/usage.sh

cast: $(TARGET) documentation/usage.cast

snapshots:
UPDATE_SNAPSHOTS=1 go test ./...

coverage:
go test -race -coverprofile=coverage.out -covermode=atomic ./...
go tool cover -func=coverage.out
$(GO) test -race -coverprofile=coverage.out -covermode=atomic $(MODULES)
$(GO) tool cover -func=coverage.out
rm coverage.out

docker:
docker build .
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,14 @@ hranoprovod can be installed using a plugin as follows:

First make sure you have go (golang) installed.

http://golang.org/
https://go.dev/

Clone the repository and build/install the tool:

git clone https://github.com/aquilax/hranoprovod-cli.git
cd hranoprovod-cli
cd hranoprovod-cli/cmd/hranoprovod-cli/
go install

### snap

[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/hranoprovod-cli)

## Docker

Expand Down Expand Up @@ -78,8 +75,8 @@ COMMANDS:
csv Generates csv exports
stats Provide stats information
summary Show summary for date
gen Generate documentation
print Print log
gen Generate documentation
help, h Shows a list of commands or help for one command

GLOBAL OPTIONS:
Expand Down
Loading

0 comments on commit 39b992e

Please sign in to comment.