Skip to content

Commit

Permalink
add virtual environments
Browse files Browse the repository at this point in the history
  • Loading branch information
joedanz committed May 7, 2015
1 parent 0e88944 commit 8fd4b6c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
18 changes: 16 additions & 2 deletions flask/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
Chef::Log.info("******Installing Flask.******")
Chef::Log.info("******Installing ElasticSearch Flask.******")

execute "Install Flask" do
execute "Install ElasticSearch Flask" do
command "/home/ec2-user/search/env/bin/pip install Flask"
action :run
end

Chef::Log.info("******Installing BPM Flask.******")

execute "Install BPM Flask" do
command "/home/ec2-user/bpm/env/bin/pip install Flask"
action :run
end

Chef::Log.info("******Installing Weather Flask.******")

execute "Install Weather Flask" do
command "/home/ec2-user/weather/env/bin/pip install Flask"
action :run
end
6 changes: 3 additions & 3 deletions gunicorn/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@

Chef::Log.info("******Running gunicorn for ElasticSearch.******")

execute "Run gunicorn" do
execute "Run ElasticSearch gunicorn" do
cwd '/home/ec2-user/search'
command "env/bin/gunicorn -b 0.0.0.0:8080 app:app &"
action :run
end

Chef::Log.info("******Running gunicorn for BPM.******")

execute "Run gunicorn" do
execute "Run BPM gunicorn" do
cwd '/home/ec2-user/bpm'
command "env/bin/gunicorn -b 0.0.0.0:8081 app:app &"
action :run
end

Chef::Log.info("******Running gunicorn for Weather.******")

execute "Run gunicorn" do
execute "Run Weather gunicorn" do
cwd '/home/ec2-user/weather'
command "env/bin/gunicorn -b 0.0.0.0:8082 app:app &"
action :run
Expand Down
18 changes: 17 additions & 1 deletion python/recipes/virtualenv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,26 @@
action :run
end

Chef::Log.info("******Creating Virtualenv.******")
Chef::Log.info("******Creating ElasticSearch Virtualenv.******")

execute "Create Virtualenv" do
cwd '/home/ec2-user/search'
command "virtualenv env"
action :run
end

Chef::Log.info("******Creating BPM Virtualenv.******")

execute "Create Virtualenv" do
cwd '/home/ec2-user/bpm'
command "virtualenv env"
action :run
end

Chef::Log.info("******Creating Weather Virtualenv.******")

execute "Create Virtualenv" do
cwd '/home/ec2-user/weather'
command "virtualenv env"
action :run
end

0 comments on commit 8fd4b6c

Please sign in to comment.