Skip to content

Commit e45b182

Browse files
committed
Add Vagrantfile to enable emulating Travis-CI env.
- Use Vagrant to emulate the Travis-CI Precise environment ``` echo "install vagrant, # Do this first. On OS X w/ homebrew:" brew cask install vagrant # only if you have homebrew/OSX cd developer-scripts vagrant init vagrant up vagrant ssh # now you're in! ``` [CI skip]
1 parent f70b228 commit e45b182

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed

developer-scripts/Vagrantfile

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
VAGRANT_COMMAND = ARGV[0]
4+
5+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
6+
# configures the configuration version (we support older styles for
7+
# backwards compatibility). Please don't change it unless you know what
8+
# you're doing.
9+
Vagrant.configure(2) do |config|
10+
# The most common configuration options are documented and commented below.
11+
# For a complete reference, please see the online documentation at
12+
# https://docs.vagrantup.com.
13+
14+
# Every Vagrant development environment requires a box. You can search for
15+
# boxes at https://atlas.hashicorp.com/search.
16+
config.vm.box = "hashicorp/precise64"
17+
18+
# Disable automatic box update checking. If you disable this, then
19+
# boxes will only be checked for updates when the user runs
20+
# `vagrant box outdated`. This is not recommended.
21+
config.vm.box_check_update = true
22+
23+
# Create a forwarded port mapping which allows access to a specific port
24+
# within the machine from a port on the host machine. In the example below,
25+
# accessing "localhost:8080" will access port 80 on the guest machine.
26+
# config.vm.network "forwarded_port", guest: 80, host: 8080
27+
28+
# Create a private network, which allows host-only access to the machine
29+
# using a specific IP.
30+
# config.vm.network "private_network", ip: "192.168.33.10"
31+
32+
# Create a public network, which generally matched to bridged network.
33+
# Bridged networks make the machine appear as another physical device on
34+
# your network.
35+
# config.vm.network "public_network"
36+
37+
# Share an additional folder to the guest VM. The first argument is
38+
# the path on the host to the actual folder. The second argument is
39+
# the path on the guest to mount the folder. And the optional third
40+
# argument is a set of non-required options.
41+
config.vm.synced_folder "..", "/home/travis/build/sourceryinstitute/opencoarrays", mount_options: ["dmode=2770", "fmode=660"]
42+
43+
44+
# Provider-specific configuration so you can fine-tune various
45+
# backing providers for Vagrant. These expose provider-specific options.
46+
# Example for VirtualBox:
47+
#
48+
# config.vm.provider "virtualbox" do |vb|
49+
# # Display the VirtualBox GUI when booting the machine
50+
# vb.gui = true
51+
#
52+
# # Customize the amount of memory on the VM:
53+
# vb.memory = "1024"
54+
# end
55+
#
56+
# View the documentation for the provider you are using for more
57+
# information on available options.
58+
59+
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
60+
# such as FTP and Heroku are also available. See the documentation at
61+
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
62+
# config.push.define "atlas" do |push|
63+
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
64+
# end
65+
66+
config.ssh.insert_key = true
67+
# try to set a different default user
68+
if VAGRANT_COMMAND == "ssh"
69+
config.ssh.username = 'travis'
70+
config.ssh.insert_key = true
71+
end
72+
73+
# config.ssh.username = "travis"
74+
# config.ssh.insert_key = false
75+
76+
# Enable provisioning with a shell script. Additional provisioners such as
77+
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
78+
# documentation for more information about their specific syntax and use.
79+
config.vm.provision "shell", inline: <<-SHELL
80+
useradd -m -s /bin/bash travis
81+
usermod -a -G vagrant travis
82+
echo -e "travis\ntravis\n" | sudo passwd travis
83+
[ -d /home/travis/.ssh ] || sudo mkdir -p /home/travis/.ssh
84+
cp /home/vagrant/.ssh/authorized_keys /home/travis/.ssh/
85+
sudo chown -R travis:travis /home/travis
86+
sudo chmod 600 /home/travis/.ssh/authorized_keys
87+
sudo chown travis:travis /home/travis/.ssh/authorized_keys
88+
# sudo echo "AllowUsers travis" >> /etc/ssh/sshd_config
89+
# echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers # emulate no sudo on travis
90+
sudo apt-get update
91+
sudo apt-get update --fix-missing -y
92+
sudo apt-get install -y gawk build-essential ruby curl git jq python-pip python-setuptools
93+
unset LD_LIBRARY_PATH PKG_CONFIG_PATH
94+
echo 'sudo su -l travis' | cat >> /home/vagrant/.bash_profile
95+
echo 'export PATH="${HOME}/.linuxbrew/bin:$PATH"' | cat >> /home/travis/.bash_profile
96+
echo 'cd ${HOME}/build/sourceryinstitute/opencoarrays' | cat >> /home/travis/.bash_profile
97+
SHELL
98+
end

0 commit comments

Comments
 (0)