Revise docs for 3.0.0-alpha.7 (#731)

* Revise docs for 3.0.0-alpha.7

* Merge the installation guide into the homepage

* Fix header levels

* Add Jenkins sample

* Strip common file name prefix
pull/746/head v3.0.0-alpha.7
Next Turn 2020-12-24 03:12:15 +08:00 committed by GitHub
parent 37bf034884
commit 87e7bf2b6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 53 additions and 57 deletions

View File

@ -12,8 +12,6 @@ WinSW wraps and manages any application as a Windows service.
**We are actively developing WinSW 3. Please refer to the [v2](https://github.com/winsw/winsw/tree/master) branch for previous version documentation.**
**Please help us prioritize items by voting or commenting on the issues!**
## Why?
See the [project manifest](MANIFEST.md).
@ -43,6 +41,44 @@ Alternative sources:
* [Maven packaging](https://github.com/jenkinsci/winsw-maven-packaging) for executables, hosted by the [Jenkins project](https://jenkins.io/).
Binaries are available [here](https://repo.jenkins-ci.org/releases/com/sun/winsw/winsw/). (2.x)
## Get started
### Use WinSW as a global tool
1. Take *WinSW.exe* or *WinSW.zip* from the distribution.
1. Write *myapp.xml* (see the [XML config file specification](docs/xml-config-file.md) and [samples](samples) for more details).
1. Run [`winsw install myapp.xml [options]`](docs/cli-commands.md#install-command) to install the service.
1. Run [`winsw start myapp.xml`](docs/cli-commands.md#start-command) to start the service.
1. Run [`winsw status myapp.xml`](docs/cli-commands.md#status-command) to see if your service is up and running.
### Use WinSW as a bundled tool
1. Take *WinSW.exe* or *WinSW.zip* from the distribution, and rename the *.exe* to your taste (such as *myapp.exe*).
1. Write *myapp.xml* (see the [XML config file specification](docs/xml-config-file.md) and [samples](samples) for more details).
1. Place those two files side by side, because that's how WinSW discovers its co-related configuration.
1. Run [`myapp.exe install [options]`](docs/cli-commands.md#install-command) to install the service.
1. Run [`myapp.exe start`](docs/cli-commands.md#start-command) to start the service.
### Sample configuration file
You write the configuration file that defines your service.
The example below is a primitive example being used in the Jenkins project:
```xml
<service>
<id>jenkins</id>
<name>Jenkins</name>
<description>This service runs Jenkins continuous integration system.</description>
<env name="JENKINS_HOME" value="%BASE%"/>
<executable>java</executable>
<arguments>-Xrs -Xmx256m -jar "%BASE%\jenkins.war" --httpPort=8080</arguments>
<log mode="roll"></log>
</service>
```
The full specification of the configuration file is available [here](docs/xml-config-file.md).
You can find more samples [here](samples).
## Usage
WinSW is being managed by the [XML configuration file](docs/xml-config-file.md).
@ -51,7 +87,7 @@ Your renamed *WinSW.exe* binary also accepts the following commands:
| Command | Description |
| ------- | ----------- |
| [install](docs/cli-commands.md#install-command) | Installs the service. This command requires some preliminary steps described in the [installation guide](docs/installation.md). |
| [install](docs/cli-commands.md#install-command) | Installs the service. |
| [uninstall](docs/cli-commands.md#uninstall-command) | Uninstalls the service. |
| [start](docs/cli-commands.md#start-command) | Starts the service. |
| [stop](docs/cli-commands.md#stop-command) | Stops the service. |
@ -74,7 +110,6 @@ Most commands require Administrator privileges to execute. WinSW will prompt for
## Documentation
* [Get started](docs/installation.md)
* [Migrate to WinSW 3.x](docs/migrate-to-3-x.md)
* Configuration:
* [XML configuration file](docs/xml-config-file.md)

View File

@ -26,6 +26,6 @@ More info about the wrapper is available in the projects GitHub repository.
</metadata>
<files>
<file src="artifacts\publish\WinSW-net461.exe" target="lib\net461\WinSW-net461.exe" />
<file src="samples\sample-complete.xml" target="lib\net461\WinSW-net461.xml" />
<file src="samples\complete.xml" target="lib\net461\WinSW-net461.xml" />
</files>
</package>

View File

@ -20,7 +20,7 @@
## :open_file_folder: samples
This folder contains templates for configuration files. *sample-minimal.xml* contains a template for mandatory configurations and *sample-complete.xml* contains all possible configurations with documentation.
This folder contains templates for configuration files. *minimal.xml* contains a template for mandatory configurations and *complete.xml* contains all possible configurations with documentation.
## :open_file_folder: Core

View File

@ -1,49 +0,0 @@
# Get started
This page provides WinSW installation guidelines for different cases.
## Use WinSW as a global tool
1. Take *WinSW.exe* or *WinSW.zip* from the distribution.
1. Write *myapp.xml* (see the [XML config file specification](xml-config-file.md) for more details)
1. Run [`winsw install myapp.xml [options]`](cli-commands.md#install-command) to install the service.
1. Run [`winsw start myapp.xml`](cli-commands.md#start-command) to start the service.
1. Run [`winsw status myapp.xml`](cli-commands.md#status-command) to see if your service is up and running.
## Use WinSW as a bundled tool
In order to setup WinSW, you commonly need to perform the following steps:
1. Take *WinSW.exe* from the distribution, and rename it to your taste (such as *myapp.exe*)
1. Write *myapp.xml* (see the [XML config file specification](xml-config-file.md) for more details)
1. Place those two files side by side, because that's how WinSW discovers its configuration.
1. Run [`myapp.exe install [options]`](cli-commands.md#install-command) to install the service.
1. Run [`myapp.exe start`](cli-commands.md#start-command) to start the service.
There are some details for each step available below.
## Installation step details
### Step 2. Configuration file
You write the configuration file that defines your service.
The example below is a primitive example being used in the Jenkins project:
```xml
<service>
<id>jenkins</id>
<name>Jenkins</name>
<description>This service runs Jenkins continuous integration system.</description>
<env name="JENKINS_HOME" value="%BASE%"/>
<executable>java</executable>
<arguments>-Xrs -Xmx256m -jar "%BASE%\jenkins.war" --httpPort=8080</arguments>
<log mode="roll"></log>
</service>
```
The full specification of the configuration file is available [here](xml-config-file.md).
### Step 3. Service registration
The Installer can be also started with the `/p` option.
In such case it will prompt for an account name and password, which should be used as a service account.

10
samples/jenkins.xml Normal file
View File

@ -0,0 +1,10 @@
<service>
<id>jenkins</id>
<name>Jenkins</name>
<description>This service runs Jenkins continuous integration system.</description>
<env name="JENKINS_HOME" value="%BASE%" />
<executable>java</executable>
<arguments>-Xrs -Xmx256m -jar "%BASE%\jenkins.war" --httpPort=8080</arguments>
<log mode="roll" />
<onfailure action="restart" />
</service>

View File

@ -30,7 +30,7 @@
E.g. for myapp.exe the configuration file name should be myapp.xml
You can find more information about the configuration options here: https://github.com/winsw/winsw/blob/master/docs/xml-config-file.md
Full example: https://github.com/winsw/winsw/blob/master/samples/sample-complete.xml
Full example: https://github.com/winsw/winsw/blob/master/samples/complete.xml
-->
<service>

View File

@ -37,7 +37,7 @@ namespace WinSW.Tests.Configuration
{
string directory = Layout.RepositoryRoot;
string path = Path.Combine(directory, $@"samples\sample-{exampleName}.xml");
string path = Path.Combine(directory, $@"samples\{exampleName}.xml");
Assert.True(File.Exists(path));
var dom = new XmlDocument();