Skip to content

Commit 5b95c59

Browse files
committed
Changes to Vagrant provisioner and environment to accomodate new
containerisation architecture. Major changes include: * Provisioning is done entirely with `vagrant up`. This has not been easy and feels inelegant. Vagrant modifies the GEM_PATH env variable meaning that it has to be saved and injected into subsequent `knife` commands. * Vagrantfile.local's symlinking magic is no longer needed * DB reset now uses JSON fixtures rather than SQL. * New ./dshell script for conveniently getting a terminal in a container. * There is an accompanying change in the cookbook which causes the docker daemon service to delay its init until after the upstart 'vagrant-mounted' event has been triggered. Updated readme to state correct username and pass created by DB reset script. USe new name for Vagrant Box to force downloading new box. Other bug fixes. Make code that gets user's default shell OSX compatible. Use much simpler ENV['SHELL'] to get user's shell in Vagrantfile Added script to install dev dependencies in deis-server. Used to run tests. Install requirements.txt and dev_requirements.txt for Travis CI Don't save user's original GEM env, just delete vagrant's GEM env from the ruby ENV var Added global 'dsh' shortcut for dshell and documented it Fixes in _post_chef_run.sh Replace pty with IO.popen for osx compatibility Revert to capturing pre-vagrant gem env so that shelling to bundle-based commands work Revert to using provision_controller.sh. Moved Vagrantfile out of root. WIP for @bacongobbler to test.
1 parent 31693ee commit 5b95c59

29 files changed

Lines changed: 463 additions & 307 deletions

.gitignore

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,4 @@ Vagrantfile.local
5959
contrib/vagrant/knife-config/admin.pem
6060
contrib/vagrant/knife-config/chef-validator.pem
6161
contrib/vagrant/nodes/
62-
63-
# Broken symlinks that appear when mounting the codebase onto a vagrant VM
64-
# See Vagrantfile.local.example
65-
logs
66-
venv
67-
static
68-
!static/
62+
contrib/vagrant/.host_nodes_dir

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ before_install:
2020
- sudo apt-get install -qq libpq-dev
2121

2222
install:
23+
- pip install -r requirements.txt coveralls
2324
- pip install -r dev_requirements.txt coveralls
2425

2526
before_script:

Vagrantfile

Lines changed: 0 additions & 68 deletions
This file was deleted.

Vagrantfile.local.example

Lines changed: 0 additions & 53 deletions
This file was deleted.

api/fixtures/deis_dev.sql

Lines changed: 0 additions & 62 deletions
This file was deleted.

api/fixtures/dev.json

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
[
2+
{
3+
"pk": -1,
4+
"model": "auth.user",
5+
"fields": {
6+
"username": "AnonymousUser",
7+
"first_name": "",
8+
"last_name": "",
9+
"is_active": true,
10+
"is_superuser": false,
11+
"is_staff": false,
12+
"last_login": "2014-02-16T13:13:47.539Z",
13+
"groups": [],
14+
"user_permissions": [],
15+
"password": "",
16+
"email": "",
17+
"date_joined": "2014-02-16T13:13:47.539Z"
18+
}
19+
},
20+
{
21+
"pk": 1,
22+
"model": "auth.user",
23+
"fields": {
24+
"username": "devuser",
25+
"first_name": "",
26+
"last_name": "",
27+
"is_active": true,
28+
"is_superuser": true,
29+
"is_staff": true,
30+
"last_login": "2014-01-27T23:30:25.062Z",
31+
"groups": [],
32+
"user_permissions": [],
33+
"password": "pbkdf2_sha256$12000$sGISfpN866YM$+pWXpirYh4rSfa0XX9kxvH047GTycDa8U9axRLHuJhk=",
34+
"email": "dev@dev.com",
35+
"date_joined": "2014-01-27T22:23:49.793Z"
36+
}
37+
},
38+
{
39+
"pk": 1,
40+
"model": "sites.site",
41+
"fields": {
42+
"domain": "deis-controller.local",
43+
"name": "deis-controller.local"
44+
}
45+
},
46+
{
47+
"pk": "1ef7e631-79e9-40f5-9702-e2edeab2d066",
48+
"model": "api.provider",
49+
"fields": {
50+
"updated": "2014-01-27T22:45:55.145Z",
51+
"created": "2014-01-27T22:23:49.861Z",
52+
"owner": [
53+
"devuser"
54+
],
55+
"type": "vagrant",
56+
"id": "vagrant",
57+
"creds": "{}"
58+
}
59+
},
60+
{
61+
"pk": "74ae11e2-6080-4817-934b-826d85418ce8",
62+
"model": "api.provider",
63+
"fields": {
64+
"updated": "2014-01-27T22:23:49.857Z",
65+
"created": "2014-01-27T22:23:49.857Z",
66+
"owner": [
67+
"devuser"
68+
],
69+
"type": "static",
70+
"id": "static",
71+
"creds": "{}"
72+
}
73+
},
74+
{
75+
"pk": "4b65ecb5-3c05-4d9b-9efa-e6b8195099ce",
76+
"model": "api.flavor",
77+
"fields": {
78+
"updated": "2014-01-27T22:23:52.079Z",
79+
"created": "2014-01-27T22:23:52.078Z",
80+
"params": "{\"memory\": \"512\"}",
81+
"provider": "1ef7e631-79e9-40f5-9702-e2edeab2d066",
82+
"owner": [
83+
"devuser"
84+
],
85+
"id": "vagrant-512"
86+
}
87+
},
88+
{
89+
"pk": "e62447cb-c08d-4e79-b3a4-ad19e52ad616",
90+
"model": "api.flavor",
91+
"fields": {
92+
"updated": "2014-01-27T22:23:52.092Z",
93+
"created": "2014-01-27T22:23:52.092Z",
94+
"params": "{\"memory\": \"2048\"}",
95+
"provider": "1ef7e631-79e9-40f5-9702-e2edeab2d066",
96+
"owner": [
97+
"devuser"
98+
],
99+
"id": "vagrant-2048"
100+
}
101+
},
102+
{
103+
"pk": "ebddfd0f-9d16-42b7-9f74-ac9ba4479234",
104+
"model": "api.flavor",
105+
"fields": {
106+
"updated": "2014-01-27T22:23:52.090Z",
107+
"created": "2014-01-27T22:23:52.090Z",
108+
"params": "{\"memory\": \"1024\"}",
109+
"provider": "1ef7e631-79e9-40f5-9702-e2edeab2d066",
110+
"owner": [
111+
"devuser"
112+
],
113+
"id": "vagrant-1024"
114+
}
115+
},
116+
{
117+
"pk": "8b196fb8-5774-4512-b3cc-569af8894a6c",
118+
"model": "api.formation",
119+
"fields": {
120+
"updated": "2014-01-27T23:32:51.173Z",
121+
"created": "2014-01-27T23:32:02.148Z",
122+
"domain": "deis-controller.local",
123+
"owner": [
124+
"devuser"
125+
],
126+
"nodes": "{}",
127+
"id": "dev"
128+
}
129+
}
130+
]

contrib/check-deis-deps.sh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
11
#!/usr/bin/env bash
22

3+
function echo_red {
4+
echo -e "\e[00;31m$1\e[00m"
5+
}
6+
37
# check for git
48
if ! which git > /dev/null; then
5-
echo 'Please install git and ensure it is in your $PATH.'
9+
echo_red 'Please install git and ensure it is in your $PATH.'
610
exit 1
711
fi
812

913
# check for RubyGems and friends
1014
if ! which ruby > /dev/null; then
11-
echo 'Please install ruby and ensure it is in your $PATH.'
15+
echo_red 'Please install ruby and ensure it is in your $PATH.'
1216
exit 1
1317
fi
1418
if ! which gem > /dev/null; then
15-
echo 'Please install RubyGems and ensure "gem" is in your $PATH.'
19+
echo_red 'Please install RubyGems and ensure "gem" is in your $PATH.'
1620
exit 1
1721
fi
1822
if ! which bundle > /dev/null; then
19-
echo 'Please install the bundler ruby gem and ensure "bundle" is in your $PATH.'
23+
echo_red 'Please install the bundler ruby gem and ensure "bundle" is in your $PATH.'
2024
exit 1
2125
fi
2226
bundles=`bundle list | egrep 'berkshelf|chef|foodcritic|knife-' | wc -l`
2327
if ! [ $bundles -ge 4 ]; then
24-
echo 'Please run "bundle install" for required ruby gems.'
28+
echo_red 'Please run "bundle install" for required ruby gems.'
2529
exit 1
2630
fi
27-
2831
# check for working knife
2932
if ! which knife > /dev/null; then
30-
echo 'Please install a knife-<provider> ruby gem and ensure "knife" is in your $PATH.'
33+
echo_red 'Please install a knife-<provider> ruby gem and ensure "knife" is in your $PATH.'
3134
exit 1
3235
fi
33-
if ! knife client list > /dev/null; then
34-
echo 'Please ensure the knife.rb file is set up correctly for your Chef account.'
36+
if ! bundle exec knife client list > /dev/null; then
37+
echo_red 'Please ensure the knife.rb file is set up correctly for your Chef account.'
3538
exit 1
3639
fi

0 commit comments

Comments
 (0)