File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,55 +60,4 @@ process {
6060 }
6161 }
6262 }
63-
64- step "run-a-kubectl-script" {
65- name = "Run a kubectl script"
66- properties = {
67- Octopus.Action.TargetRoles = "demo-k8s-cluster"
68- }
69-
70- action {
71- action_type = "Octopus.KubernetesRunScript"
72- is_disabled = true
73- properties = {
74- Octopus.Action.Script.ScriptBody = <<-EOT
75- #!/usr/bin/env bash
76- # Simple client for the Weather Agent API
77-
78- set -euo pipefail
79-
80- project=$(get_octopusvariable "Octopus.Project.Slug")
81- environment=$(get_octopusvariable "Octopus.Environment.Slug")
82-
83- BASE_URL="${WEATHER_AGENT_URL:-http://$project.$project-$environment.svc.cluster.local:8000}"
84- QUERY="${*:-What's the weather in Tokyo?}"
85-
86- echo "🌤️ You: $QUERY"
87-
88- response=$(curl -sS -X POST "$BASE_URL/ask" \
89- -H "Content-Type: application/json" \
90- -d "$(jq -n --arg q "$QUERY" '{query: $q}')" \
91- --max-time 60)
92-
93- answer=$(echo "$response" | jq -r '.answer')
94- latency=$(echo "$response" | jq -r '.latency_ms')
95-
96- echo ""
97- echo "🤖 Agent: $answer"
98- echo "⏱️ Latency: ${latency} ms"
99- echo ""
100- EOT
101- Octopus.Action.Script.ScriptSource = "Inline"
102- Octopus.Action.Script.Syntax = "Bash"
103- OctopusUseBundledTooling = "False"
104- }
105- worker_pool = "hosted-windows"
106- worker_pool_variable = ""
107-
108- container {
109- feed = "docker-hub"
110- image = "octopusdeploy/worker-tools:6.5.0-ubuntu.22.04"
111- }
112- }
113- }
11463}
You can’t perform that action at this time.
0 commit comments