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

application_static (2) Versions 0.3.0

Installs/Configures application_static

Berkshelf/Librarian
Policyfile
Knife
cookbook 'application_static', '~> 0.3.0'
cookbook 'application_static', '~> 0.3.0', :supermarket
knife cookbook site install application_static
knife cookbook site download application_static
README
Dependencies
Changelog
Quality

application_static cookbook

supermarket: https://supermarket.getchef.com/cookbooks/application_static
github: https://github.com/allnightlong/application_static

This is the simple chef cookbook to quick host static web sites with nginx. Based on excellent application cookbook, which is only providing LWRPs, this cookbook actually has recipe.

So after defining it with Berkshelf/Librarian, you have to provide as minimal config as possible, to make your sites working.

config

Let's imagine you have several static websites, you want to host, each in it's own repository:

example1.com -> github.com/my-account/example1.com
example2.com -> bitbucket.org/my-account/example2.com
...

To get them running, you should do 3 steps.

1. Adding cookbook

First thing to do, is adding application_static cookbook to your chef installation.
Berkshelf example:

cookbook "application_static"

2. Create role

Then create appropriate role:

{
  "name": "static_sites",
  "override_attributes": {
    "nginx": {
      "default_site_enabled": false,
      "install_method": "repo"
    },
    "application_static": {
      "apps": [
        {
          "name": "example1.com",
          "url": "git@github.com:my-account/example1.com.git",
          "enabled": true
        },
        {
          "name": "example2.com",
          "url": "git@bitbucket.org:my-account/example2.com.git",
          "enabled": true
        }
      ],
      "deploy_key" : "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEA38rGcWTe5Iux2MtIgmbl08P0f3KZfJBCIvKES9oFFglqAbI7\n...........\n5qJkpABldGtXpWxrllpFvWDGSWdv8WYJW308dXIp2C5LjE3saTuhBTgain7GDs6P\np5lXlrB0zUGU92likbgEvIFN0lzkpYt02ccxTCCU6bIa9pTI3IBK\n-----END RSA PRIVATE KEY-----"
    }
  },
  "run_list": [
    "recipe[nginx]",
    "recipe[application_static]"
  ]
}

Note, that you shouldn't really store private key in role file, in favor of databags or even better encrypted databags.
Also, if you getting troubles with multiline private key, use this tip.

3. Apply role

knife node run_list add NODE_NAME role[static_sites]

That's basically it. After adding this role to node's run-list, your sites should be up and running.
This cookbook was tested on Ubuntu 14.04 LTS, but there is nothing os/platform/version specific, so it should work on any environment.
Pull-requests are very warm welcome.

Dependent cookbooks

nginx >= 0.0.0
application >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

application_static changelog

0.3.0 (26.11.2014)

  • Hide .git folder and .gitignore file from nginx index.
  • Explicitly specify tested os (ubuntu).
  • README updates
  • CHANGELOG file

0.2.0 (25.11.2014)

Initial release.

Collaborator Number Metric
            

0.3.0 failed this metric

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

Contributing File Metric
            

0.3.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 http://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

0.3.0 failed this metric

FC052: Metadata uses the unimplemented "suggests" keyword: application_static/metadata.rb:13
FC064: Ensure issues_url is set in metadata: application_static/metadata.rb:1
FC065: Ensure source_url is set in metadata: application_static/metadata.rb:1
FC066: Ensure chef_version is set in metadata: application_static/metadata.rb:1
FC069: Ensure standardized license defined in metadata: application_static/metadata.rb:1
Run with Foodcritic Version 10.3.1 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric
            

0.3.0 passed this metric

No Binaries Metric
            

0.3.0 passed this metric

Publish Metric
            

0.3.0 passed this metric

Supported Platforms Metric
            

0.3.0 passed this metric

Testing File Metric
            

0.3.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 http://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

0.3.0 passed this metric