aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Wieczorek <p.wieczorek2@samsung.com>2020-01-07 15:28:54 +0100
committerPawel Wieczorek <p.wieczorek2@samsung.com>2020-01-07 15:28:54 +0100
commit049202bf4fa1b9d3ccd6a83fa00c8e87ce4ebe04 (patch)
tree55438164b20991d38cd26877a6a76eb08f0f73cb
parent5af7684a91ceac2616aa7fb05a4d328054b2ba8c (diff)
Run Hound code search as tmux session
Code search service can be accessed from host using forwarded port (i.e. at "localhost:6080"). Issue-ID: ONAPARC-540 Change-Id: Ia94956cfeca0af12a0f52ea43abae353c0ba8b1a Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
-rw-r--r--bootstrap/codesearch/Vagrantfile10
1 files changed, 8 insertions, 2 deletions
diff --git a/bootstrap/codesearch/Vagrantfile b/bootstrap/codesearch/Vagrantfile
index b715ec50c..0407a57b5 100644
--- a/bootstrap/codesearch/Vagrantfile
+++ b/bootstrap/codesearch/Vagrantfile
@@ -3,6 +3,8 @@
host_ip = "192.168.121.1"
synced_folder = "/vagrant"
+houndd_bin = "${HOME}/go/bin/houndd"
+houndd_config = "${HOME}/config.json"
$replace_dns = <<-SCRIPT
HOST_IP="$1"
@@ -13,17 +15,21 @@ SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "generic/ubuntu1804"
config.vm.synced_folder ".", synced_folder, type: "rsync", rsync__exclude: "Vagrantfile"
+ config.vm.network "forwarded_port", guest: 6080, host: 6080
config.vm.provision "replace_dns", type: :shell, run: "always", inline: $replace_dns, args: host_ip
config.vm.provision "dependencies", type: :shell, inline: <<-SHELL
export DEBIAN_FRONTEND=noninteractive
apt-get update
- apt-get install --assume-yes --quiet golang
+ apt-get install --assume-yes --quiet golang tmux
SHELL
config.vm.provision "binaries", type: :shell, privileged: false, inline: <<-SHELL
export GOPATH="${HOME}/go"
go get -u github.com/hound-search/hound/cmds/...
SHELL
config.vm.provision "generate_config", type: :shell, privileged: false, inline: <<-SHELL
- python3 #{synced_folder}/create_config.py
+ python3 #{synced_folder}/create_config.py > #{houndd_config}
+ SHELL
+ config.vm.provision "run_codesearch", type: :shell, privileged: false, inline: <<-SHELL
+ tmux new -d -s codesearch #{houndd_bin} -conf #{houndd_config}
SHELL
end