ccd3861b05dd6a75b39004da28cb2bdc401f8a8d
wiki/building-and-deploying.md
| ... | ... | @@ -22,6 +22,23 @@ Again, check out the script's options for more and other possibilities including |
| 22 | 22 | |
| 23 | 23 | Deploying build results is generally also possible with a Hudson build, but it is not recommended because a user would need to log in to the Hudson server, know where which build workspace is located and then apply the deployment script there. |
| 24 | 24 | |
| 25 | -##[Hudson](http://hudson.sapsailing.com) Working with Releases |
|
| 25 | +## Working with Releases |
|
| 26 | 26 | |
| 27 | -Particularly when starting an EC2 instance, it is helpful to be able to do that using a well-known release of the product. When an EC2 instance starts, it has a version of the product built into the image and its disk snapshots from which the instance got initialized. This, however, is usually not up to date. To refresh it, you could run a build from a specific git commit, or you could install a **release** previously assembled using the `release` option of the `buildAndUpdateProduct.sh` script. |
|
| ... | ... | \ No newline at end of file |
| 0 | +Particularly when starting an EC2 instance, it is helpful to be able to do that using a well-known release of the product. When an EC2 instance starts, it has a version of the product built into the image and its disk snapshots from which the instance got initialized. This, however, is usually not up to date. To refresh it, you could run a build from a specific git commit, or you could install a **release** previously assembled using the `release` option of the `buildAndUpdateProduct.sh` script as follows: |
|
| 1 | + |
|
| 2 | + <gitroot>/configuration/buildAndUpdateProduct.sh build |
|
| 3 | + <gitroot>/configuration/buildAndUpdateProduct.sh -w trac@sapsailing.com -n <release-name> release |
|
| 4 | + |
|
| 5 | +This will ask you for a comment about the release which goes into the release notes text file that accompanies the release. The build results are packed up into a .tar.gz file which is then uploaded to [releases.sapsailing.com](http://releases.sapsailing.com), using the name optionally provided using the -n parameter with the `release` action, or---as a default---the current timestamp for the release name. |
|
| 6 | + |
|
| 7 | +A release can be downloaded and installed to a server by changing to the server's directory, e.g., `~/servers/server` and there executing the `updateEC2Instance.sh` script. Afterwards, starting the instance works as after a local build. |
|
| 8 | + |
|
| 9 | +## Starting, Administrating and Stopping a Java Instance |
|
| 10 | + |
|
| 11 | +The product runs as a Java instance consisting largely of an Equinox OSGi server that load and runs various OSGi bundles constituting the product and that contains an embedded Jetty web server. It connects to a database, may serve as a master for replication through a messaging server, may be launched as a replica of some other master instance, may receive wind data in _Expedition_ format on a specific port and can listen for telnet requests to administrate the OSGi server on a specific port. These and other properties are usually configured in a file called `env.sh` which has to be located in the server directory, e.g., in `~/servers/server`, next to the `start` script. When the `start` script is executed, it first sources the env.sh file which sets the various properties which are then passed to the actual Java process, usually in the form of system properties. |
|
| 12 | + |
|
| 13 | +After successfully having started a Java instance, it can be administrated through a telnet connection. The port on which the OSGi console listens for incoming connections can be configured in the `env.sh` file. Usually it defaults to port `14888`. Therefore, a `telnet localhost 14888` connects you to the OSGi console where an `ss` command will show you all bundles loaded. Once logged on to the OSGi console, a `disconnect` command will disconnect the telnet session from the OSGi console. |
|
| 14 | + |
|
| 15 | +An `exit` command will **terminate** the Java instance after a confirmation. This will obviously stop all services provided by the instance, including all static and dynamic contents served by its web server. You should only trigger the `exit` command if you really know what you are doing! |
|
| 16 | + |
|
| 17 | +Stopping a running server has---for your convenience---been wrapped into the `stop` script usually located in the server's directory. Simply executing it will use a telnet connection to the server's OSGi port and trigger an `exit` command automatically. See above for the "know what you're doing" part... |
|
| ... | ... | \ No newline at end of file |