forked from mit-cml/appinventor-sources
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Vagrantfile for development environment bootstrapping (mit-cml#1540)
* Add Vagrantfile for development environment bootstrapping Change-Id: I2fb08206d96f2ff0da73954f820134b7a0684aef
- Loading branch information
Showing
3 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# All Vagrant configuration is done below. The "2" in Vagrant.configure | ||
# configures the configuration version (we support older styles for | ||
# backwards compatibility). Please don't change it unless you know what | ||
# you're doing. | ||
|
||
Vagrant.configure("2") do |config| | ||
|
||
config.vm.box = "ubuntu/bionic64" | ||
|
||
config.vm.boot_timeout = 400 | ||
|
||
config.vm.provider "virtualbox" do |v| | ||
v.name = "ForAppinventor2-bionic64" | ||
v.memory = "4096" | ||
v.customize ["modifyvm", :id, "--usb", "on"] | ||
# fix for slow network | ||
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] | ||
v.customize ["modifyvm", :id, "--natdnsproxy1", "on"] | ||
v.customize ["modifyvm", :id, "--nictype1", "virtio"] | ||
end | ||
|
||
config.vm.provision :shell, path: "bootstrap.sh" | ||
|
||
config.vm.network :forwarded_port, guest: 8888, host: 8888 | ||
config.vm.network :forwarded_port, guest: 9990, host: 9990 | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
dpkg --add-architecture i386 | ||
|
||
# Install dependencies | ||
apt-get update | ||
apt-get upgrade -y | ||
apt-get install -y libc6:i386 libstdc++6:i386 glibc-doc:i386 gcc-5-base:i386 gcc-6-base:i386 libgcc1:i386 \ | ||
openjdk-8-jdk zip unzip ant lib32z1 adb phantomjs | ||
|
||
# Install App Engine | ||
mkdir -p /opt/appengine | ||
cd /opt/appengine | ||
wget --no-verbose -O /tmp/appengine.zip https://storage.googleapis.com/appengine-sdks/featured/appengine-java-sdk-1.9.68.zip | ||
unzip -o /tmp/appengine.zip | ||
|
||
# Configure shell | ||
echo "export PATH=$PATH:/opt/appengine/appengine-java-sdk-1.9.68/bin" >> /home/vagrant/.bashrc | ||
echo "cd /vagrant/appinventor" >> /home/vagrant/.bashrc | ||
|
||
# Configure java | ||
update-java-alternatives -s java-1.8.0-openjdk-amd64 | ||
|
||
# Make the auth key in advance | ||
cd /vagrant/appinventor | ||
sudo -u vagrant ant MakeAuthKey | ||
|
||
# Helper script for starting App Inventor dev server | ||
cat <<EOF > /usr/local/bin/start_appinventor | ||
ant RunLocalBuildServer &> buildserver.log & | ||
BUILDSERVER=$! | ||
dev_appserver.sh -p 8888 -a 0.0.0.0 appengine/build/war | ||
kill -9 -- -$BUILDSERVER | ||
EOF | ||
chmod +x /usr/local/bin/start_appinventor |