Provision resources using a declarative YAML syntax.
Go to file
Matthew Rich 2e84afa87f
Some checks are pending
Lint / golangci-lint (push) Waiting to run
Declarative Tests / test (push) Waiting to run
add Delete method
2024-10-09 22:28:00 +00:00
.gitea/workflows build is restricted to static alpine/musl 2024-09-27 17:38:01 +00:00
artifacts generate coverage report 2024-03-23 13:03:42 -07:00
build fix package rpmbuild name 2024-05-26 15:57:23 -07:00
cmd/cli use client package in jx cli 2024-09-25 05:03:50 +00:00
examples add missing cfg file 2024-09-27 17:21:19 +00:00
internal add Delete method 2024-10-09 22:28:00 +00:00
md-images add jx-import doc 2024-05-09 01:50:56 -07:00
tests/mocks update cli tests 2024-09-25 05:13:53 +00:00
.gitignore Initial commit 2024-03-09 00:12:54 +00:00
cli_test.go collect resource/doc errors and add to result. Add readwritecloser support for HTTP transport reading response data 2024-10-02 20:26:02 +00:00
COPYRIGHT initial version 2024-03-20 12:23:31 -07:00
go.mod collect resource/doc errors and add to result. Add readwritecloser support for HTTP transport reading response data 2024-10-02 20:26:02 +00:00
go.sum collect resource/doc errors and add to result. Add readwritecloser support for HTTP transport reading response data 2024-10-02 20:26:02 +00:00
LICENSE initial version 2024-03-20 11:56:28 -07:00
Makefile update build steps in README.md 2024-10-07 18:36:19 -07:00
README.md update build steps in README.md 2024-10-07 18:36:19 -07:00

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

Releases

v0 releases are unstable and changes may be made to interfaces and specifications.

Use at your own risk.

JX Documents

The JX YAML specification is a simple way to describe system resources. The two main components are configurations and resources.

Configurations

configurations:
- name: myhttpconfig
  values:
    http_user: jex
    http_password: sample 
- name: myhttptoken
  values:
    authorization_token: abcde123456789

Resources

resources:
- type: http
  config: myhttptoken
  transition: read
  attributes:
    endpoint: https://myserver/v1/api

Testing

Testing the current version involves checking out main and building inside of the alpine go build container.

git clone https://gitea.rosskeen.house/doublejynx/jx.git

make build-container

make test

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

Convert a tar archive into resource definitions and apply them (extracts the contents of a tar).

jx apply https://gitea.rosskeen.house/doublejynx/jx/archive/v0.2.1.tar.gz

Read resource state

Read the state of an existing resource (URI) and generate a YAML representation of it.

jx import -resource file://COPYRIGHT

Importing resources from different sources

JX supports importing resources data from various source types, among these are filesystem directories, tar archive contents, containers, iptables chains, installed packages, etc.

Import system packages using the debian package type, and output the resource documents in JSON format.

jx import --output json:// package://?type=deb

Import the contents of a tar archive into a resource document.

jx import ./test.tgz

Import resource documents from multiple sources.

jx import repo/packages/build.jx.yaml ./gopkgs.tar.gz

Import Doc

Read a resource document from an http endpoint.

jx import http://localhost/resources

Diff resource documents

Diff Resources

Examples

Resources: