Skip to content

Commit

Permalink
Merge pull request #7 from abaldeweg/feat/cli
Browse files Browse the repository at this point in the history
Rename admincli to warehousecli
  • Loading branch information
abaldeweg authored Oct 23, 2024
2 parents f10bc98 + eccc967 commit a1866ac
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ on:
- main

jobs:
test-admincli:
test-warehousecli:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23"
- name: Run admincli tests
working-directory: ./admincli
- name: Run warehousecli tests
working-directory: ./warehousecli
run: |
go mod tidy
go test ./...
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ release:
git tag -a blog/v$(TAG) -m "v$(TAG)"
git push origin blog/v$(TAG)

git tag -a admincli/v$(TAG) -m "v$(TAG)"
git push origin admincli/v$(TAG)
git tag -a warehousecli/v$(TAG) -m "v$(TAG)"
git push origin warehousecli/v$(TAG)

git tag -a framework/v$(TAG) -m "v$(TAG)"
git push origin framework/v$(TAG)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,23 @@ r.Use(cors.SetDefaultCorsHeaders())
|-----------------------|-----------
|CORS_ALLOW_ORIGIN |Allowed origins

## admincli
## warehousecli

### admincli Settings
### warehousecli Settings

|Var |Description
|-----------------------|-----------
|project_dir |Path to docker compose
|database |Database name to dump

admincli will read a config file from following paths:
warehousecli will read a config file from following paths:

- /etc/admincli/admincli.yaml
- /etc/warehousecli/warehousecli.yaml

Example

```yaml
// admincli.yaml
// warehousecli.yaml
project_dir: .
database: db-1
```
Expand Down
9 changes: 0 additions & 9 deletions admincli/main.go

This file was deleted.

2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
go 1.23

use (
./admincli
./warehousecli
./blog
./framework
./gateway
Expand Down
6 changes: 3 additions & 3 deletions admincli/.goreleaser.yaml → warehousecli/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ builds:
- CGO_ENABLED=0
goos:
- linux
id: admincli
binary: admincli
id: warehousecli
binary: warehousecli

archives:
- format: tar.gz
Expand All @@ -26,7 +26,7 @@ archives:
nfpms:
-
package_name: admincli
package_name: warehousecli
section: misc
description: "Offers tools for maintenance"
maintainer: "André Baldeweg"
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion admincli/cmd/pull.go → warehousecli/cmd/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"log"

"github.com/abaldeweg/warehouse-server/admincli/command"
"github.com/abaldeweg/warehouse-server/warehousecli/command"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
2 changes: 1 addition & 1 deletion admincli/cmd/reboot.go → warehousecli/cmd/reboot.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"log"

"github.com/abaldeweg/warehouse-server/admincli/command"
"github.com/abaldeweg/warehouse-server/warehousecli/command"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion admincli/cmd/refresh.go → warehousecli/cmd/refresh.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"log"

"github.com/abaldeweg/warehouse-server/admincli/command"
"github.com/abaldeweg/warehouse-server/warehousecli/command"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
6 changes: 3 additions & 3 deletions admincli/cmd/root.go → warehousecli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

var rootCmd = &cobra.Command{
Use: "admincli",
Use: "warehousecli",
Short: "Maintenance tools",
Long: `The app gives you simple access to maintenance tools.`,
}
Expand All @@ -23,9 +23,9 @@ func Execute() {
func init() {
viper.SetDefault("project_dir", ".")

viper.SetConfigName("admincli")
viper.SetConfigName("warehousecli")
viper.SetConfigType("yaml")
viper.AddConfigPath("/etc/admincli/")
viper.AddConfigPath("/etc/warehousecli/")

if err := viper.ReadInConfig(); err != nil {
log.Fatal(err)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion admincli/go.mod → warehousecli/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/abaldeweg/warehouse-server/admincli
module github.com/abaldeweg/warehouse-server/warehousecli

go 1.23

Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions warehousecli/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import (
"github.com/abaldeweg/warehouse-server/warehousecli/cmd"
)

func main() {
cmd.Execute()
}

0 comments on commit a1866ac

Please sign in to comment.