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

Add "basic" OpenBSD support #658

Closed
wants to merge 6 commits into from
Closed

Conversation

rtyler
Copy link

@rtyler rtyler commented Oct 21, 2016

This is a respin of #304

@rtyler rtyler added this to the 1.8.0 - Benson milestone Oct 21, 2016
@@ -13,7 +17,11 @@ def self.home_dir

# @return [String] Full path to the Jenkins user's plugin directory
def self.plugins_dir
return File.join(self.home_dir, 'plugins')
if Facter.value(:osfamily) == 'OpenBSD'
Copy link
Author

Choose a reason for hiding this comment

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

In digging into these test errors, I have discovered that this use of Facter causes issues with how the tests are currently written.

Basically Facter uses File#directory? which is mocked out entirely

I believe the appropriate behavior is to also mock Facter#value with an expectation

buzzdeee and others added 6 commits November 1, 2016 13:09
Jenkins installed via the jenkins package is a bit different
on OpenBSD than on other Linux that were supported so far.

Major differences:
  * jenkins system user/group is called _jenkins
  * jenkins users home directory is /var/jenkins, but the
    state and everything related to Jenkins is stored under
    /var/jenkins/.jenkins, i.e. /var/jenkins/.jenksin/plugins

Therefore following changes:
  lib/puppet/jenkins.rb
   * figure out the jenkins home_dir based on the _jenkins user
   * point the plugins_dir to $home_dir/.jenkins/plugins
  lib/puppet/jenkins/facts.rb
   * confine the jenkins_plugins fact to OpenBSD too
  manifests/init.pp
   * add a service_flags parameter, to hand over flags for the
     jenkins service
   * while there, remove some redundant documentation of user/group
     parameters
  manifests/params.pp
   * make $user, $group, and $localstatedir dependent on ::osfamily
   * add a $jarbin variable, pointing to the Java jar binary, for
     all but OpenBSD, use the short name: 'jar', for OpenBSD, default
     to the full path where it can be found, overridable via
     parameter to init.pp
   * similarily to the $jarbin, add a $javabin variable and use it
  manifests/repo.pp
   * add an empty case for OpenBSD, no special handling required
     jenkins package is in default repos available
  manifests/service.pp
   * add a special case for OpenBSD to manage the service.
     This is necessary, because I've seen with other puppet modules,
     supporting older puppet versions, that the service_flags parameter
     might not be understood when it is given.
  manifests/cli/config.pp
   * do not hardcode the jenkins user and group
   * use the $::jenkins::jarbin variable, in order to find the Java
     jar binary
  manifests/cli.pp
   * make use of the $javabin variable instead of hardcoding the java
     binary
  manifests/cli_helper.pp
   * make use of the $javabin variable instead of hardcoding the java
     binary
  specs/*
   * rearrange/add some specs to handle tests for OpenBSD

Add javabin parameter, and use it where java binary is used
of the cli tools that take info from the config_hash to find the
jenkins port

Fixup localstatedir for OpenBSD, point to .jenkins subdir

rubocop pleasings
…t in Jenkins::Plugins

This is required since Facter#value is going to ultimately start using the File
module to dig through the directory structure on disk looking for facts. With
the OpenBSD support this is suddenly a problem as we weren't previously looking
up facts within these unit tests

See also: <https://github.com/jenkinsci/puppet-jenkins/pull/658/files#r85852243>
@rtyler
Copy link
Author

rtyler commented Sep 8, 2018

Closing this out, I'm not interested in reviving this yet again 😸

@rtyler rtyler closed this Sep 8, 2018
@rtyler rtyler deleted the 304-openbsd branch September 8, 2018 15:56
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.

None yet

2 participants