forgejo-runner-images/ubuntu-full/Taskfile.yml
2026-01-07 20:55:18 -05:00

42 lines
1.2 KiB
YAML

version: '3'
vars:
REGISTRY: git.juancwu.dev
OWNER: juancwu
IMAGE_NAME: ubuntu-24.04
VERSION: latest
FULL_IMAGE: "{{.REGISTRY}}/{{.OWNER}}/{{.IMAGE_NAME}}:{{.VERSION}}"
tasks:
default:
desc: "Builds the image"
cmds:
- task: build
login:
desc: "Login to the private registry (interactive)"
cmds:
- echo "Logging into {{.REGISTRY}}..."
- docker login {{.REGISTRY}}
build:
desc: "Build the Docker image locally"
cmds:
- echo "Building {{.FULL_IMAGE}}..."
- docker build -t {{.FULL_IMAGE}} .
push:
desc: "Build and push the image to the registry"
deps: [build]
cmds:
- echo "Pushing to registry..."
- docker push {{.FULL_IMAGE}}
test:
desc: "Run a quick sanity check on the built image"
deps: [build]
cmds:
- echo "Testing Go version..."
- docker run --rm {{.FULL_IMAGE}} go version
- echo "Testing Tailwind CLI..."
- docker run --rm {{.FULL_IMAGE}} tailwindcss --help
- echo "Testing Node version..."
- docker run --rm {{.FULL_IMAGE}} node -v
clean:
desc: "Remove the local docker image to free space"
cmds:
- docker rmi {{.FULL_IMAGE}} || true