mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-19 09:51:37 +00:00
Fix Deployment Script on Windows Clients (#433)
* resolve issue with EOL * Manual Run * reverse change for manual run of tests * remove logging
This commit is contained in:
parent
93a7bf9c3a
commit
5947ae80bb
@ -12,9 +12,9 @@ class UpdateDeploymentScript
|
|||||||
*/
|
*/
|
||||||
public function update(Site $site, array $input): void
|
public function update(Site $site, array $input): void
|
||||||
{
|
{
|
||||||
$site->deploymentScript()->update([
|
$script = $site->deploymentScript;
|
||||||
'content' => $input['script'],
|
$script->content = $input['script'];
|
||||||
]);
|
$script->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,6 +15,15 @@ class DeploymentScript extends AbstractModel
|
|||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
|
protected static function boot(): void
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
|
||||||
|
static::saving(function ($deploymentScript) {
|
||||||
|
$deploymentScript->content = str_replace("\r\n", "\n", $deploymentScript->content);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'site_id',
|
'site_id',
|
||||||
'name',
|
'name',
|
||||||
|
@ -162,7 +162,7 @@ public function runScript(string $path, string $script, ?ServerLog $serverLog, ?
|
|||||||
}
|
}
|
||||||
$command = '';
|
$command = '';
|
||||||
foreach ($variables as $key => $variable) {
|
foreach ($variables as $key => $variable) {
|
||||||
$command .= "$key=$variable".PHP_EOL;
|
$command .= "$key=$variable\n";
|
||||||
}
|
}
|
||||||
$command .= $this->getScript('run-script.sh', [
|
$command .= $this->getScript('run-script.sh', [
|
||||||
'path' => $path,
|
'path' => $path,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user