This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Support deployment using Vagrant (#850)

  • Loading branch information...
thii authored and snatchev committed May 16, 2018
1 parent eff20e2 commit 83d7d42dc6c198405d4b95dc2fc9e48b42704a4a
Showing with 88 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +9 −0 README.md
  3. +42 −0 Vagrantfile
  4. +34 −0 vagrant-provision.sh
View
@@ -54,3 +54,6 @@ fastlane/report.xml
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
# Vagrant VM
.vagrant
View
@@ -77,6 +77,15 @@ Currently, Docker deployment is for Linux projects only.
1. `docker-compose up`
1. Up at running at [localhost:8080](http://localhost:8080/)
## Using `fastlane.ci` with Vagrant
1. Install Vagrant: `brew cask install vagrant`
1. Install VirtualBox: `brew cask install virtualbox`
1. `vagrant up`. You will be asked for your password.
1. `vagrant ssh`
1. `cd /fastlane-ci`
1. `bundle exec rake dev`
1. Up at running at [localhost:8080](http://localhost:8080/)
### Configure `fastlane.ci`
1. Visit [localhost:8080](http://localhost:8080/)
View
@@ -0,0 +1,42 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "monsenso/macos-10.13"
config.vm.box_version = "1.0.0"
config.vm.network "forwarded_port", guest: 8080, host: 8080
# Sync the fastlane-ci folder to the guest VM. The type of the synced folder
# has to be rsync or nfs, because BSD-based guests do not support the
# VirtualBox filesystem at this time.
config.vm.synced_folder ".", "/fastlane-ci", type: "nfs"
# NFS requires a host-only network to be created in order to work. This
# requires admin password every time you run `vagrant up`.
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provider "virtualbox" do |vb|
# Hide the VirtualBox GUI when booting the machine
vb.gui = false
# Customize the amount of CPUs and memory of the VM
vb.memory = "8192"
vb.cpus = 1
# No matter how much CPU is used in the VM, no more than 50% should be used
# on the host machine
vb.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
# Because the USB 2.0 controller state is part of the saved VM state, the
# VM cannot be started with USB 2.0 support on.
vb.customize ["modifyvm", :id, "--usb", "on"]
vb.customize ["modifyvm", :id, "--usbehci", "off"]
end
# Bootstrap the VM
config.vm.provision "shell",
path: "./vagrant-provision.sh",
privileged: false
end
View
@@ -0,0 +1,34 @@
echo 'export PATH=$HOME/.gem/ruby/2.3.0/bin:$PATH' >> ~/.bash_profile
source ~/.bash_profile
if [ ! -d /usr/local/Homebrew/.git ]; then
echo "==> Installing Homebrew ..."
try_count=1
while ! /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" </dev/null; do
if [ $try_count -eq 5 ]; then
echo "==> Attempt #$[$try_count] at installing Homebrew failed"
exit 1
fi
sleep 5
echo "==> Attempt #$[$try_count] at installing Homebrew failed, trying again..."
try_count=$[$try_count + 1]
done
brew doctor
else
echo "==> Homebrew is already installed"
fi
echo "==> Installing node and npm ..."
brew install node
echo "==> Installing Bundler ..."
gem install bundler --user-install --no-document --verbose
echo "==> Installing all dependencies ..."
cd /fastlane-ci
bundle install
npm install
npm run build

0 comments on commit 83d7d42

Please sign in to comment.