@@ -20,17 +20,14 @@ var deployCmd = &cobra.Command{
2020
2121Deploy from existing image:
2222 coderun deploy nginx:latest --name my-nginx
23- coderun deploy my-app:v1.0 --name my-app --replicas 3 --cpu 500m --memory 1Gi
24- coderun deploy my-app:latest --name web-app --http-port 8080 --env-file .env
2523 coderun deploy redis:latest --name my-redis --tcp-port 6379
26- coderun deploy postgres:latest --name my-db --tcp-port 5432 --env-file database.env
2724 coderun deploy my-app:latest --name prod-app --replicas 2 --cpu 200m --memory 512Mi --http-port 3000 --env-file production.env
2825
2926Build from source:
3027 coderun deploy --build . --name my-app
3128 coderun deploy --build ./my-app --name my-app --dockerfile Dockerfile.prod
3229 coderun deploy --build . --name web-app --http-port 8080 --env-file .env
33-
30+
3431With persistent storage (automatically forces replicas to 1):
3532 coderun deploy postgres:15 --name my-postgres --tcp-port 5432 --storage-size 5Gi --storage-path /var/lib/postgresql/data
3633 coderun deploy mysql:8 --name my-mysql --tcp-port 3306 --storage-size 10Gi --storage-path /var/lib/mysql
@@ -334,10 +331,38 @@ func runDeploy(cmd *cobra.Command, args []string) {
334331
335332 if status .Status == "completed" {
336333 fmt .Printf ("✅ Build completed successfully!\n " )
334+
335+ // Show build logs for successful builds too
336+ fmt .Println ("\n 📋 Build logs:" )
337+ fmt .Println ("================" )
338+ logs , err := apiClient .GetBuildLogs (status .ID )
339+ if err != nil {
340+ fmt .Printf ("❌ Could not retrieve build logs: %v\n " , err )
341+ } else if logs == "" {
342+ fmt .Println ("No logs available" )
343+ } else {
344+ fmt .Println (logs )
345+ }
346+ fmt .Println ("================\n " )
347+
337348 image = status .ImageURI
338349 break
339350 } else if status .Status == "failed" {
340351 fmt .Printf ("❌ Build failed!\n " )
352+
353+ // Try to get build logs to show the error
354+ fmt .Println ("\n 📋 Build logs:" )
355+ fmt .Println ("================" )
356+ logs , err := apiClient .GetBuildLogs (status .ID )
357+ if err != nil {
358+ fmt .Printf ("❌ Could not retrieve build logs: %v\n " , err )
359+ } else if logs == "" {
360+ fmt .Println ("No logs available" )
361+ } else {
362+ fmt .Println (logs )
363+ }
364+ fmt .Println ("================" )
365+
341366 os .Exit (1 )
342367 }
343368 }
@@ -414,6 +439,9 @@ func runDeploy(cmd *cobra.Command, args []string) {
414439 if deployment .TCPConnection != nil {
415440 fmt .Printf ("TCP Connection: %s\n " , * deployment .TCPConnection )
416441 }
442+ if deployment .URL != nil {
443+ fmt .Printf ("HTTP URL: %s\n " , * deployment .URL )
444+ }
417445 if len (deployment .EnvironmentVars ) > 0 {
418446 fmt .Printf ("Environment Variables: %d\n " , len (deployment .EnvironmentVars ))
419447 }
0 commit comments