Add skip scripting option

This commit is contained in:
Dane Everitt 2017-04-20 17:57:40 -04:00
parent c8f1335a09
commit 3fe5d162f5
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 10 additions and 2 deletions

View file

@ -41,8 +41,7 @@ class OptionController extends Controller
return response()->json([
'scripts' => [
'install' => str_replace(["\r\n", "\n", "\r"], "\n", $server->option->script_install),
// 'upgrade' => str_replace(["\r\n", "\n", "\r"], "\n", $server->option->script_upgrade),
'install' => (! $server->option->script_install) ? null : str_replace(["\r\n", "\n", "\r"], "\n", $server->option->script_install),
'privileged' => $server->option->script_is_privileged,
],
'env' => $environment->merge([

View file

@ -103,6 +103,7 @@ class ServerRepository
'startup' => 'string',
'auto_deploy' => 'sometimes|required|accepted',
'custom_id' => 'sometimes|required|numeric|unique:servers,id',
'skip_scripting' => 'sometimes|required|boolean',
]);
$validator->sometimes('node_id', 'required|numeric|min:1|exists:nodes,id', function ($input) {
@ -326,6 +327,7 @@ class ServerRepository
'type' => $service->folder,
'option' => $option->tag,
'pack' => (isset($pack)) ? $pack->uuid : null,
'skip_scripting' => isset($data['skip_scripting']),
],
'keys' => [
(string) $server->daemonSecret => $this->daemonPermissions,

View file

@ -212,6 +212,13 @@
<select name="pack_id" id="pPackId" class="form-control"></select>
<p class="small text-muted no-margin">Select a service pack to be automatically installed on this server when first created.</p>
</div>
<div class="form-group col-xs-12">
<div class="checkbox checkbox-primary no-margin-bottom">
<input id="pSkipScripting" name="skip_scripting" type="checkbox" value="1" />
<label for="pSkipScripting" class="strong">Skip Service Option Install Script</label>
</div>
<p class="small text-muted no-margin">If the selected <code>Option</code> has an install script attached to it, the script will run during install after the pack is installed. If you would like to skip this step, check this box.</p>
</div>
</div>
</div>
</div>