Skip to content

Commit

Permalink
change domain name for git viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed May 1, 2013
1 parent b5de156 commit d265298
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
@@ -1,5 +1,5 @@
@git-data-viewer
Feature: Build a fully-operational battlestation^W git-data-viewer.theodi.org node from scratch
Feature: Build a fully-operational battlestation^W git-viewer.labs.theodi.org node from scratch

In order to run the git data viewer app
As the ODI
Expand Down Expand Up @@ -84,35 +84,35 @@ git-data-viewer ALL=NOPASSWD:ALL

@envfile
Scenario: The env file exists
* file "/var/www/git-data-viewer.theodi.org/shared/config/env" should exist
* file "/var/www/git-viewer.labs.theodi.org/shared/config/env" should exist

Scenario: The env file contains the correct stuff
When I run "cat /var/www/git-data-viewer.theodi.org/shared/config/env"
When I run "cat /var/www/git-viewer.labs.theodi.org/shared/config/env"
Then I should see "GITHUB_OAUTH_TOKEN: " in the output

Scenario: Code is deployed
* directory "/var/www/git-data-viewer.theodi.org" should exist
* directory "/var/www/git-data-viewer.theodi.org/releases" should exist
* directory "/var/www/git-data-viewer.theodi.org/shared" should exist
* directory "/var/www/git-data-viewer.theodi.org/shared/config" should exist
* directory "/var/www/git-data-viewer.theodi.org/shared/pid" should exist
* directory "/var/www/git-data-viewer.theodi.org/shared/log" should exist
* directory "/var/www/git-data-viewer.theodi.org/shared/system" should exist
* directory "/var/www/git-viewer.labs.theodi.org" should exist
* directory "/var/www/git-viewer.labs.theodi.org/releases" should exist
* directory "/var/www/git-viewer.labs.theodi.org/shared" should exist
* directory "/var/www/git-viewer.labs.theodi.org/shared/config" should exist
* directory "/var/www/git-viewer.labs.theodi.org/shared/pid" should exist
* directory "/var/www/git-viewer.labs.theodi.org/shared/log" should exist
* directory "/var/www/git-viewer.labs.theodi.org/shared/system" should exist

@configurationstuff
Scenario: configuration stuff is correct
* file "/var/www/git-data-viewer.theodi.org/current/config/database.yml" should exist
* file "/var/www/git-data-viewer.theodi.org/current/config/database.yml" should be owned by "git-data-viewer:git-data-viewer"
* symlink "/var/www/git-data-viewer.theodi.org/current/.env" should exist
When I run "stat -c %N /var/www/git-data-viewer.theodi.org/current/.env"
* file "/var/www/git-viewer.labs.theodi.org/current/config/database.yml" should exist
* file "/var/www/git-viewer.labs.theodi.org/current/config/database.yml" should be owned by "git-data-viewer:git-data-viewer"
* symlink "/var/www/git-viewer.labs.theodi.org/current/.env" should exist
When I run "stat -c %N /var/www/git-viewer.labs.theodi.org/current/.env"
Then I should see "../../shared/config/env" in the output
When I run "cat /var/www/git-data-viewer.theodi.org/current/config/database.yml"
When I run "cat /var/www/git-viewer.labs.theodi.org/current/config/database.yml"
Then I should see "production:" in the output
And I should see "adapter: mysql2" in the output
And I should see "port: 3306" in the output

Scenario: Assets have been compiled
* directory "/var/www/git-data-viewer.theodi.org/current/public/assets/" should exist
* directory "/var/www/git-viewer.labs.theodi.org/current/public/assets/" should exist

@startup
Scenario: Startup scripts are in play
Expand All @@ -128,27 +128,27 @@ git-data-viewer ALL=NOPASSWD:ALL
@nginx
Scenario: nginx virtualhosts are correct
* symlink "/etc/nginx/sites-enabled/default" should not exist
* file "/etc/nginx/sites-available/git-data-viewer.theodi.org" should exist
* file "/etc/nginx/sites-available/git-viewer.labs.theodi.org" should exist

@nginx @vhost
Scenario: virtualhost should contain correct stuff
* file "/etc/nginx/sites-available/git-data-viewer.theodi.org" should contain
* file "/etc/nginx/sites-available/git-viewer.labs.theodi.org" should contain
"""
upstream git-data-viewer {
server 127.0.0.1:3000;
}
server {
listen 80 default;
server_name git-data-viewer.theodi.org;
access_log /var/log/nginx/git-data-viewer.theodi.org.log;
error_log /var/log/nginx/git-data-viewer.theodi.org.err;
server_name git-viewer.labs.theodi.org;
access_log /var/log/nginx/git-viewer.labs.theodi.org.log;
error_log /var/log/nginx/git-viewer.labs.theodi.org.err;
location / {
try_files $uri @backend;
}
location ~ ^/(assets)/ {
root /var/www/git-data-viewer.theodi.org/current/public/;
root /var/www/git-viewer.labs.theodi.org/current/public/;
gzip_static on; # to serve pre-gzipped version
expires max;
add_header Cache-Control public;
Expand All @@ -163,7 +163,7 @@ server {
"""

Scenario: virtualhost should be symlinked
* symlink "/etc/nginx/sites-enabled/git-data-viewer.theodi.org" should exist
* symlink "/etc/nginx/sites-enabled/git-viewer.labs.theodi.org" should exist

Scenario: nginx should be restarted
# we can't really test this
4 changes: 2 additions & 2 deletions roles/git-data-viewer.rb
Expand Up @@ -3,7 +3,7 @@
default_attributes 'user' => 'git-data-viewer',
'group' => 'git-data-viewer',
'ruby' => '2.0.0-p0',
'project_fqdn' => 'git-data-viewer.theodi.org',
'project_fqdn' => 'git-viewer.labs.theodi.org',
'git_project' => 'git-data-viewer',
'migration_command' => 'bundle exec rake db:migrate',
'chef_client' => {
Expand All @@ -16,7 +16,7 @@
}

override_attributes 'envbuilder' => {
'base_dir' => '/var/www/git-data-viewer.theodi.org/shared/config',
'base_dir' => '/var/www/git-viewer.labs.theodi.org/shared/config',
'owner' => 'git-data-viewer',
'group' => 'git-data-viewer'
},
Expand Down

0 comments on commit d265298

Please sign in to comment.