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

Changing default to stable, adding channel toggle #575

Merged
merged 3 commits into from Mar 8, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .delivery/project.toml
@@ -0,0 +1 @@
remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml"
File renamed without changes.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -31,7 +31,7 @@ before_script:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- eval "$(/opt/chefdk/bin/chef shell-init bash)"

script: KITCHEN_LOCAL_YAML=.kitchen.docker.yml /opt/chefdk/embedded/bin/kitchen verify ${INSTANCE}
script: KITCHEN_LOCAL_YAML=.kitchen.dokken.yml /opt/chefdk/embedded/bin/kitchen verify ${INSTANCE}

matrix:
include:
Expand All @@ -41,5 +41,5 @@ matrix:
- /opt/chefdk/embedded/bin/cookstyle --version
- /opt/chefdk/embedded/bin/foodcritic --version
- script:
- /opt/chefdk/bin/chef exec rake
- /opt/chefdk/bin/chef exec delivery local all
env: UNIT_AND_LINT=1
22 changes: 15 additions & 7 deletions attributes/master.rb
Expand Up @@ -44,6 +44,12 @@
#
master['version'] = nil

#
# The "channel" to use, default is stable
# Alternatively: "latest"
#
master['channel'] = 'stable'

#
# The mirror to donload the Jenkins war file. This attribute is only used
# in the "war" installation method.
Expand All @@ -70,7 +76,9 @@
# Warning: Setting this attribute will negate/ignore any values for +mirror+
# and +version+.
#
master['source'] = "#{node['jenkins']['master']['mirror']}/#{node['jenkins']['master']['version'] || 'current'}/latest/jenkins.war"
master['source'] = "#{node['jenkins']['master']['mirror']}/"\
"#{node['jenkins']['master']['version'] || node['jenkins']['master']['channel']}/"\
'latest/jenkins.war'

#
# The checksum of the war file. This is use to verify that the remote war file
Expand Down Expand Up @@ -214,19 +222,19 @@
master['ulimits'] = nil

#
# Repository URL. Default is latest
# Repository URL. Default is stable
#
master['repository'] = case node['platform_family']
when 'debian' then 'https://pkg.jenkins.io/debian'
when 'rhel' then 'https://pkg.jenkins.io/redhat'
when 'debian' then 'https://pkg.jenkins.io/debian-stable'
when 'rhel' then 'https://pkg.jenkins.io/redhat-stable'
end

#
# Repository key. Default is latest
# Repository key. Default is stable
#
master['repository_key'] = case node['platform_family']
when 'debian' then 'https://pkg.jenkins.io/debian/jenkins.io.key'
when 'rhel' then 'https://pkg.jenkins.io/redhat/jenkins.io.key'
when 'debian' then 'https://pkg.jenkins.io/debian-stable/jenkins.io.key'
when 'rhel' then 'https://pkg.jenkins.io/redhat-stable/jenkins.io.key'
end

#
Expand Down
2 changes: 1 addition & 1 deletion libraries/_helper.rb
Expand Up @@ -448,7 +448,7 @@ def ensure_cli_present!
#
def ensure_update_center_present!
node.run_state[:jenkins_update_center_present] ||= begin # ~FC001
source = uri_join(node['jenkins']['master']['mirror'], 'current', 'update-center.json')
source = uri_join(node['jenkins']['master']['mirror'], node['jenkins']['master']['channel'], 'update-center.json')
remote_file = Chef::Resource::RemoteFile.new(update_center_json, run_context)
remote_file.source(source)
remote_file.backup(false)
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/cookbooks/jenkins_user/metadata.rb
@@ -1,2 +1,2 @@
name 'jenkins_user'
depends 'jenkins'
depends 'jenkins_server_wrapper'
Expand Up @@ -2,6 +2,7 @@

describe service('jenkins') do
it 'cannot have a reliably tested command' do
pending
pending('cannot have a reliably tested command')
raise
end
end