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

Fixes for RPM related functionality in 1.0.5-M2 #668

Merged
merged 2 commits into from
Sep 11, 2015

Conversation

fsat
Copy link
Collaborator

@fsat fsat commented Sep 11, 2015

The fixes address the following issues.

Ensure RPM preinst script continues normally when rpmPrefix is not declared
Without this fix, when rpmPrefix is not declared, the preinst will terminate in error.

Ensure application is running on the installed directory in the RPM-based distribution
This was fixed as part of PR #653 which was accidentally removed in PR #661. Tests are added to prevent this regression from occurring.

…clared

Use normal bash `if` statement as opposed to `[ -n "${MY_VAR}" ] && ...` as the latter
will cause the preinst script to fail if the condition check returns false
…ased distribution

Reinstate the fix in PR sbt#653 that was accidentally removed by PR sbt#661
@fsat
Copy link
Collaborator Author

fsat commented Sep 11, 2015

Manual Tests

Scenario:

  • Without rpmPrefix declared
  • With rpmPrefix declared + default installation
  • With rpmPrefix declared + relocated installation

For each scenario, ensure:

  • Package is installed in the correct location
  • Process is started
  • Process is running within correct working directory
  • Log file has the correct name
  • Package prefix is stored with the correct value if rpmPrefix is defined

Tested on Centos7

I think the issues raised in this PR is mainly caused by the fact that I was overriding the preinst and start script and then retrofitting them manually into sbt-native-packager project.

I have now taken a different approach:

  • All changes are now made within my branch of sbt-native-packager
  • sbt publish-local -Dproject.version=${LOCAL_VERSION} is used to publish all changes into my own the local filesystem repo (i.e. does not go to bintray).
  • The project to be packaged depends on the LOCAL_VERSION of sbt-native-packager

With this approach, I now have a better confidence around the changes I have made. Hopefully this turns out to be the case.

@fsat
Copy link
Collaborator Author

fsat commented Sep 11, 2015

//cc @muuki88 and @huntc

if [ -n "$RPM_INSTALL_PREFIX" ] ;
then
echo "PACKAGE_PREFIX=${RPM_INSTALL_PREFIX}" >> /etc/sysconfig/${{app_name}}
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Were these changes necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, without these changes the preinst script will fail and abort should the if condition turns out to be false.

Without rpmPrefix being specified, the [ -n "$RPM_INSTALL_PREFIX" ] will return false, and the preinst will abort with a failure.

@huntc
Copy link
Contributor

huntc commented Sep 11, 2015

One small comment, otherwise LGTM

@muuki88 muuki88 added the rpm label Sep 11, 2015
muuki88 added a commit that referenced this pull request Sep 11, 2015
Fixes for RPM related functionality in 1.0.5-M2
@muuki88 muuki88 merged commit 1f946ac into sbt:master Sep 11, 2015
@muuki88
Copy link
Contributor

muuki88 commented Sep 11, 2015

LGTM. Thanks :)

@muuki88
Copy link
Contributor

muuki88 commented Sep 11, 2015

Release in 1.0.5-M3

@huntc
Copy link
Contributor

huntc commented Sep 12, 2015

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants