Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

hudson (2) Versions 0.3.0

Installs and configures Hudson CI server & slaves

Policyfile
Berkshelf
Knife
cookbook 'hudson', '~> 0.3.0', :supermarket
cookbook 'hudson', '~> 0.3.0'
knife supermarket install hudson
knife supermarket download hudson
README
Dependencies
Quality 17%
= DESCRIPTION: Installs and configures Hudson CI server & node slaves. = REQUIREMENTS: == Platform: * 'default' - Currently supports Red Hat/CentOS 5.x. * 'node_ssh' - Any platform that is running sshd. * 'node_jnlp' - Unix platforms. * 'node_windows' - Windows platforms only. Depends on .NET Framework, which can be installed with the windows::dotnetfx recipe. == Java: Hudson requires Java 1.5 or higher, which can be installed via the Opscode java cookbook or windows::java recipe. == Hudson node authentication: If your Hudson instance requires authentication, you'll either need to embed user:pass in the hudson.server.url or issue a hudson-cli.jar login command prior to using the hudson::node_* recipes. For example, define a role like so: name "hudson_ssh_node" description "cli login & register ssh slave with Hudson" run_list %w(vmw::hudson_login hudson::node_ssh) Where the hudson_login recipe is simply: hudson_cli "login --username #{node[:hudson][:username]} --password #{node[:hudson][:password]}" = ATTRIBUTES: * hudson[:mirror] - Base URL for downloading Hudson (server) * hudson[:java_home] - Java install path, used for for cli commands * hudson[:server][:home] - HUDSON_HOME directory * hudson[:server][:user] - User the Hudson server runs as * hudson[:server][:port] - TCP listen port for the Hudson server * hudson[:server][:url] - Base URL of the Hudson server * hudson[:server][:plugins] - Download the latest version of plugins in this list, bypassing update center * hudson[:node][:name] - Name of the node within Hudson * hudson[:node][:description] - Hudson node description * hudson[:node][:executors] - Number of node executors * hudson[:node][:home] - Home directory ("Remote FS root") of the node * hudson[:node][:labels] - Node labels * hudson[:node][:mode] - Node usage mode, "normal" or "exclusive" (tied jobs only) * hudson[:node][:launcher] - Node launch method, "jnlp", "ssh" or "command" * hudson[:node][:availability] - "always" keeps node on-line, "demand" off-lines when idle * hudson[:node][:in_demand_delay] - number of minutes for which jobs must be waiting in the queue before attempting to launch this slave. * hudson[:node][:idle_delay] - number of minutes that this slave must remain idle before taking it off-line. * hudson[:node][:env] - "Node Properties" -> "Environment Variables" * hudson[:node][:user] - user the slave runs as * hudson[:node][:ssh_host] - Hostname or IP Hudson should connect to when launching an SSH slave * hudson[:node][:ssh_port] - SSH slave port * hudson[:node][:ssh_user] - SSH slave user name (only required if hudson server and slave user is different) * hudson[:node][:ssh_pass] - SSH slave password (not required when server is installed via default recipe) * hudson[:node][:ssh_private_key] - hudson master defaults to: `~/.ssh/id_rsa` (created by the default recipe) * hudson[:node][:jvm_options] - SSH slave JVM options = USAGE: == 'default' recipe Installs a Hudson CI server using the http://hudson-ci.org/redhat RPM. The recipe also generates an ssh private key and stores the ssh public key in the node 'hudson[:pubkey]' attribute for use by the node recipes. == 'node_ssh' recipe Creates the user and group for the Hudson slave to run as and sets `.ssh/authorized_keys` to the 'hudson[:pubkey]' attribute. The 'hudson-cli.jar'[1] is downloaded from the Hudson server and used to manage the nodes via the 'groovy'[2] cli command. Hudson is configured to launch a slave agent on the node using its SSH slave plugin[3]. [1] http://wiki.hudson-ci.org/display/HUDSON/Hudson+CLI [2] http://wiki.hudson-ci.org/display/HUDSON/Hudson+Script+Console [3] http://wiki.hudson-ci.org/display/HUDSON/SSH+Slaves+plugin == 'node_jnlp' recipe Creates the user and group for the Hudson slave to run as and '/jnlpJars/slave.jar' is downloaded from the Hudson server. TODO: runit_service or similar to launch the slave. == 'node_windows' recipe Creates the home directory for the node slave and sets 'HUDSON_HOME' and 'HUDSON_URL' system environment variables. The 'winsw'[1] Windows service wrapper will be downloaded and installed, along with generating `hudson-slave.xml` from a template. Hudson is configured with the node as a 'jnlp'[2] slave and '/jnlpJars/slave.jar' is downloaded from the Hudson server. The 'hudsonslave' service will be started the first time the recipe is run or if the service is not running. The 'hudsonslave' service will be restarted if '/jnlpJars/slave.jar' has changed. The end results is functionally the same had you chosen the option to "Let Hudson control this slave as a Windows service"[3]. [1] http://weblogs.java.net/blog/2008/09/29/winsw-windows-service-wrapper-less-restrictive-license [2] http://wiki.hudson-ci.org/display/HUDSON/Distributed+builds [3] http://wiki.hudson-ci.org/display/HUDSON/Installing+Hudson+as+a+Windows+service == 'hudson_cli' resource provider This resource can be used to execute the Hudson cli from your recipes. For example, install plugins via update center and restart Hudson: %w(git URLSCM build-publisher).each do |plugin| hudson_cli "install-plugin #{plugin}" hudson_cli "safe-restart" end == 'hudson_node' resource provider This resource can be used to configure nodes as the 'node_ssh' and 'node_windows' recipes do or "Launch slave via execution of command on the Master". hudson_node node[:fqdn] do description "My node for things, stuff and whatnot" executors 5 remote_fs "/var/hudson" launcher "command" command "ssh -i my_key #{node[:fqdn]} java -jar #{remote_fs}/slave.jar" env "ANT_HOME" => "/usr/local/ant", "M2_REPO" => "/dev/null" end == 'hudson_job' resource provider This resource manages hudson jobs, supporting the following actions: :create, :update, :delete, :build, :disable, :enable The 'create' and 'update' actions require a hudson job config.xml. Example: git_branch = 'master' job_name = "sigar-#{branch}-#{node[:os]}-#{node[:kernel][:machine]}" job_config = File.join(node[:hudson][:node][:home], "#{job_name}-config.xml") hudson_job job_name do action :nothing config job_config end template job_config do source "sigar-hudson-config.xml" variables :job_name => job_name, :branch => git_branch, :node => node[:fqdn] notifies :update, resources(:hudson_job => job_name), :immediately notifies :build, resources(:hudson_job => job_name), :immediately end == 'manage_node' library The script to generate groovy that manages a node can be used standalone. For example: % ruby manage_node.rb name slave-hostname remote_fs /home/hudson ... | java -jar hudson-cli.jar -s http://hudson:8080/ groovy = = ISSUES * CLI authentication - http://issues.hudson-ci.org/browse/HUDSON-3796 * CLI *-node commands fail with "No argument is allowed: nameofslave" - http://issues.hudson-ci.org/browse/HUDSON-5973 = LICENSE & AUTHOR: Author:: Doug MacEachern (<dougm@vmware.com>) Copyright:: 2010, VMware, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Collaborator Number Metric
            

0.3.0 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

0.3.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

0.3.0 failed this metric

FC018: LWRP uses deprecated notification syntax: hudson/providers/node.rb:56
FC021: Resource condition in provider may not behave as expected: hudson/providers/cli.rb:46
FC043: Prefer new notification syntax: hudson/recipes/default.rb:57
FC043: Prefer new notification syntax: hudson/recipes/node_jnlp.rb:47
FC043: Prefer new notification syntax: hudson/recipes/node_windows.rb:73
FC064: Ensure issues_url is set in metadata: hudson/metadata.rb:1
FC065: Ensure source_url is set in metadata: hudson/metadata.rb:1
FC066: Ensure chef_version is set in metadata: hudson/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: hudson/metadata.rb:1
FC069: Ensure standardized license defined in metadata: hudson/metadata.rb:1
FC074: LWRP should use DSL to define resource's default action: hudson/resources/cli.rb:1
FC074: LWRP should use DSL to define resource's default action: hudson/resources/execute.rb:1
FC074: LWRP should use DSL to define resource's default action: hudson/resources/job.rb:1
FC074: LWRP should use DSL to define resource's default action: hudson/resources/node.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

0.3.0 passed this metric

Testing File Metric
            

0.3.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

0.3.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number