2024-03-22 10:34:15 +00:00
< div class = " flex flex-col gap-4 " >
2023-08-07 20:14:21 +00:00
< div >
< div class = " flex items-center gap-2 " >
< h2 > Environment Variables </ h2 >
2025-08-26 08:27:31 +00:00
@ can ( 'manageEnvironment' , $resource )
< div class = " flex flex-col items-center " >
< x - modal - input buttonTitle = " + Add " title = " New Environment Variable " : closeOutside = " false " >
< livewire : project . shared . environment - variable . add />
</ x - modal - input >
</ div >
< x - forms . button
wire : click = 'switch' > {{ $view === 'normal' ? 'Developer view' : 'Normal view' }} </ x - forms . button >
@ endcan
2023-08-07 20:14:21 +00:00
</ div >
2024-08-27 16:23:04 +00:00
< div > Environment variables ( secrets ) for this resource . </ div >
2025-09-17 08:34:38 +00:00
@ if ( $resourceClass === 'App\Models\Application' )
< div class = " flex flex-col gap-2 pt-2 " >
@ if ( data_get ( $resource , 'build_pack' ) !== 'dockercompose' )
< div class = " w-64 " >
@ can ( 'manageEnvironment' , $resource )
< x - forms . checkbox id = " is_env_sorting_enabled " label = " Sort alphabetically "
2025-09-18 16:17:37 +00:00
helper = " Turn this off if one environment is dependent on another. It will be sorted by creation order (like you pasted them or in the order you created them). "
2025-09-17 08:34:38 +00:00
instantSave ></ x - forms . checkbox >
@ else
< x - forms . checkbox id = " is_env_sorting_enabled " label = " Sort alphabetically "
2025-09-18 16:17:37 +00:00
helper = " Turn this off if one environment is dependent on another. It will be sorted by creation order (like you pasted them or in the order you created them). "
2025-09-17 08:34:38 +00:00
disabled ></ x - forms . checkbox >
@ endcan
</ div >
@ endif
2025-09-19 11:45:37 +00:00
< div class = " w-64 " >
@ can ( 'manageEnvironment' , $resource )
< x - forms . checkbox id = " use_build_secrets " label = " Use Docker Build Secrets "
helper = " Enable Docker BuildKit secrets for enhanced security during builds. Secrets won't be exposed in the final image. Requires Docker 18.09+ with BuildKit support. "
instantSave ></ x - forms . checkbox >
@ else
< x - forms . checkbox id = " use_build_secrets " label = " Use Docker Build Secrets "
helper = " Enable Docker BuildKit secrets for enhanced security during builds. Secrets won't be exposed in the final image. Requires Docker 18.09+ with BuildKit support. "
disabled ></ x - forms . checkbox >
@ endcan
</ div >
2024-05-17 09:10:57 +00:00
</ div >
@ endif
2023-08-07 20:14:21 +00:00
</ div >
2023-09-08 14:16:59 +00:00
@ if ( $view === 'normal' )
2024-08-12 21:12:54 +00:00
< div >
< h3 > Production Environment Variables </ h3 >
< div > Environment ( secrets ) variables for Production .</ div >
</ div >
2025-09-12 10:09:03 +00:00
@ forelse ( $this -> environmentVariables as $env )
2025-11-25 08:32:12 +00:00
< livewire : project . shared . environment - variable . show wire : key = " environment- { { $env->id }} " : env = " $env "
: type = " $resource->type () " />
2023-09-08 14:16:59 +00:00
@ empty
2024-03-21 11:44:32 +00:00
< div > No environment variables found .</ div >
2023-09-08 14:16:59 +00:00
@ endforelse
2025-11-25 14:22:38 +00:00
@ if (( $resource -> type () === 'service' || $resource ? -> build_pack === 'dockercompose' ) && $this -> hardcodedEnvironmentVariables -> isNotEmpty ())
@ foreach ( $this -> hardcodedEnvironmentVariables as $index => $env )
< livewire : project . shared . environment - variable . show - hardcoded
wire : key = " hardcoded-prod- { { $env['key'] }}- { { $env['service_name'] ?? 'default' }}- { { $index }} "
: env = " $env " />
@ endforeach
@ endif
2023-09-08 14:16:59 +00:00
@ if ( $resource -> type () === 'application' && $resource -> environment_variables_preview -> count () > 0 && $showPreview )
< div >
2024-08-12 21:12:54 +00:00
< h3 > Preview Deployments Environment Variables </ h3 >
2023-09-08 14:16:59 +00:00
< div > Environment ( secrets ) variables for Preview Deployments .</ div >
</ div >
2025-09-12 10:09:03 +00:00
@ foreach ( $this -> environmentVariablesPreview as $env )
2025-11-25 08:32:12 +00:00
< livewire : project . shared . environment - variable . show wire : key = " environment- { { $env->id }} " : env = " $env "
: type = " $resource->type () " />
2025-01-21 16:09:03 +00:00
@ endforeach
2025-11-25 14:22:38 +00:00
@ if (( $resource -> type () === 'service' || $resource ? -> build_pack === 'dockercompose' ) && $this -> hardcodedEnvironmentVariablesPreview -> isNotEmpty ())
@ foreach ( $this -> hardcodedEnvironmentVariablesPreview as $index => $env )
< livewire : project . shared . environment - variable . show - hardcoded
wire : key = " hardcoded-preview- { { $env['key'] }}- { { $env['service_name'] ?? 'default' }}- { { $index }} "
: env = " $env " />
@ endforeach
@ endif
2023-09-08 14:16:59 +00:00
@ endif
@ else
2024-08-12 11:23:09 +00:00
< form wire : submit . prevent = 'submit' class = " flex flex-col gap-2 " >
2025-08-26 08:27:31 +00:00
@ can ( 'manageEnvironment' , $resource )
2025-11-25 08:32:12 +00:00
< x - callout type = " info " title = " Note " class = " mb-2 " >
Inline comments with space before # (e.g., <code class="font-mono">KEY=value #comment</code>) are stripped.
</ x - callout >
2025-11-18 09:10:29 +00:00
2025-08-26 08:27:31 +00:00
< x - forms . textarea rows = " 10 " class = " whitespace-pre-wrap " id = " variables " wire : model = " variables "
label = " Production Environment Variables " ></ x - forms . textarea >
@ if ( $showPreview )
2025-11-25 08:32:12 +00:00
< x - forms . textarea rows = " 10 " class = " whitespace-pre-wrap " label = " Preview Deployments Environment Variables "
id = " variablesPreview " wire : model = " variablesPreview " ></ x - forms . textarea >
2025-08-26 08:27:31 +00:00
@ endif
2024-10-04 10:08:57 +00:00
2025-08-26 08:27:31 +00:00
< x - forms . button type = " submit " class = " btn btn-primary " > Save All Environment Variables </ x - forms . button >
@ else
< x - forms . textarea rows = " 10 " class = " whitespace-pre-wrap " id = " variables " wire : model = " variables "
label = " Production Environment Variables " disabled ></ x - forms . textarea >
2024-10-04 10:08:57 +00:00
2025-08-26 08:27:31 +00:00
@ if ( $showPreview )
2025-11-25 08:32:12 +00:00
< x - forms . textarea rows = " 10 " class = " whitespace-pre-wrap " label = " Preview Deployments Environment Variables "
id = " variablesPreview " wire : model = " variablesPreview " disabled ></ x - forms . textarea >
2025-08-26 08:27:31 +00:00
@ endif
@ endcan
2024-08-12 11:14:38 +00:00
</ form >
2023-08-07 20:14:21 +00:00
@ endif
2025-11-25 08:32:12 +00:00
</ div >