Skip to content

Commit

Permalink
feat: add new versions and justfile
Browse files Browse the repository at this point in the history
  • Loading branch information
lucabello committed Dec 9, 2024
1 parent 3bcbe90 commit b598a60
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
15 changes: 15 additions & 0 deletions goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
process:
grafana:
running: true
package:
ca-certificates:
installed: true
http:
metrics:
status: 200
url: http://localhost:3000/metrics
timeout: 1000
health:
status: 200
url: http://localhost:3000/api/health
timeout: 1000
35 changes: 35 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
set quiet # Recipes are silent by default
set export # Just variables are exported to environment variables

kgoss := `which kgoss` # `kgoss` is required

rock_name := `echo ${PWD##*/} | sed 's/-rock//'`
latest_version := `find . -maxdepth 1 -type d | sort -V | tail -n1 | sed 's@./@@'`

[private]
default:
just --list

# Push an OCI image to a local registry
[private]
push-to-registry version:
echo "Pushing $rock_name $version to local registry"
rockcraft.skopeo --insecure-policy copy --dest-tls-verify=false \
"oci-archive:${version}/${rock_name}_${version}_amd64.rock" \
"docker://localhost:32000/${rock_name}-dev:${version}"

# Pack a rock of a specific version
pack version:
cd "$version" && rockcraft pack

# `rockcraft clean` for a specific version
clean version:
cd "$version" && rockcraft clean

# Run a rock and open a shell into it with `kgoss`
run version=latest_version: (push-to-registry version)
kgoss edit -i localhost:32000/${rock_name}-dev:${version}

# Test the rock with `kgoss`
test version=latest_version: (push-to-registry version)
GOSS_OPTS="--retry-timeout 60s" kgoss run -i localhost:32000/${rock_name}-dev:${version}

0 comments on commit b598a60

Please sign in to comment.