Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Add healthcheck URL to deployment job and update version to beta.138

Andras Bacsaibd7637c696dd
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php
index 2f175553e0..83674e8159 100644
--- a/app/Jobs/ApplicationDeploymentJob.php
+++ b/app/Jobs/ApplicationDeploymentJob.php
@@ -75,6 +75,7 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
private ?string $buildTarget = null;
private $log_model;
private Collection $saved_outputs;
+ private ?string $full_healthcheck_url = null;
private string $serverUser = 'root';
private string $serverUserHomeDir = '/root';
@@ -492,8 +493,15 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
$this->execute_remote_command(
[
"echo 'Waiting for healthcheck to pass on the new version of your application.'"
- ],
+ ]
);
+ if ($this->full_healthcheck_url) {
+ $this->execute_remote_command(
+ [
+ "echo 'Healthcheck URL inside your container: {$this->full_healthcheck_url}'"
+ ]
+ );
+ }
while ($counter < $this->application->health_check_retries) {
$this->execute_remote_command(
[
@@ -960,10 +968,12 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
$health_check_port = $this->application->health_check_port;
}
if ($this->application->health_check_path) {
+ $this->full_healthcheck_url = "{$this->application->health_check_method}: {$this->application->health_check_scheme}://{$this->application->health_check_host}:{$health_check_port}{$this->application->health_check_path}";
$generated_healthchecks_commands = [
"curl -s -X {$this->application->health_check_method} -f {$this->application->health_check_scheme}://{$this->application->health_check_host}:{$health_check_port}{$this->application->health_check_path} > /dev/null"
];
} else {
+ $this->full_healthcheck_url = "{$this->application->health_check_method}: {$this->application->health_check_scheme}://{$this->application->health_check_host}:{$health_check_port}/";
$generated_healthchecks_commands = [
"curl -s -X {$this->application->health_check_method} -f {$this->application->health_check_scheme}://{$this->application->health_check_host}:{$health_check_port}/"
];
@@ -1098,15 +1108,15 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
private function start_by_compose_file()
{
- if ($this->application->dockerfile || $this->application->build_pack === 'dockerfile') {
+ if ($this->application->build_pack === 'dockerimage') {
$this->execute_remote_command(
+ ["echo -n 'Pulling latest images from the registry.'"],
+ [executeInDocker($this->deployment_uuid, "docker compose --project-directory {$this->workdir} pull"), "hidden" => true],
["echo -n 'Starting application (could take a while).'"],
[executeInDocker($this->deployment_uuid, "docker compose --project-directory {$this->workdir} up --build -d"), "hidden" => true],
);
- } else if ($this->application->build_pack === 'dockerimage') {
+ } else {
$this->execute_remote_command(
- ["echo -n 'Pulling latest images from the registry.'"],
- [executeInDocker($this->deployment_uuid, "docker compose --project-directory {$this->workdir} pull"), "hidden" => true],
["echo -n 'Starting application (could take a while).'"],
[executeInDocker($this->deployment_uuid, "docker compose --project-directory {$this->workdir} up --build -d"), "hidden" => true],
);
diff --git a/config/sentry.php b/config/sentry.php
index 1afa9d1ea8..2de0f59df0 100644
--- a/config/sentry.php
+++ b/config/sentry.php
@@ -7,7 +7,7 @@ return [
// The release version of your application
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
- 'release' => '4.0.0-beta.137',
+ 'release' => '4.0.0-beta.138',
// When left empty or `null` the Laravel environment will be used
'environment' => config('app.env'),
diff --git a/config/version.php b/config/version.php
index 20308c282c..8915456f9a 100644
--- a/config/version.php
+++ b/config/version.php
@@ -1,3 +1,3 @@
<?php
-return '4.0.0-beta.137';
+return '4.0.0-beta.138';
diff --git a/versions.json b/versions.json
index 826bf73cc1..26e16c15f8 100644
--- a/versions.json
+++ b/versions.json
@@ -4,7 +4,7 @@
"version": "3.12.36"
},
"v4": {
- "version": "4.0.0-beta.137"
+ "version": "4.0.0-beta.138"
}
}
}