Skip to content

Commit

Permalink
rewrite tests for cobra
Browse files Browse the repository at this point in the history
  • Loading branch information
consolethinks committed Jun 24, 2024
1 parent 2613818 commit 1e77318
Show file tree
Hide file tree
Showing 21 changed files with 511 additions and 883 deletions.
85 changes: 0 additions & 85 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,91 +21,6 @@ before:
- go generate ./...

builds:
- id: "datasetIngestor"
flags:
- -trimpath
ldflags:
- -s -w -X main.VERSION={{.Version}} # This will set the VERSION variable in the binary to the github tag
env:
- CGO_ENABLED=0
dir: ./cmd/datasetIngestor/
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

- id: "scicat-cli"
flags:
- -trimpath
Expand Down
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

### General Informations

For testing, just build `main.go` for each command:
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 All @@ -24,13 +25,6 @@ Tools are compiled for the following architectures:

These can be cross-compiled from any system.

### Building the CLI based on Cobra

```
cd cmd
go build -o scicat-cli
```

## Deployment

PSI deploys tools to the following locations.
Expand Down
Loading

0 comments on commit 1e77318

Please sign in to comment.