Commit graph

566 commits

Author SHA1 Message Date
Andras Bacsai
8d5ac0da00 feat(deployment): save build-time .env file before build and enhance logging for Dockerfile 2025-10-09 16:38:17 +02:00
Andras Bacsai
bc8cf8ed84 fix(deployment): save runtime environment variables when skipping build
- Updated the should_skip_build method to save runtime environment variables even when the build step is skipped, ensuring that the latest environment settings are preserved.
- Enhanced logging in prepare_builder_image to differentiate between the first attempt and subsequent attempts, improving clarity in deployment logs.
2025-10-07 14:26:23 +02:00
Andras Bacsai
1a42187d5d fix 2025-10-07 14:20:33 +02:00
Andras Bacsai
981f46c406 fix(deployment): add warning for NIXPACKS_NODE_VERSION in node configurations
- Implemented a check for the NIXPACKS_NODE_VERSION variable in the ApplicationDeploymentJob.
- Added log entries to notify users when NIXPACKS_NODE_VERSION is not set, indicating that Node.js 18 will be used by default, which is EOL.
- Provided guidance on how to override the default version by setting NIXPACKS_NODE_VERSION in environment variables.
2025-10-07 14:19:34 +02:00
Andras Bacsai
acf2d5f89b refactor(deployment): update environment variable handling for Docker builds
- Changed the .env file reference to use a build-time .env file located in /artifacts, preventing it from being included in Docker images.
- Introduced a new method to wrap Docker build commands with environment variable exports, enhancing the handling of build-time variables.
- Updated logging messages for clarity regarding the creation and usage of the build-time .env file.
2025-10-06 10:31:58 +02:00
Andras Bacsai
239ecd4056 fix dev only thingy 2025-10-05 11:39:22 +02:00
Andras Bacsai
06dfcff559 refactor(deployment): standardize environment variable handling in ApplicationDeploymentJob
- Replaced the use of a dynamic env_filename with a consistent .env file reference across deployment methods.
- Simplified the generation and saving of build-time and runtime environment variables, ensuring they are always written to the .env file.
- Enhanced clarity in the deployment process by removing redundant logic and ensuring environment variables are handled uniformly.
2025-10-04 19:19:15 +02:00
Andras Bacsai
158747c8b1 refactor(deployment): streamline environment variable generation in ApplicationDeploymentJob
- Removed redundant logic for merging COOLIFY_* variables into env_args.
- Simplified the process of adding environment variables by directly incorporating generated COOLIFY environment variables.
- Enhanced clarity and maintainability of the generate_env_variables method.
2025-10-04 15:06:49 +02:00
Andras Bacsai
0e02eff4a1
Merge branch 'v4.x' into allow-dep 2025-10-03 10:57:10 +02:00
Andras Bacsai
2216832f67 fix(deployments): enhance builder container management and environment variable handling
- Added a new method to restart the builder container with the actual commit value, ensuring accurate deployment.
- Improved the generation of environment variables by consolidating user-defined and Coolify-specific variables.
- Updated Dockerfile modification logic to handle environment variables more effectively, including support for multiline variables.
- Enhanced logging for better visibility during deployment processes.
2025-10-03 09:20:05 +02:00
Andras Bacsai
aadde3a83e feat(deployments): enhance Docker build argument handling for multiline variables
- Introduced new helper functions to generate Docker build arguments and environment flags, accommodating multiline variables with proper escaping.
- Updated the ApplicationDeploymentJob to utilize these new functions, improving the handling of environment variables during deployment.
- Added comprehensive tests to ensure correct behavior for multiline variables and special characters.
2025-10-02 13:54:36 +02:00
Andras Bacsai
2f099613a0 feat(deployments): add support for Coolify variables in Dockerfile
- Introduced functionality to add Coolify variables as ARGs in the Dockerfile during the build process.
- Enhanced the existing method to handle both standard environment variables and Coolify-specific variables, improving deployment flexibility.
2025-10-01 20:29:38 +02:00
Andras Bacsai
f0a532407b revert changes to v429 2025-10-01 19:57:54 +02:00
Andras Bacsai
9b4abe753d fix(git): enhance error handling for missing branch information during deployment 2025-09-30 12:23:04 +02:00
Andras Bacsai
249ab06295 refactor(deployment): remove commented-out code and streamline environment variable handling in ApplicationDeploymentJob 2025-09-29 12:05:51 +02:00
Andras Bacsai
ed7ecbb49d feat/fix(deployment): implement detection for Laravel/Symfony frameworks and configure NIXPACKS PHP environment variables accordingly 2025-09-29 12:05:14 +02:00
Andras Bacsai
d81ed86920 refactor(deployment): improve environment variable handling in ApplicationDeploymentJob 2025-09-26 15:17:42 +02:00
Andras Bacsai
2a3a46c337 feat(application): add conditional .env file creation for Symfony apps during PHP deployment 2025-09-26 09:17:25 +02:00
Andras Bacsai
667c8e6432 fix(deployment-job): enhance build time variable analysis
- Introduced logic to filter user-defined build time variables from the database based on the pull request context.
- Improved handling of build time variables to ensure only relevant variables are analyzed, enhancing the deployment process.
2025-09-24 18:19:42 +02:00
Andras Bacsai
e9324fd410 fix(deployment-job): escape single quotes in build arguments for Docker Compose command
- Added logic to escape single quotes in build arguments to ensure proper execution in bash -c context used by executeInDocker, preventing potential command errors.
2025-09-24 17:27:48 +02:00
Andras Bacsai
b1abdcee83 feat(environment-variables): implement environment variable analysis for build-time issues
- Added EnvironmentVariableAnalyzer trait to analyze and warn about problematic environment variables during the build process.
- Integrated analysis into ApplicationDeploymentJob and Livewire components to provide feedback on potential build issues.
- Introduced a new Blade component for displaying warnings related to environment variables in the UI.
2025-09-23 08:53:14 +02:00
Andras Bacsai
4f71d14d39 feat(event): introduce ApplicationConfigurationChanged event to handle team-specific configuration updates and broadcast changes
feat(envs): Generate hash from secrets to invalidate docker layers
2025-09-22 09:44:30 +02:00
Andras Bacsai
593c1b4767 fix(deployment): enhance Dockerfile modification for build-time variables and secrets during deployment in case of docker compose buildpack 2025-09-19 13:46:00 +02:00
Andras Bacsai
9ad5b8c37f feat(deployment): handle buildtime and runtime variables during deployment 2025-09-18 18:15:20 +02:00
Andras Bacsai
b34dc11d8e fix(deployment): prevent removal of running containers for pull request deployments in case of failure 2025-09-18 11:30:49 +02:00
Andras Bacsai
1f4255ef41 refactor(deployment): rename method for modifying Dockerfile to improve clarity and streamline build secrets integration 2025-09-17 18:46:10 +02:00
Andras Bacsai
d7a7bac3f1 refactor(deployment): optimize BuildKit capabilities detection and remove unnecessary comments for cleaner deployment logic 2025-09-17 15:18:26 +02:00
Andras Bacsai
c1bee32f09 feat(deployment): introduce 'use_build_secrets' setting for enhanced security during Docker builds and update related logic in deployment process 2025-09-17 10:34:38 +02:00
Andras Bacsai
87967b8734 refactor(deployment): streamline Docker BuildKit detection and environment variable handling for enhanced security during application deployment 2025-09-17 10:08:29 +02:00
Andras Bacsai
f5e17337f4
Update app/Jobs/ApplicationDeploymentJob.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-09-16 18:26:12 +02:00
Andras Bacsai
f084ded6e9 refactor(deployment): remove redundant environment variable documentation from Dockerfile comments to streamline the deployment process 2025-09-16 18:25:29 +02:00
Andras Bacsai
6314fef8df
Update app/Jobs/ApplicationDeploymentJob.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-09-16 18:25:07 +02:00
Andras Bacsai
8542d33a2d refactor(deployment): conditionally cleanup build secrets based on Docker BuildKit support and remove redundant calls for improved efficiency 2025-09-16 18:20:56 +02:00
Andras Bacsai
c182cac032
Update app/Jobs/ApplicationDeploymentJob.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-09-16 18:20:36 +02:00
Andras Bacsai
efbbe76310 feat(deployment): add support for Docker BuildKit and build secrets to enhance security and flexibility during application deployment
refactor(static-buildpack): seperate static buildpack for readability
2025-09-16 17:16:01 +02:00
Andras Bacsai
9e8fb36bc8 feat(deployment): implement cancellation checks during deployment process to enhance user control and prevent unnecessary execution 2025-09-16 13:40:51 +02:00
Andras Bacsai
7322072518 refactor(deployment): update environment file paths in docker compose commands to use working directory for improved consistency 2025-09-15 18:05:11 +02:00
Andras Bacsai
393745b68c Revert "refactor(file-transfer): replace base64 encoding with direct file transfer method across multiple database actions for improved clarity and efficiency"
This reverts commit 18068857b1.
2025-09-15 17:55:08 +02:00
Andras Bacsai
54a55be8e5 refactor(deployment): streamline environment variable handling for dockercompose and improve sorting of runtime variables 2025-09-15 15:39:07 +02:00
Andras Bacsai
20ad2165e7 feat(environment): introduce 'is_buildtime_only' attribute to environment variables for improved build-time configuration 2025-09-11 17:38:16 +02:00
Andras Bacsai
5b3b4bbc43 refactor(environment): remove 'is_build_time' attribute from environment variable handling across the application to simplify configuration 2025-09-11 16:51:56 +02:00
Andras Bacsai
60374c214e refactor(deployment): update environment file handling in Docker commands to use '/artifacts/' path and streamline variable management 2025-09-11 16:22:03 +02:00
Andras Bacsai
501e6a2650 refactor(environment): standardize service name formatting by replacing '-' and '.' with '_' in environment variable keys 2025-09-11 13:59:02 +02:00
Andras Bacsai
5e0b86f322
Merge pull request #6170 from mindedtech/Add-SERVICE_NAME-variable-for-docker-compose-services
Add SERVICE_NAME variable for docker compose services
2025-09-11 13:06:10 +02:00
Andras Bacsai
b46429e879 refactor(deployment): add environment variable copying logic to Docker build commands for pull requests 2025-09-11 13:01:45 +02:00
Andras Bacsai
49a2942836 fix(deployment): add COOLIFY_* environment variables to Nixpacks build context for enhanced deployment configuration 2025-09-10 16:15:08 +02:00
Andras Bacsai
d10e4fa388 refactor(deployment): streamline next deployment queuing logic by repositioning queue_next_deployment call 2025-09-10 13:26:35 +02:00
Andras Bacsai
feacedbb04 refactor(file-transfer): replace base64 encoding with direct file transfer method in various components for improved clarity and efficiency 2025-09-09 11:10:38 +02:00
Arnaud B
e23ab1e621
feat(deployment): add SERVICE_NAME variables for service discovery
This change introduces automatically generated `SERVICE_NAME_<SERVICE>`
environment variables for each service within a Docker Compose deployment.
This allows services to reliably reference each other by name, which is particularly
useful in pull request environments where container names are dynamically suffixed.

- The application parser now generates and injects these `SERVICE_NAME` variables
   into the environment of all services in the compose file.
- `ApplicationDeploymentJob` is updated to correctly handle and filter these
  new variables during deployment.
- UI components and the `EnvironmentVariableProtection` trait have been updated
to make these generated variables read-only, preventing accidental modification.

This commit introduces two new helper functions to standardize resource naming
for pull request deployments:

-  `addPreviewDeploymentSuffix()`: Generates a consistent suffix format (-pr-{id})
   for resource names in preview deployments
-  `generateDockerComposeServiceName()`: Creates SERVICE_NAME environment variables
   for Docker Compose services
2025-09-08 15:22:44 +02:00
Andras Bacsai
18068857b1 refactor(file-transfer): replace base64 encoding with direct file transfer method across multiple database actions for improved clarity and efficiency 2025-09-08 14:04:24 +02:00