Skip to content

Commit

Permalink
Revise docs for 3.0.0-alpha.7 (winsw#731)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nxtn authored Dec 23, 2020
1 parent 37bf034 commit 87e7bf2
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 57 deletions.
43 changes: 39 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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).
Expand All @@ -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. |
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion WinSW.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -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>
2 changes: 1 addition & 1 deletion docs/developer/project-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
49 changes: 0 additions & 49 deletions docs/installation.md

This file was deleted.

File renamed without changes.
10 changes: 10 additions & 0 deletions samples/jenkins.xml
Original file line number Diff line number Diff line change
@@ -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>
2 changes: 1 addition & 1 deletion samples/sample-minimal.xml → samples/minimal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/WinSW.Tests/Configuration/ExamplesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static XmlServiceConfig Load(string exampleName)
{
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();
Expand Down

0 comments on commit 87e7bf2

Please sign in to comment.