Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe server loading options in server docs #379

Merged
merged 1 commit into from
Oct 18, 2014
Merged

Describe server loading options in server docs #379

merged 1 commit into from
Oct 18, 2014

Conversation

mhamrah
Copy link
Contributor

@mhamrah mhamrah commented Oct 15, 2014

Wanted to document options for overriding the default server loader as per #376. I've already signed the typesafe CLA, but maybe not for sbt-native-packager.

@muuki88 muuki88 added the documentation Documentation should be extended or updated label Oct 15, 2014
@muuki88
Copy link
Contributor

muuki88 commented Oct 15, 2014

You are awesome. Can you add your system in the table above as well?

@mhamrah
Copy link
Contributor Author

mhamrah commented Oct 15, 2014

@muuki88 Can you clarify? Do you mean something like this:

| Ubuntu | Upstart | X |
| Ubuntu | System V | X |
| CentOS | System V | X |
| CentOS | Upstart | X |
| Fedora | System V | X |
| Windows | Windows Services | |

I didn't explicitly test Fedora, and I need to add a caveat about CentOS and upstart. By default, requiretty is enabled which makes it impossible to sudo in the upstart config. But disabling requiretty makes it work.

I can add that info and whatever else you're asking for. No problem.

@muuki88
Copy link
Contributor

muuki88 commented Oct 16, 2014

Exactly.If you have time testing fedora, this would be awesome, but it's fine if you just add your system you ran on.

Looking forward to some bashScriptExtraDefines docs :-)

@mhamrah
Copy link
Contributor Author

mhamrah commented Oct 16, 2014

  • I tested upstart on centos 6.5, 7 and fedora 20. As Fedora/Centos are moving away from Upstart I didn't include it in the table but added the systemd docs from the markdown.
  • I'm happy to iterate on what I added regarding templating and bash-script extra defines.

As you read earlier the ```bashScriptExtraDefines``` sequence allows you to add new lines to the default bash script used to start the application.
This is useful when you need a setting which isn't mean for the command-line parameter list passed to the java process. The lines added to
```bashScriptExtraDefines``` are placed near the end of the script and have access to a number of utility bash functions (e.g. ``addJava``,
``addApp``, ``addResidual``, ``addDebugger``). You can add lines to this script as we did for the Typesage config file above. For more complex
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: typesafe instead of typesa_g_e

@muuki88 muuki88 added the v0.7.x label Oct 17, 2014
@muuki88
Copy link
Contributor

muuki88 commented Oct 17, 2014

Wow! Thanks a lot for detailed documentation. The ability to override particular snippets inside the shipped bashscripts is pretty new, so was it difficult to find out ( despite the fact that there were no doc )

@muuki88 muuki88 added the 0.8.x label Oct 17, 2014
``addApp``, ``addResidual``, ``addDebugger``). You can add lines to this script as we did for the Typesage config file above. For more complex
scripts you can also inject a seperate file managed in your source tree or resource directory: ::

bashScriptExtraDefines := Source.fromInputStream(this.getClass.getResourceAsStream("/setup-env")).getLines.toSeq
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to recommend appending to this setting, in case some other plugin wants to add its own (hopefully compatible) lines.

Also, it seems like it might be more consistent to make use of the same IO library throughout the examples, and sbt.IO is used in the next example.

An alternative (untested) could be:

bashScriptExtraDefines ++= IO.readLinesURL(this.getClass.getResource("/setup-env"))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree and will make the change. It will also tighten up the
documentation.

On Fri, Oct 17, 2014 at 6:31 AM, Gary Coady notifications@github.com
wrote:

In src/sphinx/GettingStartedApplications/AddingConfiguration.rst:

@@ -130,5 +130,20 @@ One means of doing this is hooking the batScriptExtraDefines key. This allo

Now, the windows version will also load the configuration from the conf/ directory of the package.

+More Complex Scripts
+--------------------
+
+As you read earlier the bashScriptExtraDefines sequence allows you to add new lines to the default bash script used to start the application.
+This is useful when you need a setting which isn't mean for the command-line parameter list passed to the java process. The lines added to
+bashScriptExtraDefines are placed near the end of the script and have access to a number of utility bash functions (e.g. addJava,
+addApp, addResidual, addDebugger). You can add lines to this script as we did for the Typesage config file above. For more complex
+scripts you can also inject a seperate file managed in your source tree or resource directory: ::
+

  • bashScriptExtraDefines := Source.fromInputStream(this.getClass.getResourceAsStream("/setup-env")).getLines.toSeq

I think it's better to recommend appending to this setting, in case some
other plugin wants to add its own (hopefully compatible) lines.

Also, it seems like it might be more consistent to make use of the same IO
library throughout the examples, and sbt.IO is used in the next example.

An alternative (untested) could be:

bashScriptExtraDefines ++= IO.readLinesURL(this.getClass.getResource("/setup-env"))


Reply to this email directly or view it on GitHub
https://github.com/sbt/sbt-native-packager/pull/379/files#r19010987.

@mhamrah
Copy link
Contributor Author

mhamrah commented Oct 17, 2014

I squashed the commits and made the following changes:

  • Changed TOC Depth to 2 levels (I find this easier when navigating the doc site)
  • Altered the into for application and server getting started (to make each level explicit as to
    what was global vs. specific to packages)
  • Specified bash extra defines as append only
  • Moved the linuxScriptReplacements to GettingStartedServers/OverridingTemplates as it's more applicable to that than applications.

@@ -2,21 +2,20 @@ SBT - Native Packager Plugin
############################

This is the documentation for the sbt-native-packager plugin. This plugin aims
to allow native packages to be created for all major operating systems, including:
to allow easy generation of native packages for all major operating systems, including:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice :-)

@muuki88
Copy link
Contributor

muuki88 commented Oct 18, 2014

Thanks a lot for your effort. I'll port this to 0.7.x and 0.8.x ASAP.

muuki88 added a commit that referenced this pull request Oct 18, 2014
Describe server loading options in server docs
@muuki88 muuki88 merged commit 1f4222e into sbt:master Oct 18, 2014
@muuki88
Copy link
Contributor

muuki88 commented Oct 21, 2014

merged into 0.8.x and 0.7.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation should be extended or updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants