Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/cobra cli #79

Merged
merged 5 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 4 additions & 72 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,90 +21,22 @@ before:
- go generate ./...

builds:
- id: "datasetIngestor"
- id: "scicat-cli"
flags:
- -trimpath
ldflags:
- -s -w -X main.VERSION={{.Version}} # This will set the VERSION variable in the binary to the github tag
- "-s -w -X 'github.com/paulscherrerinstitute/scicat/cmd/commands.VERSION={{.Version}}'"
env:
- CGO_ENABLED=0
dir: ./cmd/datasetIngestor/
dir: ./cmd/
goos:
- linux
- windows
- darwin
goarch:
- amd64
main: .
binary: datasetIngestor

- id: "datasetArchiver"
flags:
- -trimpath
ldflags:
- -s -w -X main.VERSION={{.Version}}
env:
- CGO_ENABLED=0
dir: ./cmd/datasetArchiver/
goos:
- linux
- windows
- darwin
goarch:
- amd64
main: .
binary: datasetArchiver

- id: "datasetRetriever"
flags:
- -trimpath
ldflags:
- -s -w -X main.VERSION={{.Version}}
env:
- CGO_ENABLED=0
dir: ./cmd/datasetRetriever/
goos:
- linux
- windows
- darwin
goarch:
- amd64
main: .
binary: datasetRetriever

- id: "datasetCleaner"
flags:
- -trimpath
ldflags:
- -s -w -X main.VERSION={{.Version}}
env:
- CGO_ENABLED=0
dir: ./cmd/datasetCleaner/
goos:
- linux
- windows
- darwin
goarch:
- amd64
main: .
binary: datasetCleaner

- id: "datasetGetProposal"
flags:
- -trimpath
ldflags:
- -s -w -X main.VERSION={{.Version}}
env:
- CGO_ENABLED=0
dir: ./cmd/datasetGetProposal/
goos:
- linux
- windows
- darwin
goarch:
- amd64
main: .
binary: datasetGetProposal
binary: scicat-cli


archives:
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

## Building

For testing, just build `main.go` for each command:
### General Informations

For testing, build the CLI tool as follows:

```
go build -o cmd/datasetIngestor/datasetIngestor cmd/datasetIngestor/main.go
cd cmd
go build -o scicat-cli
```

All applications are built automatically and can be downloaded from the [Releases](https://github.com/paulscherrerinstitute/scicat-cli/releases) section of this repo.
The CLI is built automatically and can be downloaded from the [Releases](https://github.com/paulscherrerinstitute/scicat-cli/releases) section of this repo.

To build the applications and target architectures locally, use GoReleaser. Check `.goreleaser.yaml` to see the configurations.
To use GoReleaser, you can run the command `goreleaser release --snapshot --clean` in your terminal. This will build the binaries, create the archives and generate the changelog. The `--snapshot flag` ensures that no publishing will happen.
Expand Down
Loading