jx/README.md
Matthew Rich 9f168cff85
Some checks failed
Lint / golangci-lint (push) Failing after 10m6s
Declarative Tests / test (push) Successful in 1m13s
fix lint errors
2024-04-21 23:24:38 -07:00

60 lines
1.6 KiB
Markdown

# jx
# Purpose
These tools work with YAML descriptions of resources (E.g. files, users, containers, etc) for (de)serializing the state of the given resource. This enables more generically describing the state of a supported resource type, pipeling state transformations and enabling the use of other tools in that process.
# Dependencies
* Go >= 1.21.1
# Testing
Testing the current version involves checking out main and building.
```
git clone https://gitea.rosskeen.house/Declarative/decl.git
make test
make build
```
# Command-line
# Update Resource state
`jx apply decl-runner.yaml`
Create the resources specified in a resource document HTTP endpoint.
`jx apply http://localhost/resources`
# Read resource state
Read the state of an existing resource (URI) and generate a YAML representation of it.
`jx import -resource file://COPYRIGHT`
![Import Resource](md-images/import-resource.gif)
Import the contents of a tar archive into a resource document.
`jx import ./test.tgz`
Read a resource document from an http endpoint.
`jx import http://localhost/resources`
# Examples
Resources:
* [file](examples/file.yaml) [schema](internal/resource/schemas/file.jsonschema)
* [http](examples/http.yaml) [schema](internal/resource/schemas/http.jsonschema)
* [user](examples/user.yaml) [schema](internal/resource/schemas/user.jsonschema)
* [package](examples/package.yaml) [schema](internal/resource/schemas/package.jsonschema)
* [container](examples/container.yaml) [schema](internal/resource/schemas/container.jsonschema)
* [network_route](examples/network_route.yaml) [schema](internal/resource/schemas/network_route.jsonschema)