Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@ jobs:
strategy:
matrix:
os:
- "ubuntu-2004"
- "almalinux-8"
- "almalinux-9"
- "amazonlinux-2023"
- "centos-stream-9"
- "debian-12"
- "fedora-latest"
- "rockylinux-8"
- "rockylinux-9"
- "ubuntu-2204"
- "ubuntu-2404"
suite:
- "default"
fail-fast: false
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
name: release

"on":
push:
branches:
- main
branches: [main]

permissions:
contents: write
Expand All @@ -16,8 +14,10 @@ permissions:

jobs:
release:
uses: sous-chefs/.github/.github/workflows/release-cookbook.yml@5.0.8
uses: sous-chefs/.github/.github/workflows/release-cookbook.yml@main
secrets:
token: ${{ secrets.PORTER_GITHUB_TOKEN }}
supermarket_user: ${{ secrets.CHEF_SUPERMARKET_USER }}
supermarket_key: ${{ secrets.CHEF_SUPERMARKET_KEY }}
slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
slack_channel_id: ${{ secrets.SLACK_CHANNEL_ID }}
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require:
- cookstyle
59 changes: 2 additions & 57 deletions kitchen.dokken.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,11 @@ platforms:
image: dokken/amazonlinux-2023
pid_one_command: /usr/lib/systemd/systemd

- name: centos-7
driver:
image: dokken/centos-7
pid_one_command: /usr/lib/systemd/systemd

- name: centos-stream-8
driver:
image: dokken/centos-stream-8
pid_one_command: /usr/lib/systemd/systemd

- name: centos-stream-9
driver:
image: dokken/centos-stream-9
pid_one_command: /usr/lib/systemd/systemd

- name: debian-9
driver:
image: dokken/debian-9
pid_one_command: /bin/systemd

- name: debian-10
driver:
image: dokken/debian-10
pid_one_command: /bin/systemd

- name: debian-11
driver:
image: dokken/debian-11
pid_one_command: /bin/systemd

- name: debian-12
driver:
image: dokken/debian-12
Expand All @@ -62,26 +37,6 @@ platforms:
image: dokken/fedora-latest
pid_one_command: /usr/lib/systemd/systemd

- name: opensuse-leap-15
driver:
image: dokken/opensuse-leap-15
pid_one_command: /usr/lib/systemd/systemd

- name: oraclelinux-7
driver:
image: dokken/oraclelinux-7
pid_one_command: /usr/lib/systemd/systemd

- name: oraclelinux-8
driver:
image: dokken/oraclelinux-8
pid_one_command: /usr/lib/systemd/systemd

- name: oraclelinux-9
driver:
image: dokken/oraclelinux-9
pid_one_command: /usr/lib/systemd/systemd

- name: rockylinux-8
driver:
image: dokken/rockylinux-8
Expand All @@ -92,22 +47,12 @@ platforms:
image: dokken/rockylinux-9
pid_one_command: /usr/lib/systemd/systemd

- name: ubuntu-18.04
driver:
image: dokken/ubuntu-18.04
pid_one_command: /bin/systemd

- name: ubuntu-20.04
driver:
image: dokken/ubuntu-20.04
pid_one_command: /bin/systemd

- name: ubuntu-22.04
driver:
image: dokken/ubuntu-22.04
pid_one_command: /bin/systemd

- name: ubuntu-23.04
- name: ubuntu-24.04
driver:
image: dokken/ubuntu-23.04
image: dokken/ubuntu-24.04
pid_one_command: /bin/systemd
7 changes: 6 additions & 1 deletion kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ verifier:
name: inspec

platforms:
- name: ubuntu-20.04
- name: almalinux-8
- name: almalinux-9
- name: amazonlinux-2023
- name: debian-12
- name: ubuntu-22.04
- name: ubuntu-24.04

suites:
- name: default
Expand Down
2 changes: 2 additions & 0 deletions libraries/github_archive.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'open-uri'
require 'uri'
require 'fileutils'
Expand Down
2 changes: 2 additions & 0 deletions libraries/github_asset.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'net/http'
require 'open-uri'
require 'uri'
Expand Down
2 changes: 2 additions & 0 deletions libraries/github_errors.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module GithubCB
class GHError < StandardError; end

Expand Down
2 changes: 2 additions & 0 deletions resources/archive.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

unified_mode true

default_action :extract
Expand Down
2 changes: 2 additions & 0 deletions resources/asset.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

unified_mode true

default_action :download
Expand Down
2 changes: 2 additions & 0 deletions resources/deploy.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

unified_mode true

default_action :deploy
Expand Down
2 changes: 2 additions & 0 deletions spec/libraries/github_archive_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# require 'spec_helper'
#
# describe GithubCB::Archive do
Expand Down
23 changes: 23 additions & 0 deletions spec/resources/deploy_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'github_deploy' do
step_into :github_deploy
platform 'ubuntu', '22.04'

context 'deploy action' do
recipe do
github_deploy 'sous-chefs/test-repo' do
version 'v1.0.0'
path '/opt/deployments/test-repo'
owner 'deploy'
group 'deploy'
end
end

it { is_expected.to create_directory('/opt/deployments/test-repo/releases') }
it { is_expected.to create_directory('/opt/deployments/test-repo/shared') }
it { is_expected.to create_link('/opt/deployments/test-repo/current') }
end
end
49 changes: 12 additions & 37 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,37 +1,12 @@
# require 'rubygems'
# require 'bundler'
# require 'rspec'
# require 'spork'
# require 'chef'
#
# Spork.prefork do
# Dir[File.join(File.expand_path('../spec/support/**/*.rb', __dir__))].each { |f| require f }
#
# RSpec.configure do |config|
# config.expect_with :rspec do |c|
# c.syntax = :expect
# end
#
# config.mock_with :rspec
# config.treat_symbols_as_metadata_keys_with_true_values = true
# config.filter_run focus: true
# config.run_all_when_everything_filtered = true
#
# config.before(:each) do
# Chef::Config[:file_cache_path] = File.join(tmp_path, 'chef_cache')
# FileUtils.rm_rf(tmp_path)
# FileUtils.mkdir_p(tmp_path)
# FileUtils.mkdir_p(Chef::Config[:file_cache_path])
# end
# end
#
# def tmp_path
# File.expand_path(File.join(File.dirname(__FILE__), '../tmp'))
# end
# end
#
# Spork.each_run do
# Dir["#{File.expand_path('..', File.dirname(__FILE__))}/libraries/*.rb"].sort.each do |path|
# require_relative "../libraries/#{File.basename(path, '.rb')}"
# end
# end
# frozen_string_literal: true

require 'chefspec'
require 'chefspec/berkshelf'

RSpec.configure do |config|
config.color = true
config.formatter = :documentation
config.log_level = :warn
config.platform = 'ubuntu'
config.version = '22.04'
end
2 changes: 2 additions & 0 deletions test/fixtures/cookbooks/test/metadata.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

name 'test'
maintainer 'Sous Chefs'
maintainer_email 'help@sous-chefs.org'
Expand Down
4 changes: 4 additions & 0 deletions test/fixtures/cookbooks/test/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
apt_update

# frozen_string_literal: true

github_asset 'Precompiled.zip' do
repo 'elixir-lang/elixir'
release 'v1.12.2'
Expand Down
2 changes: 2 additions & 0 deletions test/integration/default/controls/default.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

cache_dir = inspec.file('/opt/kitchen').exist? ? '/opt/kitchen/cache' : '/tmp/kitchen/cache'

control 'github-cookbook' do
Expand Down
Loading