Documentation of this CLI is still under development:
- Development Branch - https://github.com/StackVista/stackstate-docs/tree/STAC-15294-cli2-docs
- Gitbook Preview - https://stackstate.gitbook.io/stackstate-docs-development/v/stac-15294-cli2-docs/setup/cli/
- Install
pre-commit
and install all the hooks:
pre-commit install
- Install Nix package manager. See Nix installation
- Enable Nix Flakes support
mkdir -p ~/.config/nix && echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
- Enter development shell
nix develop
- Run
go run main.go
It also possible to use nix phases to test nix develop --check
and build the application nix develop --build
, as specified in the Makefile, without entering the shell.
- Read the command development guide.
- Check which version of the CLI is the latest by running
scripts/publish/print_latest_version.sh
- Determine the semantic version number you want to use:
- Breaking change? Major version! This should never happen after the initial release!
- New commands and/or flags? Minor version.
- Bugfixes/improvements of existing commands? Patch version.
- On a clean and committed and pushed commit run
scripts/create_release.sh -v VERSION
with your version.
A tag will be pushed to Gitlab with the format: v${VERSION}
. Gitlab's CI will then run the publishing pipeline.
Install Nix package manager by following the official installation instructions.
To install the package to the current profile you need to register the current repository
nix registry add stackstate-cli "git+ssh://git@github.com/stackvista/stackstate-cli"
nix profile install stackstate-cli#sts
Alternatively temporary shell environment with sts
binary in $PATH can be started using
nix shell "git+ssh://git@github.com/stackvista/stackstate-cli?ref=master"
Where ref=
can reference to any branch name
All the CI dependencies are also defined by flake.nix inside the ciDeps
directive. It is possible to start bash session with all these dependencies in scope by calling nix develop #.ci
.
To build the base image locally run
nix build .#ci-image & docker load < result
# Test
docker run -ti --rm stackstate-cli2-ci:latest go version
This repository pulls the stackstate-api spec from the openapi repository.
- Change the version/branch/commit sha in the
stackstate_openapi/openapi_version
file - Run
nix develop -c ./scripts/generate_stackstate_api.sh
- Commit the generated code
CI will check whether the requested api version and generated code are kep up to date.
- Run
nix develop -c ./scripts/run_openapi_local.sh {path to your open api folder}
- example:
nix develop -c ./scripts/run_openapi_local.sh /Users/projects/stackstate-openapi