Skip to main content

Writing Stack Guide

Starter Stack

Clone the stacks repo and use the sample stack as a starter:

git clone https://github.com/h8r-dev/stacks.git
cp -r stacks/sample my-stack
cd my-stack/

Define Actions

Under plans/ folder, define actions (example) to setup your environment:

dagger.#Plan & {
client: {
filesystem: {
// ...
}
env: {
// ...
}
}
actions: {
deps: docker.#Build & {
// ...
}
test: bash.#Run & {
// ...
}
build: {
run: bash.#Run & {
// ...
}
contents: core.#Subdir & {
// ...
}
}
deploy: netlify.#Deploy & {
// ...
}
}
}

Refer to Core Actions and CUE libraries for more information.

Define Inputs

Under schemas/ folder, define input schema (example) to interact with users.

Create a file first:

touch schema.yaml

Then, add the schema to the file:

parameters:
- title: application name
description: Name of your application
key: APP_NAME
default: gin-vue
required: true
- title: kubeconfig
description: Path to your kubeconfig file
key: KUBECONFIG
type: "path"
default: ~/.kube/config
required: true
- title: github personal access token
description: Your github access token
key: GITHUB_TOKEN
type: "secret"
required: true

Run It Using hln

After you have created your stack, run it using hln:

hln up -i --dir my-stack/

Input any values that you want to pass to your stack.