jx/README.md

60 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

2024-04-22 06:24:38 +00:00
# jx
2024-03-09 00:12:54 +00:00
2024-03-27 20:10:32 +00:00
# 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.
2024-03-21 22:28:29 +00:00
2024-03-27 23:08:13 +00:00
# Dependencies
* Go >= 1.21.1
# Testing
Testing the current version involves checking out main and building.
2024-03-27 23:09:18 +00:00
```
git clone https://gitea.rosskeen.house/Declarative/decl.git
2024-03-27 23:08:13 +00:00
make test
make build
2024-03-27 23:09:18 +00:00
```
2024-03-27 23:08:13 +00:00
2024-03-21 22:28:29 +00:00
# Command-line
2024-03-27 19:25:12 +00:00
# Update Resource state
2024-04-22 06:24:38 +00:00
`jx apply decl-runner.yaml`
Create the resources specified in a resource document HTTP endpoint.
`jx apply http://localhost/resources`
2024-03-21 22:28:29 +00:00
2024-03-27 19:25:12 +00:00
# Read resource state
2024-03-27 20:03:28 +00:00
Read the state of an existing resource (URI) and generate a YAML representation of it.
2024-04-22 06:24:38 +00:00
`jx import -resource file://COPYRIGHT`
2024-03-26 08:08:59 +00:00
![Import Resource](md-images/import-resource.gif)
2024-04-22 06:24:38 +00:00
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`
2024-03-25 21:57:30 +00:00
# Examples
2024-03-21 22:28:29 +00:00
2024-03-25 21:57:30 +00:00
Resources:
2024-04-03 19:48:30 +00:00
* [file](examples/file.yaml) [schema](internal/resource/schemas/file.jsonschema)
2024-04-22 06:24:38 +00:00
* [http](examples/http.yaml) [schema](internal/resource/schemas/http.jsonschema)
2024-04-03 19:48:30 +00:00
* [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)