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

Working on #42 #44

Merged
merged 6 commits into from
Oct 6, 2013
Merged

Working on #42 #44

merged 6 commits into from
Oct 6, 2013

Conversation

muuki88
Copy link
Contributor

@muuki88 muuki88 commented Sep 24, 2013

This is a first draft. Please review if this is okay.

  • Added simple upstart script
  • Added Keys
  • Added Tasks
  • Incremented sbt version to 0.13.0 for testing (maybe reverted in next
    commits)

What's left

Currently I have no idea where to put the Task so I can activate them. Hints appreciated.
After I fixed this, I will test this with play and may revert the sbt version to 0.12.4 .

@@ -3,40 +3,6 @@
### ------------------------------- ###
### Helper methods for BASH scripts ###
### ------------------------------- ###

realpath () {
Copy link
Member

Choose a reason for hiding this comment

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

As you saw in the other thread, I'd rather not remove this method, as I don't think the workaround you have here will fit all the environments we've had issues in :). Check out the other pull request for a different solution.

muuki88 and others added 2 commits September 27, 2013 16:28
- Added simple upstart script
- Added Keys
- Added Tasks
- Incremented sbt version to 0.13.0 for testing (maybe reverted in next
commits)

Moving upstart script to DebianPlugin and adding TaskKeys #42
* Created a new java_server archetype for projects.
* Moved upstart configuration into java_server archetype
* Moved chmod method into common, hacky location.
@jsuereth
Copy link
Member

Ok, I ran some cleanup on this here: 5243356

Let me know what you think. Doing some tests now, seeing if I can get an automated one.

@muuki88
Copy link
Contributor Author

muuki88 commented Sep 28, 2013

I have merged everything and tested it. Things that should be added in future versions are:

  • postinst file with calls
    • initctl reload-configuration so the service can be enabled immediatly started
    • service app_name start to auto run the service
  • prerm file with calls
    • service app_name stop proper stop

@jsuereth
Copy link
Member

Cool! Thanks much on all your help. I can't wait for this feature to be in.

* Typo was causing upstart script to be ignored in favor of bash.
* For some reason chdir wasn't working on my local ubuntu.  Workaround issued.
* Create new tasks which genreate prerem/postinst scripts
* Automatically use files generated by these tasks, if they exist.
* Java server archetype now automatically creates prerem/postinst scripts to
  start up the service upon install.
@jsuereth
Copy link
Member

Alright, I went through and wired just thenecessary changes to make the remaining upstart work go. I've installed/uninstall my first server-based debian now, and it appears to be running quite smooth!

Do you mind doing a code-review to make sure I implemented the things you suggest correctly? https://github.com/sbt/sbt-native-packager/tree/wip/jsuereth-upstart

If so, I'll work on documentation next and make sure this goes out iwth the next release (0.7)! Again, thanks very very much for the contributions.

@muuki88
Copy link
Contributor Author

muuki88 commented Sep 29, 2013

Everything works fine, except the author and description field. The problem can be solved in the
JavaServerApplication.scala

debianUpstartScriptReplacements <<= (maintainer in Debian, packageSummary in Debian, normalizedName, sbt.Keys.version) map { (author, descr, name, version) =>
// TODO name-version is copied from UniversalPlugin. This should be consolidated into a setting (install location...)
val chdir = GenericPackageSettings.installLocation + "/" + name + "/bin"
JavaAppUpstartScript.makeReplacements(author = author, descr = descr, execScript = name, chdir = chdir)

Also the

val chdir = GenericPackageSettings.installLocation + "/" + name + "-" + version + "/bin"

should be changed to

val chdir = GenericPackageSettings.installLocation + "/" + name + "/bin"

@muuki88
Copy link
Contributor Author

muuki88 commented Oct 1, 2013

Should I provide another commit for this?

@jsuereth
Copy link
Member

jsuereth commented Oct 2, 2013

Please do. I hope to get back to this shortly to fill out the documentation. Requires some new pages and flow, so it may be a while, but we can merge into master....

Changing 'chdir' to correct path. Ticket #42
@muuki88
Copy link
Contributor Author

muuki88 commented Oct 2, 2013

There you go :) Is there a schedule for the next release? Would be awesome to use this in play 2.2.0!

@jsuereth
Copy link
Member

jsuereth commented Oct 6, 2013

Great, Thanks so much for the patch work! The schedule is a bit loose, as I have a few other bugs to finish, but it should be within the next few weeks.

jsuereth added a commit that referenced this pull request Oct 6, 2013
@jsuereth jsuereth merged commit e8498f7 into sbt:master Oct 6, 2013
@muuki88
Copy link
Contributor Author

muuki88 commented Oct 6, 2013

Awesome 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants