Skip to content

Commit d1dd353

Browse files
committed
Combine CLI tool and scheduler
1 parent 4dae47b commit d1dd353

33 files changed

+155
-3337
lines changed

docs-src/commands.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,19 @@ namespace MyCommandPlugin
9393
}
9494
```
9595

96-
Download the InEngineCli tool that matches the version of the InEngine.Core package you included from the [GitHub Releases](https://github.com/InEngine-NET/InEngine.NET/releases) page.
96+
Download the InEngine binary distribution, from the [GitHub Releases](https://github.com/InEngine-NET/InEngine.NET/releases) page, that matches the version of the InEngine.Core package you included.
9797

98-
Copy your project's DLLs into the same directory as InEngineCli.exe.
98+
Copy your project's DLLs into the same directory as inengine.exe.
9999

100100
Run your command...
101101

102102
```bash
103-
InEngineCli.exe -pMyCommandPlugin my-command
103+
inengine.exe -pMyCommandPlugin my-command
104104
```
105105

106106
## Discover Command Plugins
107107

108-
Run InEngineCli.exe without any arguments to see a list of arguments.
108+
Run inengine.exe without any arguments to see a list of plugins.
109109

110110
```text
111111
@@ -127,10 +127,10 @@ Plugins:
127127

128128
## Discover Commands in a Plugin
129129

130-
Run InEngineCli.exe with only the plugin specified.
130+
Run inengine.exe with only the plugin specified.
131131

132132
```bash
133-
InEngineCli.exe -pInEngine.Core
133+
inengine.exe -pInEngine.Core
134134
```
135135

136136
The **InEngine.Core** library is itself a plugin that contains queue related commands.
@@ -161,10 +161,10 @@ Commands:
161161
Run the command with the -h or --help arguments.
162162

163163
```bash
164-
InEngineCli.exe -pInEngine.Core queue:clear -h
164+
inengine.exe -pInEngine.Core queue:clear -h
165165
```
166166

167-
The **InEngine.Core** plugin's command to clear the InEngine.NET's queues produces this help message.
167+
The **InEngine.Core** plugin's command to clear the InEngine.NET queues produces this help message.
168168

169169
```text
170170
InEngine 3.x

docs-src/queuing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ Note that all queue commands reside in the **InEngine.Core** plugin.
3737
This is an example of how to publish a command from the CLI by specifying the commands assembly, class name, and arguments:
3838

3939
```bash
40-
InEngineCli.exe -pInEngine.Core queue:publish --command-assembly=MyCommandPlugin.dll --command-class=MyCommand --args "text=bar"
40+
inengine.exe -pInEngine.Core queue:publish --command-assembly=MyCommandPlugin.dll --command-class=MyCommand --args "text=bar"
4141
```
4242

4343
There is an "Echo" command in the *InEngine.Core* package. It is useful for end-to-end testing with the queue feature.
4444

4545
```bash
46-
InEngineCli.exe -pInEngine.Core queue:publish --command-assembly=InEngine.Core.dll --command-class=InEngine.Core.Commands.Echo --args "text=foo"
46+
inengine.exe -pInEngine.Core queue:publish --command-assembly=InEngine.Core.dll --command-class=InEngine.Core.Commands.Echo --args "text=foo"
4747
```
4848

4949
### Consuming Commands
@@ -67,13 +67,13 @@ Commands can be consumed from the command line as well with this simple command:
6767
#### From the Command Line
6868

6969
```bash
70-
InEngineCli.exe -pInEngine.Core queue:consume
70+
inengine.exe -pInEngine.Core queue:consume
7171
```
7272

7373
use the **--secondary** switch to consume the secondary queue instead of the primary queue:
7474

7575
```bash
76-
InEngineCli.exe -pInEngine.Core queue:consume --secondary
76+
inengine.exe -pInEngine.Core queue:consume --secondary
7777
```
7878

7979
#### With the Scheduler

docs-src/scheduling.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Scheduling
22

3-
[Commands](commands) can be scheduled to run by leveraging the InEngineScheduler.exe program, available as a download from a recent [release](https://github.com/InEngine-NET/InEngine.NET/releases).
3+
[Commands](commands) can be scheduled to run by leveraging the inengine.exe program, available as a download from a recent [release](https://github.com/InEngine-NET/InEngine.NET/releases).
44

55
## Scheduling a Command
66

@@ -59,16 +59,16 @@ namespace MyCommandPlugin
5959

6060
### Manually from the CLI
6161

62-
Running the scheduler from the CommandLine is useful for debugging or local development. Simply run *InEngineScheduler.exe* from the command line.
62+
Running the scheduler from the CommandLine is useful for debugging or local development. Simply run *inengine.exe* from the command line.
6363

6464
```bash
65-
InEngineScheduler.exe
65+
inengine.exe
6666
```
6767

6868
It can also be run on Mac/Linux with Mono.
6969

7070
```bash
71-
mono InEngineScheduler.exe
71+
mono inengine.exe
7272
```
7373

7474
### On Windows as a Service
@@ -109,7 +109,7 @@ Supervisor configuration files are stored in the **/etc/supervisor/conf.d** dire
109109
[program:inengine-scheudler]
110110
process_name=%(program_name)s_%(process_num)02d
111111
directory=/path/to/scheduler
112-
command=mono InEngineScheduler.exe
112+
command=mono inengine.exe
113113
autostart=true
114114
autorestart=true
115115
user=InEngine

docs/mkdocs/search_index.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@
6767
},
6868
{
6969
"location": "/scheduling/",
70-
"text": "Scheduling\n\n\nCommands\n can be scheduled to run by leveraging the InEngineScheduler.exe program, available as a download from a recent \nrelease\n.\n\n\nScheduling a Command\n\n\nA job schedule is created by adding a class to your plugin assembly that implements the \nInEngine.Core.Jobs\n interface.\n\n\n\nusing System;\nusing Quartz;\n\nnamespace MyCommandPlugin\n{\n public class Jobs : IJobs\n {\n public void Schedule(IScheduler scheduler)\n {\n // Schedule some jobs\n }\n }\n}\n\n\n\n\nThis class is automatically discovered by the InEngine.NET scheduler.\nIt will call the Jobs.Schedule method with an initialized Quartz.NET scheduler object.\n\n\nusing System;\nusing Quartz;\n\nnamespace MyCommandPlugin\n{\n public class Jobs : IJobs\n {\n public void Schedule(IScheduler scheduler)\n {\n var myCommand = new MyCommand();\n\n // Generate a schedulable job with the command.\n var job = myCommand.MakeTriggerBuilder().Build();\n\n // Generate a trigger for the job, and set its schedule to every 10 seconds.\n var trigger = myCommand.MakeTriggerBuilder().Build()\n .StartNow()\n .WithSimpleSchedule(x =\n x.WithIntervalInSeconds(10).RepeatForever())\n .Build();\n\n // Register the job and trigger with the scheduler.\n scheduler.ScheduleJob(job, trigger);\n }\n }\n}\n\n\n\n\n\nRunning the Scheduler\n\n\nManually from the CLI\n\n\nRunning the scheduler from the CommandLine is useful for debugging or local development. Simply run \nInEngineScheduler.exe\n from the command line.\n\n\nInEngineScheduler.exe\n\n\n\n\nIt can also be run on Mac/Linux with Mono.\n\n\nmono InEngineScheduler.exe\n\n\n\n\nOn Windows as a Service\n\n\nInstalling\n\n\nRun the Install.ps1 PowerShell script in the scheduler directory to install the scheduler in place. The script needs to be run as an administrator. The script will register the service at the location where the script is run. \n\n\nps Install.ps1\n\n\n\n\nUninstalling\n\n\nSimply run the \nUninstall.ps1\n script with elevated permissions to unregister the service.\n\n\nps Uninstall.ps1\n\n\n\n\nOn Linux with Supervisor\n\n\nSupervisor is a process control system for Linux. It has extensive \ndocumentation\n, but the following should be enough to get started.\n\n\nInstalling Supervisor\n\n\nThis command installs Supervisor on Ubuntu:\n\n\nsudo apt-get install supervisor\n\n\n\n\nConfiguring Supervisor\n\n\nSupervisor configuration files are stored in the \n/etc/supervisor/conf.d\n directory. Multiple files can be created in this directory to specify different programs, or multiple instances of the same program, for Supervisor to monitor. Copy this sample config into a file called \n/etc/supervisor/conf.d/inengine-scheduler.conf\n. \n\n\n[program:inengine-scheudler]\nprocess_name=%(program_name)s_%(process_num)02d\ndirectory=/path/to/scheduler\ncommand=mono InEngineScheduler.exe\nautostart=true\nautorestart=true\nuser=InEngine\nnumprocs=1\nredirect_stderr=true\nstdout_logfile=./scheduler.log\n\n\n\n\nStarting Supervisor\n\n\nWhenever a configuration change happens to files in the Supervisor config files, Supervisor needs to be instructed to reload its configuration.\n\n\nsudo supervisorctl reread\nsudo supervisorctl update\n\n\n\n\nNow, simply start the InEngine Scheduler.\n\n\nsudo supervisorctl start inengine-scheduler:*",
70+
"text": "Scheduling\n\n\nCommands\n can be scheduled to run by leveraging the inengine.exe program, available as a download from a recent \nrelease\n.\n\n\nScheduling a Command\n\n\nA job schedule is created by adding a class to your plugin assembly that implements the \nInEngine.Core.Jobs\n interface.\n\n\n\nusing System;\nusing Quartz;\n\nnamespace MyCommandPlugin\n{\n public class Jobs : IJobs\n {\n public void Schedule(IScheduler scheduler)\n {\n // Schedule some jobs\n }\n }\n}\n\n\n\n\nThis class is automatically discovered by the InEngine.NET scheduler.\nIt will call the Jobs.Schedule method with an initialized Quartz.NET scheduler object.\n\n\nusing System;\nusing Quartz;\n\nnamespace MyCommandPlugin\n{\n public class Jobs : IJobs\n {\n public void Schedule(IScheduler scheduler)\n {\n var myCommand = new MyCommand();\n\n // Generate a schedulable job with the command.\n var job = myCommand.MakeTriggerBuilder().Build();\n\n // Generate a trigger for the job, and set its schedule to every 10 seconds.\n var trigger = myCommand.MakeTriggerBuilder().Build()\n .StartNow()\n .WithSimpleSchedule(x =\n x.WithIntervalInSeconds(10).RepeatForever())\n .Build();\n\n // Register the job and trigger with the scheduler.\n scheduler.ScheduleJob(job, trigger);\n }\n }\n}\n\n\n\n\n\nRunning the Scheduler\n\n\nManually from the CLI\n\n\nRunning the scheduler from the CommandLine is useful for debugging or local development. Simply run \ninengine.exe\n from the command line.\n\n\ninengine.exe\n\n\n\n\nIt can also be run on Mac/Linux with Mono.\n\n\nmono inengine.exe\n\n\n\n\nOn Windows as a Service\n\n\nInstalling\n\n\nRun the Install.ps1 PowerShell script in the scheduler directory to install the scheduler in place. The script needs to be run as an administrator. The script will register the service at the location where the script is run. \n\n\nps Install.ps1\n\n\n\n\nUninstalling\n\n\nSimply run the \nUninstall.ps1\n script with elevated permissions to unregister the service.\n\n\nps Uninstall.ps1\n\n\n\n\nOn Linux with Supervisor\n\n\nSupervisor is a process control system for Linux. It has extensive \ndocumentation\n, but the following should be enough to get started.\n\n\nInstalling Supervisor\n\n\nThis command installs Supervisor on Ubuntu:\n\n\nsudo apt-get install supervisor\n\n\n\n\nConfiguring Supervisor\n\n\nSupervisor configuration files are stored in the \n/etc/supervisor/conf.d\n directory. Multiple files can be created in this directory to specify different programs, or multiple instances of the same program, for Supervisor to monitor. Copy this sample config into a file called \n/etc/supervisor/conf.d/inengine-scheduler.conf\n. \n\n\n[program:inengine-scheudler]\nprocess_name=%(program_name)s_%(process_num)02d\ndirectory=/path/to/scheduler\ncommand=mono inengine.exe\nautostart=true\nautorestart=true\nuser=InEngine\nnumprocs=1\nredirect_stderr=true\nstdout_logfile=./scheduler.log\n\n\n\n\nStarting Supervisor\n\n\nWhenever a configuration change happens to files in the Supervisor config files, Supervisor needs to be instructed to reload its configuration.\n\n\nsudo supervisorctl reread\nsudo supervisorctl update\n\n\n\n\nNow, simply start the InEngine Scheduler.\n\n\nsudo supervisorctl start inengine-scheduler:*",
7171
"title": "Scheduling"
7272
},
7373
{
7474
"location": "/scheduling/#scheduling",
75-
"text": "Commands can be scheduled to run by leveraging the InEngineScheduler.exe program, available as a download from a recent release .",
75+
"text": "Commands can be scheduled to run by leveraging the inengine.exe program, available as a download from a recent release .",
7676
"title": "Scheduling"
7777
},
7878
{
@@ -87,7 +87,7 @@
8787
},
8888
{
8989
"location": "/scheduling/#manually-from-the-cli",
90-
"text": "Running the scheduler from the CommandLine is useful for debugging or local development. Simply run InEngineScheduler.exe from the command line. InEngineScheduler.exe It can also be run on Mac/Linux with Mono. mono InEngineScheduler.exe",
90+
"text": "Running the scheduler from the CommandLine is useful for debugging or local development. Simply run inengine.exe from the command line. inengine.exe It can also be run on Mac/Linux with Mono. mono inengine.exe",
9191
"title": "Manually from the CLI"
9292
},
9393
{
@@ -117,7 +117,7 @@
117117
},
118118
{
119119
"location": "/scheduling/#configuring-supervisor",
120-
"text": "Supervisor configuration files are stored in the /etc/supervisor/conf.d directory. Multiple files can be created in this directory to specify different programs, or multiple instances of the same program, for Supervisor to monitor. Copy this sample config into a file called /etc/supervisor/conf.d/inengine-scheduler.conf . [program:inengine-scheudler]\nprocess_name=%(program_name)s_%(process_num)02d\ndirectory=/path/to/scheduler\ncommand=mono InEngineScheduler.exe\nautostart=true\nautorestart=true\nuser=InEngine\nnumprocs=1\nredirect_stderr=true\nstdout_logfile=./scheduler.log",
120+
"text": "Supervisor configuration files are stored in the /etc/supervisor/conf.d directory. Multiple files can be created in this directory to specify different programs, or multiple instances of the same program, for Supervisor to monitor. Copy this sample config into a file called /etc/supervisor/conf.d/inengine-scheduler.conf . [program:inengine-scheudler]\nprocess_name=%(program_name)s_%(process_num)02d\ndirectory=/path/to/scheduler\ncommand=mono inengine.exe\nautostart=true\nautorestart=true\nuser=InEngine\nnumprocs=1\nredirect_stderr=true\nstdout_logfile=./scheduler.log",
121121
"title": "Configuring Supervisor"
122122
},
123123
{

docs/scheduling/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
<div class="col-md-9" role="main">
106106

107107
<h1 id="scheduling">Scheduling</h1>
108-
<p><a href="../commands">Commands</a> can be scheduled to run by leveraging the InEngineScheduler.exe program, available as a download from a recent <a href="https://github.com/InEngine-NET/InEngine.NET/releases">release</a>.</p>
108+
<p><a href="../commands">Commands</a> can be scheduled to run by leveraging the inengine.exe program, available as a download from a recent <a href="https://github.com/InEngine-NET/InEngine.NET/releases">release</a>.</p>
109109
<h2 id="scheduling-a-command">Scheduling a Command</h2>
110110
<p>A job schedule is created by adding a class to your plugin assembly that implements the <strong>InEngine.Core.Jobs</strong> interface.</p>
111111
<pre><code class="csharp">
@@ -156,12 +156,12 @@ <h2 id="scheduling-a-command">Scheduling a Command</h2>
156156

157157
<h2 id="running-the-scheduler">Running the Scheduler</h2>
158158
<h3 id="manually-from-the-cli">Manually from the CLI</h3>
159-
<p>Running the scheduler from the CommandLine is useful for debugging or local development. Simply run <em>InEngineScheduler.exe</em> from the command line.</p>
160-
<pre><code class="bash">InEngineScheduler.exe
159+
<p>Running the scheduler from the CommandLine is useful for debugging or local development. Simply run <em>inengine.exe</em> from the command line.</p>
160+
<pre><code class="bash">inengine.exe
161161
</code></pre>
162162

163163
<p>It can also be run on Mac/Linux with Mono.</p>
164-
<pre><code class="bash">mono InEngineScheduler.exe
164+
<pre><code class="bash">mono inengine.exe
165165
</code></pre>
166166

167167
<h3 id="on-windows-as-a-service">On Windows as a Service</h3>
@@ -187,7 +187,7 @@ <h4 id="configuring-supervisor">Configuring Supervisor</h4>
187187
<pre><code class="ini">[program:inengine-scheudler]
188188
process_name=%(program_name)s_%(process_num)02d
189189
directory=/path/to/scheduler
190-
command=mono InEngineScheduler.exe
190+
command=mono inengine.exe
191191
autostart=true
192192
autorestart=true
193193
user=InEngine

src/InEngine.Core.Tests/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<package id="Castle.Core" version="4.2.1" targetFramework="net462" />
55
<package id="Common.Logging" version="3.4.1" targetFramework="net462" />
66
<package id="Common.Logging.Core" version="3.4.1" targetFramework="net462" />
7-
<package id="Microsoft.CSharp" version="4.0.1" targetFramework="net462" />
7+
<package id="Microsoft.CSharp" version="4.4.0" targetFramework="net462" />
88
<package id="Moq" version="4.7.145" targetFramework="net462" />
99
<package id="NUnit" version="3.9.0" targetFramework="net462" />
1010
<package id="Quartz" version="2.6.1" targetFramework="net462" />

src/InEngine.Net.sln

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt
99
SharedAssemblyInfo.cs = SharedAssemblyInfo.cs
1010
EndProjectSection
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InEngineScheduler", "InEngineScheduler\InEngineScheduler.csproj", "{93B8F28C-2A8A-4BC9-9D9F-6FF3CCEE5D6E}"
13-
EndProject
14-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InEngineCli", "InEngineCli\InEngineCli.csproj", "{DF1A45FD-4887-4D65-8BAD-EE17B70FE79D}"
15-
EndProject
1612
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InEngine.Core", "InEngine.Core\InEngine.Core.csproj", "{1C604C4F-3F98-483C-89E3-C951BE03366A}"
1713
EndProject
1814
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InEngine.Commands", "InEngine.Commands\InEngine.Commands.csproj", "{74CA3917-E2F3-4C75-96AF-156BC52C4C5E}"
1915
EndProject
2016
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InEngine.Core.Tests", "InEngine.Core.Tests\InEngine.Core.Tests.csproj", "{CC74DD78-76C9-4143-A567-527E82DA475B}"
2117
EndProject
18+
Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "InEngine", "InEngine\InEngine.csproj", "{11755CC6-5FC9-49BF-AB73-4FB89E6F7D95}"
19+
EndProject
2220
Global
2321
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2422
Debug|Any CPU = Debug|Any CPU
2523
Release|Any CPU = Release|Any CPU
2624
EndGlobalSection
2725
GlobalSection(ProjectConfigurationPlatforms) = postSolution
28-
{93B8F28C-2A8A-4BC9-9D9F-6FF3CCEE5D6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29-
{93B8F28C-2A8A-4BC9-9D9F-6FF3CCEE5D6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
30-
{93B8F28C-2A8A-4BC9-9D9F-6FF3CCEE5D6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
31-
{93B8F28C-2A8A-4BC9-9D9F-6FF3CCEE5D6E}.Release|Any CPU.Build.0 = Release|Any CPU
32-
{DF1A45FD-4887-4D65-8BAD-EE17B70FE79D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33-
{DF1A45FD-4887-4D65-8BAD-EE17B70FE79D}.Debug|Any CPU.Build.0 = Debug|Any CPU
34-
{DF1A45FD-4887-4D65-8BAD-EE17B70FE79D}.Release|Any CPU.ActiveCfg = Release|Any CPU
35-
{DF1A45FD-4887-4D65-8BAD-EE17B70FE79D}.Release|Any CPU.Build.0 = Release|Any CPU
3626
{1C604C4F-3F98-483C-89E3-C951BE03366A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3727
{1C604C4F-3F98-483C-89E3-C951BE03366A}.Debug|Any CPU.Build.0 = Debug|Any CPU
3828
{1C604C4F-3F98-483C-89E3-C951BE03366A}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -45,6 +35,10 @@ Global
4535
{CC74DD78-76C9-4143-A567-527E82DA475B}.Debug|Any CPU.Build.0 = Debug|Any CPU
4636
{CC74DD78-76C9-4143-A567-527E82DA475B}.Release|Any CPU.ActiveCfg = Release|Any CPU
4737
{CC74DD78-76C9-4143-A567-527E82DA475B}.Release|Any CPU.Build.0 = Release|Any CPU
38+
{11755CC6-5FC9-49BF-AB73-4FB89E6F7D95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39+
{11755CC6-5FC9-49BF-AB73-4FB89E6F7D95}.Debug|Any CPU.Build.0 = Debug|Any CPU
40+
{11755CC6-5FC9-49BF-AB73-4FB89E6F7D95}.Release|Any CPU.ActiveCfg = Release|Any CPU
41+
{11755CC6-5FC9-49BF-AB73-4FB89E6F7D95}.Release|Any CPU.Build.0 = Release|Any CPU
4842
EndGlobalSection
4943
GlobalSection(SolutionProperties) = preSolution
5044
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)