This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from codenamephp/resources
Recreating recipes as resources
- Loading branch information
Showing
24 changed files
with
304 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Rubocop", | ||
"type": "shell", | ||
"command": "rubocop -a", | ||
"group": "test" | ||
}, | ||
{ | ||
"label": "Foodcritic", | ||
"type": "shell", | ||
"command": "foodcritic .", | ||
"group": "test" | ||
}, | ||
{ | ||
"label": "RSpec", | ||
"type": "shell", | ||
"command": "rspec", | ||
"group": "test" | ||
}, | ||
{ | ||
"label": "Kitchen Test", | ||
"type": "shell", | ||
"command": "kitchen test" | ||
}, | ||
{ | ||
"label": "Lint", | ||
"dependsOn": [ | ||
"Rubocop", | ||
"Foodcritic" | ||
], | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Unit", | ||
"dependsOn": [ | ||
"RSpec" | ||
] | ||
}, | ||
{ | ||
"label": "Integration", | ||
"dependsOn": [ | ||
"Kitchen Test" | ||
] | ||
}, | ||
{ | ||
"label": "All", | ||
"dependsOn": [ | ||
"Lint", | ||
"Unit", | ||
"Integration" | ||
], | ||
"problemMatcher": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# 3.0 | ||
|
||
The recipes have been removed. Create a wrapper cookbook and use the resource there as needed. The service recipe was replaced by | ||
the `codenamephp_docker_service` resource that does exactly the same as the recipe did. For docker-compose there is the | ||
`codenamephp_docker_compose` resource |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,8 @@ | |
maintainer_email '[email protected]' | ||
license 'Apache-2.0' | ||
description 'Installs/Configures codenamephp_docker' | ||
version '2.0.0' | ||
chef_version '>= 13.0' if respond_to?(:chef_version) | ||
version '3.0.0' | ||
chef_version '>= 13.0' | ||
issues_url 'https://github.com/codenamephp/chef.cookbook.docker/issues' | ||
source_url 'https://github.com/codenamephp/chef.cookbook.docker' | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# frozen_string_literal: true | ||
|
||
property :version, String, default: 'latest', description: 'The version of docker-compose to install, defaults to "latest"' | ||
|
||
action :install do | ||
remote_file 'download docker-compose' do | ||
source compose_url | ||
path '/usr/local/bin/docker-compose' | ||
owner 'root' | ||
group 'root' | ||
mode '0755' | ||
action :create | ||
end | ||
|
||
directory 'create bash completion directory' do | ||
path '/etc/bash_completion.d' | ||
owner 'root' | ||
group 'root' | ||
mode '0755' | ||
recursive true | ||
action :create | ||
end | ||
|
||
remote_file 'download bash completion' do | ||
source lazy { compose_bash_completion_url } | ||
path '/etc/bash_completion.d/docker-compose' | ||
owner 'root' | ||
group 'root' | ||
mode '0755' | ||
action :create | ||
end | ||
end | ||
|
||
action_class do | ||
def compose_url | ||
distro = Mixlib::ShellOut.new('uname -s').run_command.stdout.strip | ||
arch = Mixlib::ShellOut.new('uname -m').run_command.stdout.strip | ||
file = "docker-compose-#{distro}-#{arch}" | ||
|
||
new_resource.version == 'latest' ? "https://github.com/docker/compose/releases/latest/download/#{file}" : "https://github.com/docker/compose/releases/download/#{new_resource.version}/#{file}" | ||
end | ||
|
||
def compose_bash_completion_url | ||
version = Mixlib::ShellOut.new("docker-compose -v | grep version | awk -F'[ ,]+' '{print $3}'").run_command.stdout.strip | ||
"https://raw.githubusercontent.com/docker/compose/#{version}/contrib/completion/bash/docker-compose" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
action :install do | ||
docker_service 'default' do | ||
action %i[create start] | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.