Commit 3a0142d3dc7a4b5ee6fdd3de87fb5a2503938743

Authored by Tallys Martins
1 parent 1a37d56e
Exists in lxc

Changes to work with lxc

Conflicts:
	Rakefile
Showing 3 changed files with 14 additions and 21 deletions   Show diff stats
Rakefile
... ... @@ -41,7 +41,8 @@ if $SPB_ENV == 'lxc'
41 41 end
42 42  
43 43 File.open('config/lxc/iptables-filter-rules', 'w') do |f|
44   - lxc_host_bridge_ip = '192.168.122.1' # FIXME don't hardcode
  44 + #COLOCAR O IP DA BRIDGE DO SEU LXC.. RODAR COMANDO IFCONFIG PARA VER QUAL IP QUE É O SEU
  45 + lxc_host_bridge_ip = '10.0.3.1' # FIXME don't hardcode
45 46 f.puts "-A INPUT -s #{lxc_host_bridge_ip} -p tcp -m state --state NEW --dport 22 -j ACCEPT"
46 47 f.puts "-A INPUT -s #{lxc_host_bridge_ip} -p tcp -m state --state NEW --dport 5555 -j ACCEPT"
47 48 end
... ... @@ -76,7 +77,7 @@ task :console do
76 77 end
77 78  
78 79 task :test do
79   - sh "SPB_ENV=#{$SPB_ENV} ./test/run_all"
  80 + sh "SPB_ENV=lxc ./test/run_all"
80 81 end
81 82  
82 83 file 'ssh_config.erb'
... ...
Vagrantfile
... ... @@ -9,12 +9,11 @@ load './local.rake' if File.exists?('local.rake')
9 9 VAGRANTFILE_API_VERSION = "2"
10 10  
11 11 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
12   - config.vm.box = ENV.fetch("VAGRANT_BOX", 'seocam/centos-7.0')
  12 + config.vm.box = "frensjan/centos-7-64-lxc"
13 13 proxy = ENV['http_proxy'] || ENV['HTTP_PROXY']
14 14 if proxy
15 15 config.vm.provision 'shell', path: 'utils/proxy.sh', args: [proxy]
16 16 end
17   -
18 17 env = ENV.fetch('SPB_ENV', 'local')
19 18  
20 19 if File.exist?("config/#{env}/ips.yaml")
... ... @@ -24,30 +23,23 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
24 23 end
25 24  
26 25 config.vm.define 'database' do |database|
27   - database.vm.provider "virtualbox" do |vm, override|
28   - override.vm.network 'private_network', ip: ips['database'] if ips
  26 + database.vm.provider "lxc" do |vm, override|
29 27 end
30 28 end
31 29 config.vm.define 'integration' do |integration|
32   - integration.vm.provider "virtualbox" do |vm, override|
33   - override.vm.network 'private_network', ip: ips['integration'] if ips
34   - vm.memory = 1024
35   - vm.cpus = 2
  30 + integration.vm.provider "lxc" do |vm, override|
36 31 end
37 32 end
38 33 config.vm.define 'email' do |email|
39   - email.vm.provider "virtualbox" do |vm, override|
40   - override.vm.network 'private_network', ip: ips['email'] if ips
  34 + email.vm.provider "lxc" do |vm, override|
41 35 end
42 36 end
43 37 config.vm.define 'social' do |social|
44   - social.vm.provider "virtualbox" do |vm, override|
45   - override.vm.network 'private_network', ip: ips['social'] if ips
  38 + social.vm.provider "lxc" do |vm, override|
46 39 end
47 40 end
48 41 config.vm.define 'reverseproxy' do |reverseproxy|
49   - reverseproxy.vm.provider "virtualbox" do |vm, override|
50   - override.vm.network 'private_network', ip: ips['reverseproxy'] if ips
  42 + reverseproxy.vm.provider "lxc" do |vm, override|
51 43 end
52 44 if File.exist?("tmp/preconfig.#{env}.stamp")
53 45 reverseproxy.ssh.port = File.read("tmp/preconfig.#{env}.stamp").strip.to_i
... ...
docs/build.rb
... ... @@ -6,12 +6,12 @@ $_.gsub!('@@SPB_ENV@@', $SPB_ENV)
6 6  
7 7 config = YAML.load_file("../config/#{$SPB_ENV}/config.yaml")
8 8 config.each do |key,value|
9   - $_.gsub!("@@#{key}@@", value.to_s)
  9 + # $_.gsub!("@@#{key}@@", value.to_s)
10 10 end
11 11  
12 12 $_.gsub!(/@@config\(([^\)]*)\)@@/) do |f|
13   - lines = File.read("../config/#{$SPB_ENV}/#{$1}").lines
14   - lines.shift + lines.map do |line|
15   - ' ' + line
16   - end.join
  13 + #lines = File.read("../config/#{$SPB_ENV}/#{$1}").lines
  14 + # lines.shift + lines.map do |line|
  15 + # ' ' + line
  16 +# end.join
17 17 end
... ...