Skip to content

Instantly share code, notes, and snippets.

@larrytheliquid
Created September 16, 2009 23:57
Show Gist options
  • Save larrytheliquid/188248 to your computer and use it in GitHub Desktop.
Save larrytheliquid/188248 to your computer and use it in GitHub Desktop.
Scenario Outline: filesystem setup
Then the <path> <type> exists
And the owner of <path> is the <user> user
And the group of <path> is the group of the <user> user
And the permissions for <path> are <permissions>
Scenarios: configuration
| type | permissions | user | path |
| file | 0644 | customer's | /data/nginx/nginx.conf |
| directory | 0775 | customer's | /data/nginx/ssl |
| directory | 0755 | customer's | /data/nginx/common |
| file | 0644 | customer's | /data/nginx/common/proxy.conf |
| file | 0644 | customer's | /data/nginx/common/servers.conf |
| directory | 0755 | customer's | /data/nginx/servers |
| file | 0644 | customer's | /data/nginx/servers/default.conf |
| file | 0644 | customer's | /data/nginx/common/fcgi.conf |
| directory | 0775 | customer's | /var/log/engineyard/nginx |
| file | 0755 | root | /etc/init.d/nginx |
| file | 0755 | customer's | /data/nginx/mime.types |
| file | 0755 | customer's | /data/nginx/koi-utf |
| file | 0755 | customer's | /data/nginx/koi-win |
| file | 0600 | root | /etc/conf.d/nginx |
| file | 0755 | root | /etc/logrotate.d/nginx |
Scenario Outline: application-specific filesystem setup
Then the <path> for the customer's application <type> exists
And the owner of <path> for the customer's application is the customer's user
And the group of <path> for the customer's application is the group of the customer's user
And the permissions for <path> for the customer's application are <permissions>
Scenarios: configuration
| type | permissions | path |
| directory | 0775 | /var/log/engineyard/nginx/:application |
| directory | 0775 | /data/nginx/servers/:application |
| directory | 0775 | /data/nginx/servers/:application/ssl |
| file | 0644 | /data/nginx/servers/:application.rewrites |
| file | 0644 | /data/nginx/servers/:application.users |
| file | 0644 | /data/nginx/servers/:application/custom.locations.conf |
| file | 0644 | /data/nginx/servers/:application.conf |
Transform /^(\S+) application$/ do |app_name|
if app_name =~ /'s$/
App.gen_from_dna
else
App.gen(app_name)
end
end
Transform /^(#{UNIX_PATH}) for the (\S+) application$/ do |path, app_name|
app = if app_name =~ /'s$/
App.gen_from_dna
else
App.gen(app_name)
end
path.gsub(/:application/, app.name)
end
Transform /^(\S+) application$/ do |app_name|
if app_name =~ /'s$/
App.gen_from_dna
else
App.gen(app_name)
end
end
Transform /^(#{UNIX_PATH}) for the (\S+) application$/ do |path, app_name|
app = Transform "#{app_name} application"
path.gsub(/:application/, app.name)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment