2016-10-07 5 views
1

deploy.ps1ファイルを含むパッケージをデプロイします。あなたが既に知っているようにOctopusはデフォルトでrunning this script on deployingです。私はそれが起こるのを防ぎ、代わりにカスタムスクリプトを実行したいと思います。Octopusによるデプロイメントスクリプトの実行を防止する

+0

なぜこれを行いたいのですが、スクリプトファイルの名前を変更できますか? – Kye

+0

私の状況では、Deploy.ps1は私のパッケージ内のすべてのサービスを展開ターゲットで開始します。これは、1つのサービスを開始する必要がある場合を除き、ほとんどの対象サーバのデフォルト動作と同じです。代わりにカスタムスクリプトを使用したいと思います。 – acai

+0

その特定のプロジェクトから 'deploy.ps1'スクリプトを削除し、Octopusステップ自体でデプロイメントのpowershellスクリプトを実行する方がクリーンな方法ではありませんか? –

答えて

1

あなたはこのような要件を持っている場合、それは別のビルドステップにサービスを開始し、あなたがそのスクリプトが動作したい触手にタグを付けPowerShellを移動する方が良いでしょう。サービスのデプロイメント段階で

Process view

は、環境にそのスクリプト開始

Service Start

が次にサービスを開始ステップを持って「手動」モード、および範囲を設定します/自動起動するサーバー

enter image description here 「 - 遅延自動」とし、サービスを開始私はここで使用ステップテンプレートのコードは、あなたがそれがサービスを設定しますように、ステップテンプレートを変更したい場合があり

{ 
    "Id": "ActionTemplates-1", 
    "Name": "Enable and start service", 
    "Description": null, 
    "ActionType": "Octopus.Script", 
    "Version": 8, 
    "Properties": { 
    "Octopus.Action.Package.NuGetFeedId": "feeds-builtin", 
    "Octopus.Action.Script.Syntax": "PowerShell", 
    "Octopus.Action.Script.ScriptSource": "Inline", 
    "Octopus.Action.RunOnServer": "false", 
    "Octopus.Action.Script.ScriptBody": "$serviceName = $OctopusParameters[\"ServiceName\"]\n\nwrite-host \"the service is: \" $serviceName\n\n& \"sc.exe\" config $serviceName start= delayed-auto\n& \"sc.exe\" start $serviceName\n\n" 
    }, 
    "Parameters": [ 
    { 
     "Name": "ServiceName", 
     "Label": "Service Name", 
     "HelpText": null, 
     "DefaultValue": null, 
     "DisplaySettings": { 
     "Octopus.ControlType": "SingleLineText" 
     } 
    } 
    ], 
    "$Meta": { 
    "ExportedAt": "2016-10-10T10:21:21.980Z", 
    "OctopusVersion": "3.3.2", 
    "Type": "ActionTemplate" 
    } 
} 

です。

1

スクリプトをサブフォルダに移動できますか?

These scripts must be located in the root of your package

http://docs.octopusdeploy.com/display/OD/Custom+scripts

代わりに - それは導入すべきではない場合は、展開パッケージにあなたのdeploy.ps1スクリプトが含まれていません。

enter image description here

関連する問題