Skip to content
This repository was archived by the owner on Aug 11, 2025. It is now read-only.

Commit f2a287d

Browse files
FS-1203; Change mod name from serverservice to fleetdb. (#17)
1 parent 9f6d3e7 commit f2a287d

File tree

74 files changed

+435
-434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+435
-434
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ cosign.key
1313
cockroach-data/
1414
coverage.txt
1515
*.swp
16-
*.swo
16+
*.swo
17+
fleetdb

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ run:
44

55
linters-settings:
66
goimports:
7-
local-prefixes: go.hollow.sh/serverservice
7+
local-prefixes: github.com/metal-toolbox/fleetdb
88
gofumpt:
99
extra-rules: true
1010

Dockerfile.dev

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ RUN go mod tidy
1616
# Build the binary.
1717
# -mod=readonly ensures immutable go.mod and go.sum in container builds.
1818
RUN export LDFLAG_LOCATION="go.infratographer.com/x/versionx" && \
19-
CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -o fleetdb \
19+
CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -o fleetdb \
2020
-ldflags \
21-
"-X ${LDFLAG_LOCATION}.appName=serverservice \
22-
-X ${LDFLAG_LOCATION}.commit=$(git rev-parse --short HEAD) \
23-
-X ${LDFLAG_LOCATION}.version=$(git describe --tags 2>/dev/null) \
24-
-X ${LDFLAG_LOCATION}.date=$(date -u '+%H:%M:%S-%Y-%m-%d')"
21+
"-X ${LDFLAG_LOCATION}.appName=serverservice \
22+
-X ${LDFLAG_LOCATION}.commit=$(git rev-parse --short HEAD) \
23+
-X ${LDFLAG_LOCATION}.version=$(git describe --tags 2>/dev/null) \
24+
-X ${LDFLAG_LOCATION}.date=$(date -u '+%H:%M:%S-%Y-%m-%d')"
2525

2626
# Use the official Alpine image for a lean production container.
2727
# https://hub.docker.com/_/alpine

Makefile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ GOOS=linux
44
DB_STRING=host=localhost port=26257 user=root sslmode=disable
55
DEV_DB=${DB_STRING} dbname=serverservice
66
TEST_DB=${DB_STRING} dbname=serverservice_test
7-
DOCKER_IMAGE := "ghcr.io/metal-toolbox/fleetdb"
7+
DOCKER_IMAGE := "ghcr.io/metal-toolbox/fleetdb"
8+
PROJECT_NAME := fleetdb
9+
REPO := "https://github.com/metal-toolbox/fleetdb.git"
810

911
## run all tests
1012
test: | unit-test integration-test
@@ -69,24 +71,22 @@ test-database: | vendor
6971
@SERVERSERVICE_CRDB_URI="${TEST_DB}" go run main.go migrate up
7072
@cockroach sql --insecure -e "use serverservice_test; ALTER TABLE attributes DROP CONSTRAINT check_server_id_server_component_id; ALTER TABLE versioned_attributes DROP CONSTRAINT check_server_id_server_component_id;"
7173

72-
7374
## Build linux bin
7475
build-linux:
75-
GOOS=linux GOARCH=amd64 go build -o fleetdb
76+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${PROJECT_NAME}
7677

7778
## build docker image and tag as ghcr.io/metal-toolbox/fleetdb:latest
7879
build-image: build-linux
79-
docker build --rm=true -f Dockerfile -t ${DOCKER_IMAGE}:latest . \
80-
--label org.label-schema.schema-version=1.0 \
81-
--label org.label-schema.vcs-ref=$(GIT_COMMIT_FULL) \
82-
--label org.label-schema.vcs-url=$(REPO)
80+
docker build --rm=true -f Dockerfile -t ${DOCKER_IMAGE}:latest . \
81+
--label org.label-schema.schema-version=1.0 \
82+
--label org.label-schema.vcs-ref=${GIT_COMMIT_FULL} \
83+
--label org.label-schema.vcs-url=${REPO}
8384

8485
## build and push devel docker image to KIND image repo used by the sandbox - https://github.com/metal-toolbox/sandbox
8586
push-image-devel: build-image
86-
docker tag ${DOCKER_IMAGE}:latest localhost:5001/fleetdb:latest
87-
docker push localhost:5001/fleetdb:latest
88-
kind load docker-image localhost:5001/fleetdb:latest
89-
87+
docker tag ${DOCKER_IMAGE}:latest localhost:5001/${PROJECT_NAME}:latest
88+
docker push localhost:5001/${PROJECT_NAME}:latest
89+
kind load docker-image localhost:5001/${PROJECT_NAME}:latest
9090

9191
# https://gist.github.com/prwhite/8168133
9292
# COLORS
@@ -95,8 +95,8 @@ YELLOW := $(shell tput -Txterm setaf 3)
9595
WHITE := $(shell tput -Txterm setaf 7)
9696
RESET := $(shell tput -Txterm sgr0)
9797

98-
9998
TARGET_MAX_CHAR_NUM=20
99+
100100
## Show help
101101
help:
102102
@echo ''
@@ -109,7 +109,7 @@ help:
109109
if (helpMessage) { \
110110
helpCommand = substr($$1, 0, index($$1, ":")-1); \
111111
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
112-
printf " ${YELLOW}%-$(TARGET_MAX_CHAR_NUM)s${RESET} ${GREEN}%s${RESET}\n", helpCommand, helpMessage; \
112+
printf " ${YELLOW}%-${TARGET_MAX_CHAR_NUM}s${RESET} ${GREEN}%s${RESET}\n", helpCommand, helpMessage; \
113113
} \
114114
} \
115-
{ lastLine = $$0 }' $(MAKEFILE_LIST)
115+
{ lastLine = $$0 }' ${MAKEFILE_LIST}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,5 @@ export SERVERSERVICE_CRDB_URI="host=localhost port=26257 user=root sslmode=disab
6060
Run test.
6161

6262
```bash
63-
go test -timeout 30s -tags testtools -run ^TestIntegrationServerListComponents$ go.hollow.sh/serverservice/pkg/api/v1 -v
63+
go test -timeout 30s -tags testtools -run ^TestIntegrationServerListComponents$ github.com/metal-toolbox/fleetdb/pkg/api/v1 -v
6464
```

cmd/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// Package cmd provides our CLI interface for the hollow binary
2-
package cmd // import "go.hollow.sh/serverservice/cmd"
2+
package cmd

cmd/root.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"go.infratographer.com/x/versionx"
1414
"go.uber.org/zap"
1515

16-
dbm "go.hollow.sh/serverservice/db"
17-
"go.hollow.sh/serverservice/internal/config"
16+
"github.com/metal-toolbox/fleetdb/db"
17+
"github.com/metal-toolbox/fleetdb/internal/config"
1818
)
1919

2020
var (
@@ -47,7 +47,7 @@ func init() {
4747

4848
// Setup migrate command
4949
goosex.RegisterCobraCommand(rootCmd, func() {
50-
goosex.SetBaseFS(dbm.Migrations)
50+
goosex.SetBaseFS(db.Migrations)
5151
goosex.SetDBURI(config.AppConfig.CRDB.URI)
5252
goosex.SetLogger(logger)
5353
})

cmd/serve.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import (
1818
// import gocdk secret drivers
1919
_ "gocloud.dev/secrets/localsecrets"
2020

21-
"go.hollow.sh/serverservice/internal/config"
22-
"go.hollow.sh/serverservice/internal/dbtools"
23-
"go.hollow.sh/serverservice/internal/httpsrv"
21+
"github.com/metal-toolbox/fleetdb/internal/config"
22+
"github.com/metal-toolbox/fleetdb/internal/dbtools"
23+
"github.com/metal-toolbox/fleetdb/internal/httpsrv"
2424
)
2525

2626
var (

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module go.hollow.sh/serverservice
1+
module github.com/metal-toolbox/fleetdb
22

33
go 1.19
44

internal/dbtools/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Package dbtools provides tools to help with interacting with the database,
22
// including all of our utilities for database integration testing
3-
package dbtools // import "go.hollow.sh/serverservice/internal/dbtools"
3+
package dbtools

0 commit comments

Comments
 (0)