commit b44236e83b5d6def071acc58a860b0856aa55139
parent 02f9fe4433fe6458a98356aca6dfc49ac5657958
Author: Sean Enck <sean@ttypty.com>
Date: Sat, 21 Jun 2025 07:42:19 -0400
Revert (remove make)
This reverts commit 02f9fe4433fe6458a98356aca6dfc49ac5657958.
This reverts commit d4461083af72f41cbc5e92f5654fc7887fb636a9.
This reverts commit 617d63e265c5e5188d39c90c1815a3ea31e640d6.
This reverts commit d9479cc6857dde4738924eecaa433be7bb5e2b77.
This reverts commit fbf34524885c621394dadc2441d331e2762f494b.
This reverts commit 1dd1597065158b238319370ef62b20eb56203da2.
Diffstat:
4 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/.build.yml b/.build.yml
@@ -1,8 +1,9 @@
image: alpine/edge
packages:
+ - make
- go
tasks:
- build: |
- cd lockbox && go build -o target/lb cmd/lb/main.go
+ cd lockbox && make
- check: |
- cd lockbox && go test -tags=integration ./...
+ cd lockbox && make check
diff --git a/Makefile b/Makefile
@@ -0,0 +1,28 @@
+GOFLAGS := -trimpath -buildmode=pie -mod=readonly -modcacherw -buildvcs=false
+TARGET := target
+VERISON := `git log -n 1 --format=%h`
+OBJECT := $(TARGET)/lb
+GOTEST := LOCKBOX_CONFIG_TOML=fake go test
+CMD := cmd/lb
+cmd := "cmd/lb"
+
+all: setup $(OBJECT)
+
+setup:
+ @test -d $(TARGET) || mkdir -p $(TARGET)
+
+$(OBJECT): go.* cmd/lb/*.go internal/**/*.go internal/**/**/*.go internal/**/**/**/*.*
+ go build $(GOFLAGS) -ldflags "$(LDFLAGS) -X main.version=$(VERSION)" -o "$(OBJECT)" $(CMD)/main.go
+
+unittest:
+ $(GOTEST) ./...
+
+check: unittest tests
+
+tests: $(OBJECT)
+ $(GOTEST) $(CMD)/main_test.go
+
+clean:
+ rm -f "$(OBJECT)"
+ find internal/ $(CMD) -type f -wholename "*testdata*" -delete
+ find internal/ $(CMD) -type d -empty -delete
diff --git a/README.md b/README.md
@@ -116,3 +116,12 @@ Setup the `.gitattributes` for the repository to include
```
*.kdbx diff=lb
```
+
+## build
+
+Clone this repository and:
+```
+make
+```
+
+_run `make check` to run tests_
diff --git a/cmd/lb/main_test.go b/cmd/lb/main_test.go
@@ -77,7 +77,6 @@ func TestBoth(t *testing.T) {
}
func run(t *testing.T, profile string) {
- os.Setenv("LOCKBOX_CONFIG_TOML", "fake")
if err := test(profile); err != nil {
t.Errorf("%s failed: %v", profile, err)
}