Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.workspace/
.DS_Store
error.log
.orun/
Original file line number Diff line number Diff line change
Expand Up @@ -190,22 +190,36 @@ spec:
# Coolify pulls the image and redeploys. One bearer token is the entire
# credential story — no federated identity, no registry auth on the
# target, no cloud-specific login step.
#
# POST, and that is not cosmetic. Coolify's deploy endpoint used to be a
# GET and this step was written against it; current Coolify still ROUTES
# `GET /api/v1/deploy`, but to `OtherController::post_required`, which
# answers 405 "This endpoint has changed to a POST request." So the old
# verb does not fail at the network — it reaches Coolify, is understood,
# and is refused, on every deploy.
#
# The token needs the `deploy` ability (Coolify's `api.ability:deploy`
# middleware guards this route). A `read`-only token 403s here, which is
# why the platform's connect recipe asks for `deploy` explicitly.
run: |
set -euo pipefail
test -n "${COOLIFY_TOKEN:-}" || { echo "deploy-coolify: COOLIFY_TOKEN unset — wire it through the component's secretEnv" >&2; exit 1; }
test -n "${SERVICE_IMAGE:-}" || { echo "deploy-coolify: SERVICE_IMAGE unset — an image step must precede this one" >&2; exit 1; }

echo "deploy-coolify: {{ .parameters.coolifyAppUuid }} → ${SERVICE_IMAGE}"
response="$(curl -sS -X GET \
response="$(curl -sS -X POST \
"{{ .parameters.coolifyUrl }}/api/v1/deploy?uuid={{ .parameters.coolifyAppUuid }}&force=true" \
-H "Authorization: Bearer ${COOLIFY_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Length: 0" \
-w '\n%{http_code}')"
code="$(printf '%s' "$response" | tail -n1)"
body="$(printf '%s' "$response" | sed '$d')"
echo "$body"
case "$code" in
2*) : ;;
405) echo "deploy-coolify: Coolify returned 405 — the deploy endpoint expects POST" >&2; exit 1 ;;
401|403) echo "deploy-coolify: Coolify returned $code — the token needs the 'deploy' ability" >&2; exit 1 ;;
*) echo "deploy-coolify: Coolify returned HTTP $code" >&2; exit 1 ;;
esac
onFailure: stop
Expand Down
20 changes: 18 additions & 2 deletions compositions/dotnet-service/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,30 @@ spec:
description: Registry namespace for the GHCR build path, without image name or tag

# --- Coolify deploy target ---
#
# These are PARAMETERS, not secrets, and they are meant to come from
# the platform rather than be typed in. A workspace with a Coolify
# connection serves both from the integrations registry: the origin
# from the `instance-url` template (a connection-anchor fact — no
# token is read and there is nothing to revoke) and the deploy
# credential from `deploy-application`, which is TTL-bounded and
# ledgered per issuance. Wire COOLIFY_TOKEN through the component's
# secretEnv against that template; nothing here belongs in a repo
# secret.
coolifyUrl:
type: string
default: ""
description: Base URL of the Coolify instance, e.g. https://coolify.example.com
description: >-
Origin of the Coolify instance, e.g. https://coolify.example.com
(https and a public hostname — the platform's connect flow
refuses anything else, so a value it would refuse will not have a
connection behind it).
coolifyAppUuid:
type: string
default: ""
description: UUID of the Coolify application this component deploys
description: >-
UUID of the Coolify application this component deploys — the
`applicationUuid` the deploy-application template is minted for.
serviceUrl:
type: string
default: ""
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Stack
metadata:
name: stack-basalt
title: Stack Basalt
version: 0.2.1
version: 0.2.2
description: Versioned OCI-hosted catalog of .NET and Azure Container Apps compositions for Sourceplane repositories.
owner: sourceplane
tags:
Expand Down
Loading