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

RSS

phoenix (1) Versions 1.2.0

Installs and Configures Phoenix

Berkshelf/Librarian
Policyfile
Knife
cookbook 'phoenix', '~> 1.2.0'
cookbook 'phoenix', '~> 1.2.0', :supermarket
knife cookbook site install phoenix
knife cookbook site download phoenix
README
Dependencies
Quality

Phoenix Cookbook

A cookbook that performs a basic installation of the Phoenix Framework along with any missing dependencies.

Dependencies:

This cookbook has no direct external dependencies. It will install and configure any missing packages and dependencies. A stable and decently fast Internet connection is required.

Platforms:

The following platforms and versions are tested and supported using test-kitchen

  • CentOS 7.1

The following platform families are supported in the code.

  • Red Hat (RHEL)
  • Centos
  • Fedora

Usage

Using this cookbook is relatively straightforward. It is recommended to create a project or organization specific wrapper cookbook and add the desired recipes to the run list of a node, or create a role. Depending on your environment, you may have multiple roles that use different recipes from this cookbook. Adjust any attributes as desired. For example, to create a basic role:

{
    "name": "phoenix",
    "description": "Role to install the Phoenix Framework and its dependencies.",
    "chef_type": "role",
    "json_class": "Chef::Role",
    "default_attributes": {
    },
    "override_attributes": {
    },
    "run_list": [
        "recipe[phoenix::install_nodejs]", // optional for Phoenix
        "recipe[phoenix::install_erlang]",
        "recipe[phoenix::install_elixir]",
        "recipe[phoenix::install_phoenix]"
    ]
}

Example: chef-client local-mode

If you are using chef-client you can follow this example based on the role above:

Install Latest Chef

curl -L https://www.opscode.com/chef/install.sh | bash

Create a chef-repo (placed in the /root/ directory in this example) with the following structure and files:

chef-repo/
|-- cookbooks
|   `-- phoenix
|       |-- attributes
|       |-- recipes
|       |-- spec
|       `-- test
|-- nodes
|   `-- node_phoenix.json
|   
|-- roles
|   `-- role_phoenix.json
`-- client.rb

% cat chef-repo/nodes/node_phoenix.json { "name": "node_phoenix", "run_list": [ "role[role_phoenix]" ] }

% cat chef-repo/roles/role_phoenix.json { "name": "phoenix", "description": "Role to install the Phoenix Framework and its dependencies.", "chef_type": "role", "json_class": "Chef::Role", "default_attributes": { }, "override_attributes": { }, "run_list": [ "recipe[phoenix::install_nodejs]", // optional for Phoenix "recipe[phoenix::install_erlang]", "recipe[phoenix::install_elixir]", "recipe[phoenix::install_phoenix]" ] }

% cat chef-repo/client.rb cookbook_path "/root/chef-repo/cookbooks" role_path '/root/chef-repo/roles' data_bag_path '/root/chef-repo/data_bags' environment_path '/root/chef-repo/environments' encrypted_data_bag_secret '/etc/chef' local_mode 'true' node_name 'node' node_path '/root/chef-repo/nodes' log_level :info

Now we can run our node/role using chef-client local mode (chef-zero):

chef-client -z -c client.rb -j nodes/node_phoenix.json

Attributes

This cookbook has attributes for a basic installation of the Phoenix Framework and dependencies. It should all be relatively straight-forward to override if different versions are desired.

Recipes

The recipes included; install_erlang and install_elixir are dependencies required unless it is known that the environment already has these requirements installed properly. The recipe install_phoenix uses Elixir to install Hex and finally Phoenix itself.

install_nodejs

Installs latest stable build, handles its own dependencies and can be run with or without the other recipes.

install_erlang

This recipe compiles the Erlang language from source. Installs its own required packages.

install_elixir

This recipe compiles the Elixir language from source. Requires that the system have Erlang installed.

install_phoenix

Installs Phoenix framework using Hex. Requires Elixir and Erlang be installed.

Tests

This cookbook in the source repository contains chefspec, serverspec tests.

License and Authors

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
            

1.2.0 failed this metric

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

Contributing File Metric
            

1.2.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
            

1.2.0 failed this metric

FC066: Ensure chef_version is set in metadata: phoenix/metadata.rb:1
FC069: Ensure standardized license defined in metadata: phoenix/metadata.rb:1
Run with Foodcritic Version 11.1.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric
            

1.2.0 failed this metric

phoenix does not have a valid open source license.
Acceptable licenses include Apache-2.0, apachev2, Apache 2.0, MIT, mit, GPL-2.0, gplv2, GNU Public License 2.0, GPL-3.0, gplv3, GNU Public License 3.0.

No Binaries Metric
            

1.2.0 passed this metric

Publish Metric
            

1.2.0 passed this metric

Supported Platforms Metric
            

1.2.0 passed this metric

Testing File Metric
            

1.2.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
            

1.2.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