Skip to content

Commit

Permalink
Update source install versions
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Webb <dan.webb@damacus.io>
  • Loading branch information
damacus committed Jan 30, 2024
1 parent 3a21015 commit 855df6b
Show file tree
Hide file tree
Showing 22 changed files with 86 additions and 79 deletions.
53 changes: 22 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,36 +32,26 @@ jobs:
- "centos-stream-8"
- "fedora-latest"
suite:
- config-1-userlist
- config-1
- config-2
- config-3
- config-4
- config-acl
- config-array
- config-backend-search
- config-custom-template
- config-fastcgi
- config-resolver
- config-ssl-redirect
- "package"
- "source-18"
- "source-20"
- "source-22"
- "source-default"
- "source-24"
- "source-26"
- "source-28"
- "source-29"
- "source-lua"
- "source-openssl"
exclude:
# Excluded due to https://github.com/sous-chefs/haproxy/issues/475
- os: "fedora-latest"
suite: "source-18"
- os: "fedora-latest"
suite: "source-20"
- os: "fedora-latest"
suite: "source-22"
- os: "fedora-latest"
suite: "source-default"
- os: "fedora-latest"
suite: "source-openssl"
- os: "ubuntu-2204"
suite: "source-18"
- os: "ubuntu-2204"
suite: "source-20"
- os: "ubuntu-2204"
suite: "source-22"
- os: "ubuntu-2204"
suite: "source-24"
- os: "ubuntu-2204"
suite: "source-default"
- os: "ubuntu-2204"
suite: "source-openssl"
- "source-default"
fail-fast: false

steps:
Expand All @@ -87,9 +77,10 @@ jobs:
- "amazonlinux-2"
suite:
- "package"
- "source-18"
- "source-20"
- "source-22"
- "source-24"
- "source-26"
- "source-28"
- "source-29"
- "source-default"
fail-fast: false

Expand Down
Empty file added .rubocop.yml
Empty file.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ This file is used to list changes made in each version of the haproxy cookbook.

## Unreleased

- Update default HAProxy source install verision to 2.8.5
- Update source install tests to include versions 2.4, 2.6, 2.8, 2.9

## 12.2.23 - *2023-10-26*

## 12.2.22 - *2023-09-28*
Expand Down
2 changes: 1 addition & 1 deletion Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if !git.modified_files.include?('CHANGELOG.md') && code_changes?
end

# Require Major Minor Patch version labels
unless github.pr_labels.grep /minor|major|patch/i
unless github.pr_labels.grep(/minor|major|patch/i)
warn 'Please add a release label to this pull request'
end

Expand Down
10 changes: 5 additions & 5 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
require 'cookstyle'
require "cookstyle"

guard :rubocop, keep_failed: false, cli: '-r finstyle' do
guard :rubocop, keep_failed: false, cli: "-r finstyle" do
watch(/.+\.rb$/) { |m| m[0] }
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
end

guard 'foodcritic', cookbook_paths: '.', cli: '-C -t ~FC001' do
guard "foodcritic", cookbook_paths: ".", cli: "-C -t ~FC001" do
watch(%r{attributes/.+\.rb$})
watch(%r{providers/.+\.rb$})
watch(%r{recipes/.+\.rb$})
watch(%r{resources/.+\.rb$})
end

spec_path = 'test/unit'
spec_path = "test/unit"
rspec_guard_config = {
cmd: "bundle exec rspec --color --format progress --default-path=#{spec_path}",
all_on_start: true,
spec_paths: [spec_path],
}

guard 'rspec', rspec_guard_config do
guard "rspec", rspec_guard_config do
watch(%r{^#{spec_path}/.+_spec\.rb$})
watch("#{spec_path}/spec_helper.rb") { spec_path }
watch(%r{^(libraries|providers|recipes|resources)/(.+)\.rb$}) do |m|
Expand Down
21 changes: 10 additions & 11 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ platforms:
- name: centos-7
- name: centos-8
- name: centos-stream-8
- name: debian-9
- name: debian-10
- name: debian-11
- name: debian-12
- name: ubuntu-20.04
- name: ubuntu-22.04
- name: fedora-latest
Expand All @@ -30,19 +29,19 @@ suites:
- name: package
run_list:
- recipe[test::package]
- name: source-1.8
- name: source-2.4
run_list:
- recipe[test::source-18]
- name: source-2.0
- recipe[test::source_24]
- name: source_2.6
run_list:
- recipe[test::source-20]
- name: source-2.2
- recipe[test::source_26]
- name: source_2.8
run_list:
- recipe[test::source-22]
- name: source-2.4
- recipe[test::source_28]
- name: source_2.9
run_list:
- recipe[test::source-24]
- name: source-default
- recipe[test::source_29]
- name: source_default
run_list:
- recipe[test::source]
- name: source_lua
Expand Down
10 changes: 5 additions & 5 deletions resources/config_global.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

property :stats, Hash,
default: lazy {
{
socket: "/var/run/haproxy.sock user #{user} group #{group}",
timeout: '2m',
}
},
{
socket: "/var/run/haproxy.sock user #{user} group #{group}",
timeout: '2m',
}
},
description: 'Enable stats with various options'

property :maxconn, [Integer, String],
Expand Down
4 changes: 2 additions & 2 deletions resources/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@

# Source
property :source_version, String,
default: '2.2.4'
default: '2.8.5'

property :source_url, String,
default: lazy { "https://www.haproxy.org/download/#{source_version.to_f}/src/haproxy-#{source_version}.tar.gz" }

property :source_checksum, String,
default: '87a4d9d4ff8dc3094cb61bbed4a8eed2c40b5ac47b9604daebaf036d7b541be2'
default: '3f5459c5a58e0b343a32eaef7ed5bed9d3fc29d8aa9e14b36c92c969fc2a60d9'

property :source_target_cpu, String,
default: lazy { node['kernel']['machine'] }
Expand Down
3 changes: 2 additions & 1 deletion test/cookbooks/test/recipes/config_array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
'redirect' => [
'prefix http://www.bar.com code 301 if { hdr(host) -i foo.com }',
'prefix http://www.bar.com code 301 if { hdr(host) -i www.foo.com }',
])
]
)
default_backend 'servers'
end

Expand Down
4 changes: 2 additions & 2 deletions test/cookbooks/test/recipes/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

haproxy_install 'source'

haproxy_config_global ''
haproxy_config_global

haproxy_config_defaults ''
haproxy_config_defaults

haproxy_service 'haproxy' do
action %i(create enable start)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apt_update
version '2.4.25'

haproxy_install 'source' do
source_url 'http://www.haproxy.org/download/2.4/src/haproxy-2.4.0.tar.gz'
source_checksum '0a6962adaf5a1291db87e3eb4ddf906a72fed535dbd2255b164b7d8394a53640'
source_version '2.4.0'
source_url "https://www.haproxy.org/download/#{version.to_f}/src/haproxy-#{version}.tar.gz"
source_checksum '44b035bdc9ffd4935f5292c2dfd4a1596c048dc59c5b25a0c6d7689d64f50b99'
source_version version
use_libcrypt true
use_pcre true
use_openssl true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apt_update
version = '2.6.16'

haproxy_install 'source' do
source_url 'http://www.haproxy.org/download/1.8/src/haproxy-1.8.17.tar.gz'
source_checksum '7b789b177875afdd5ddeff058e7efde73aa895dc2dcf728b464358635ae3948e'
source_version '1.8.17'
source_url "https://www.haproxy.org/download/#{version.to_f}/src/haproxy-#{version}.tar.gz"
source_checksum 'faac6f9564caf6e106fe22c77a1fb35406afc8cd484c35c2c844aaf0d7a097fb'
source_version version
use_libcrypt true
use_pcre true
use_openssl true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apt_update
version = '2.8.5'

haproxy_install 'source' do
source_url 'https://www.haproxy.org/download/2.0/src/haproxy-2.0.12.tar.gz'
source_checksum '7fcf5adb21cd78c4161902f9fcc8d7fc97e1562319a992cbda884436ca9602fd'
source_version '2.0.12'
source_url "https://www.haproxy.org/download/#{version.to_f}/src/haproxy-#{version}.tar.gz"
source_checksum '3f5459c5a58e0b343a32eaef7ed5bed9d3fc29d8aa9e14b36c92c969fc2a60d9'
source_version version
use_libcrypt true
use_pcre true
use_openssl true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apt_update
version = '2.9.3'

haproxy_install 'source' do
source_url 'http://www.haproxy.org/download/2.2/src/haproxy-2.2.14.tar.gz'
source_checksum '6a9b702f04b07786f3e5878de8172a727acfdfdbc1cefe1c7a438df372f2fb61'
source_version '2.2.14'
source_url "https://www.haproxy.org/download/#{version.to_f}/src/haproxy-#{version}.tar.gz"
source_checksum 'ed517c65abd86945411f6bcb18c7ec657a706931cb781ea283063ba0a75858c0'
source_version version
use_libcrypt true
use_pcre true
use_openssl true
Expand Down
2 changes: 1 addition & 1 deletion test/cookbooks/test/recipes/source_openssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
# install haproxy with openssl
haproxy_install 'source' do
source_url 'http://www.haproxy.org/download/2.2/src/haproxy-2.2.4.tar.gz'
source_checksum '87a4d9d4ff8dc3094cb61bbed4a8eed2c40b5ac47b9604daebaf036d7b541be2'
source_checksum '3f5459c5a58e0b343a32eaef7ed5bed9d3fc29d8aa9e14b36c92c969fc2a60d9'
source_version '2.2.4'
use_openssl true
use_zlib true
Expand Down
2 changes: 1 addition & 1 deletion test/integration/config_4/example_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
' reqirep \^Host:\\\ www.mydomain.com Host:\\\ www',
' default_backend servers',
]
its('content') { should match /#{cfg_content.join('\n')}/ }
its('content') { should match(/#{cfg_content.join('\n')}/) }
end

describe service('haproxy') do
Expand Down
2 changes: 1 addition & 1 deletion test/integration/source-2.4/source_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
end

describe command('haproxy -vv') do
its('stdout') { should match /Built with the Prometheus exporter as a service/ }
its('stdout') { should match(/Built with the Prometheus exporter as a service/) }
end
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions test/integration/source_2.9/source_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
describe directory '/etc/haproxy' do
it { should exist }
end

describe file '/etc/haproxy/haproxy.cfg' do
its(:mode) { should cmp '0640' }
end

describe service 'haproxy' do
it { should be_installed }
it { should be_enabled }
it { should be_running }
end
2 changes: 1 addition & 1 deletion test/integration/source_lua/lua_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
end

describe command('haproxy -vv | grep Lua') do
its('stdout') { should match /Built with Lua version/ }
its('stdout') { should match(/Built with Lua version/) }
end
2 changes: 1 addition & 1 deletion test/integration/source_openssl/openssl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
end

describe command('haproxy -vv | grep "OpenSSL 1.1.1h"') do
its('stdout') { should match /OpenSSL version : OpenSSL 1.1.1h 22 Sep 2020/ }
its('stdout') { should match(/OpenSSL version : OpenSSL 1.1.1h 22 Sep 2020/) }
end

0 comments on commit 855df6b

Please sign in to comment.