Skip to content

Commit af3972e

Browse files
Yorgos Saslisar2rsawseen
Yorgos Saslis
authored andcommitted
Added Vagrantfile
Helps to quickly bring up a VM with a countly server installed. The Vagrantfile mounts the current working copy in `/opt/countly` and then runs the install script from there. This way you can continue working on your code in your favourite IDE and see changes running inside the VM (restarts might still be necessary).
1 parent 659ad97 commit af3972e

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

Vagrantfile

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
5+
# configures the configuration version (we support older styles for
6+
# backwards compatibility). Please don't change it unless you know what
7+
# you're doing.
8+
Vagrant.configure("2") do |config|
9+
# The most common configuration options are documented and commented below.
10+
# For a complete reference, please see the online documentation at
11+
# https://docs.vagrantup.com.
12+
13+
# Every Vagrant development environment requires a box. You can search for
14+
# boxes at https://vagrantcloud.com/search.
15+
config.vm.box = "bento/ubuntu-16.04"
16+
17+
# Disable automatic box update checking. If you disable this, then
18+
# boxes will only be checked for updates when the user runs
19+
# `vagrant box outdated`. This is not recommended.
20+
# config.vm.box_check_update = false
21+
22+
# Create a forwarded port mapping which allows access to a specific port
23+
# within the machine from a port on the host machine. In the example below,
24+
# accessing "localhost:8080" will access port 80 on the guest machine.
25+
# NOTE: This will enable public access to the opened port
26+
config.vm.network "forwarded_port", guest: 80, host: 32768
27+
config.vm.network "forwarded_port", guest: 9229, host: 9229 # debugger
28+
29+
# Share an additional folder to the guest VM. The first argument is
30+
# the path on the host to the actual folder. The second argument is
31+
# the path on the guest to mount the folder. And the optional third
32+
# argument is a set of non-required options.
33+
config.vm.synced_folder ".", "/opt/countly"
34+
35+
36+
# Provider-specific configuration so you can fine-tune various
37+
# backing providers for Vagrant. These expose provider-specific options.
38+
# Example for VirtualBox:
39+
#
40+
# config.vm.provider "virtualbox" do |vb|
41+
# # Display the VirtualBox GUI when booting the machine
42+
# vb.gui = true
43+
#
44+
# # Customize the amount of memory on the VM:
45+
# vb.memory = "1024"
46+
# end
47+
#
48+
# View the documentation for the provider you are using for more
49+
# information on available options.
50+
51+
# Enable provisioning with a shell script. Additional provisioners such as
52+
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
53+
# documentation for more information about their specific syntax and use.
54+
# config.vm.provision "shell" do |s|
55+
# s.inline = "cd /opt/countly && npm rebuild && /bin/bash /opt/countly/bin/countly.install.sh"
56+
# s.privileged = true
57+
# end
58+
config.vm.provision "shell" do |s|
59+
s.inline = <<-SHELL
60+
cd /opt/countly
61+
/bin/bash /opt/countly/bin/countly.install.sh
62+
# in case you've built the project on your host, you need to rebuild (possibly different platform)
63+
npm rebuild
64+
countly restart
65+
SHELL
66+
s.privileged = true
67+
end
68+
69+
end

0 commit comments

Comments
 (0)