https://github.com/tinitiuset/jsonnet-101
https://github.com/tinitiuset/jsonnet-101
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tinitiuset/jsonnet-101
- Owner: tinitiuset
- Created: 2025-01-13T12:42:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-13T13:00:54.000Z (over 1 year ago)
- Last Synced: 2025-10-30T07:01:59.391Z (8 months ago)
- Language: Jsonnet
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Jsonnet quick start guide
## Project structure:
```
.
├── jsonnetfile.json // Dependency file
├── jsonnetfile.lock.json // Dependency lock file
├── lib // Local libraries
│ └── k.libsonnet
├── main.jsonnet // Main jsonnet file
└── vendor // Remote libraries
├── ...
└── ...
```
Project can be initialized with `jb init` and dependencies can be installed with `jb install`.
Local libraries will be stored in the `lib` directory but should be created manually.
## Compile jsonnet files
With `vendor` and `lib` directories:
```shell
jsonnet -J vendor -J lib main.jsonnet
```
Saving the output to a file:
```shell
jsonnet -J vendor -J lib main.jsonnet -o main.json
```
## k.libsonnet
`k.libsonnet` alias should be created in `lib` directory if you intend to use `k8s-libsonnet` library.
Example content of `k.libsonnet`:
```jsonnet
import "github.com/jsonnet-libs/k8s-libsonnet/1.32/main.libsonnet"
```