Skip to content
Snippets Groups Projects
Commit f7bce703 authored by Gabriel Engel's avatar Gabriel Engel
Browse files

trying to use new travis infrastructure

parent ecaaa743
No related merge requests found
......@@ -29,9 +29,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Use a shell script to "provision" the box. This installs Sandstorm using
# the bundled installer.
config.vm.provision "shell", inline: "sudo bash /opt/app/.sandstorm/global-setup.sh"
config.vm.provision "shell", inline: "bash ~/opt/app/.sandstorm/global-setup.sh"
# Then, do stack-specific and app-specific setup.
config.vm.provision "shell", inline: "sudo bash /opt/app/.sandstorm/setup.sh"
config.vm.provision "shell", inline: "bash ~/opt/app/.sandstorm/setup.sh"
# Shared folders are configured per-provider since vboxsf can't handle >4096 open files,
# NFS requires privilege escalation every time you bring a VM up,
......@@ -79,18 +79,16 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vb.cpus = cpus
vb.memory = assign_ram_mb
vb.name = VM_NAME
override.vm.synced_folder "..", "/opt/app"
override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm"
override.vm.synced_folder "..", "/vagrant"
override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm"
end
config.vm.provider :libvirt do |libvirt, override|
libvirt.cpus = cpus
libvirt.memory = assign_ram_mb
libvirt.default_prefix = VM_NAME
override.vm.synced_folder "..", "/opt/app", type: "9p", accessmode: "passthrough"
override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm", type: "9p", accessmode: "passthrough"
override.vm.synced_folder "..", "/vagrant", type: "9p", accessmode: "passthrough"
override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm", type: "9p", accessmode: "passthrough"
end
end
#!/bin/bash
set -euo pipefail
set -x
set -euvo pipefail
# Make meteor bundle
METEOR_WAREHOUSE_DIR="${METEOR_WAREHOUSE_DIR:-$HOME/.meteor}"
METEOR_DEV_BUNDLE=$(dirname $(readlink -f "$METEOR_WAREHOUSE_DIR/meteor"))/dev_bundle
cd /opt/app
meteor build --directory /home/vagrant/
(cd /home/vagrant/bundle/programs/server && "$METEOR_DEV_BUNDLE/bin/npm" install)
cd ~/opt/app
meteor build --directory ~/vagrant/
(cd ~/vagrant/bundle/programs/server && "$METEOR_DEV_BUNDLE/bin/npm" install)
# Copy our launcher script into the bundle so the grain can start up.
mkdir -p /home/vagrant/bundle/opt/app/.sandstorm/
cp /opt/app/.sandstorm/launcher.sh /home/vagrant/bundle/opt/app/.sandstorm/
mkdir -p ~/vagrant/bundle/opt/app/.sandstorm/
cp ~/opt/app/.sandstorm/launcher.sh ~/vagrant/bundle/opt/app/.sandstorm/
#!/bin/bash
set -euo pipefail
set -x
set -euvo pipefail
echo localhost > /etc/hostname
hostname localhost
curl https://install.sandstorm.io/ > /host-dot-sandstorm/caches/install.sh
......@@ -15,14 +17,14 @@ modprobe ip_tables
# `spk dev` work.
usermod -a -G 'sandstorm' 'vagrant'
# Bind to all addresses, so the vagrant port-forward works.
sudo sed --in-place='' \
sed --in-place='' \
--expression='s/^BIND_IP=.*/BIND_IP=0.0.0.0/' \
/opt/sandstorm/sandstorm.conf
~/opt/sandstorm/sandstorm.conf
# TODO: update sandstorm installer script to ask about dev accounts, and
# specify a value for this option in the default config?
if ! grep --quiet --no-messages ALLOW_DEV_ACCOUNTS=true /opt/sandstorm/sandstorm.conf ; then
echo "ALLOW_DEV_ACCOUNTS=true" | sudo tee -a /opt/sandstorm/sandstorm.conf
sudo service sandstorm restart
if ! grep --quiet --no-messages ALLOW_DEV_ACCOUNTS=true ~/opt/sandstorm/sandstorm.conf ; then
echo "ALLOW_DEV_ACCOUNTS=true" | tee -a ~/opt/sandstorm/sandstorm.conf
service sandstorm restart
fi
# Enable apt-cacher-ng proxy to make things faster if one appears to be running on the gateway IP
GATEWAY_IP=$(ip route | grep ^default | cut -d ' ' -f 3)
......
#!/bin/bash
set -euo pipefail
set -euvo pipefail
export METEOR_SETTINGS='{"public": {"sandstorm": true}}'
exec node /start.js -p 8000
......@@ -74,7 +74,7 @@ const pkgdef :Spk.PackageDefinition = (
sourceMap = (
# The following directories will be copied into your package.
searchPath = [
( sourcePath = "/home/vagrant/bundle" ),
( sourcePath = "~/vagrant/bundle" ),
( sourcePath = "/opt/meteor-spk/meteor-spk.deps" )
]
),
......
#!/bin/bash
set -euo pipefail
set -x
set -euvo pipefail
cd /opt/
cd ~/opt/
PACKAGE=meteor-spk-0.1.8
PACKAGE_FILENAME="$PACKAGE.tar.xz"
......@@ -12,17 +13,17 @@ if [ ! -f "$CACHE_TARGET" ] ; then
curl https://dl.sandstorm.io/${PACKAGE_FILENAME} > "$CACHE_TARGET"
fi
# Extract to /opt
# Extract to ~/opt
tar xf "$CACHE_TARGET"
# Create symlink so we can rely on the path /opt/meteor-spk
# Create symlink so we can rely on the path ~/opt/meteor-spk
ln -s "${PACKAGE}" meteor-spk
# Add bash, and its dependencies, so they get mapped into the image.
# Bash runs the launcher script.
cp -a /bin/bash /opt/meteor-spk/meteor-spk.deps/bin/
cp -a /lib/x86_64-linux-gnu/libncurses.so.* /opt/meteor-spk/meteor-spk.deps/lib/x86_64-linux-gnu/
cp -a /lib/x86_64-linux-gnu/libtinfo.so.* /opt/meteor-spk/meteor-spk.deps/lib/x86_64-linux-gnu/
cp -a /bin/bash ~/opt/meteor-spk/meteor-spk.deps/bin/
cp -a /lib/x86_64-linux-gnu/libncurses.so.* ~/opt/meteor-spk/meteor-spk.deps/lib/x86_64-linux-gnu/
cp -a /lib/x86_64-linux-gnu/libtinfo.so.* ~/opt/meteor-spk/meteor-spk.deps/lib/x86_64-linux-gnu/
# Unfortunately, Meteor does not explicitly make it easy to cache packages, but
# we know experimentally that the package is mostly directly extractable to a
......@@ -40,7 +41,7 @@ if [ ! -f "$METEOR_CACHE_TARGET" ] ; then
fi
# Extract as unprivileged user, which is the usual meteor setup
cd /home/vagrant/
cd ~/vagrant/
su -c "tar xf '${METEOR_CACHE_TARGET}'" vagrant
# Link into global PATH
ln -s /home/vagrant/.meteor/meteor /usr/bin/meteor
ln -s ~/vagrant/.meteor/meteor /usr/bin/meteor
#!/bin/bash
set -euo pipefail
set -euvo pipefail
IFS=$'\n\t'
CURL_URL="https://registry.hub.docker.com/u/rocketchat/rocket.chat/trigger/$PUSHTOKEN/"
......
#!/bin/bash
set -euo pipefail
set -euvo pipefail
IFS=$'\n\t'
export SANDSTORM_VERSION=$(curl -f "https://install.sandstorm.io/dev?from=0&type=install")
......
#!/bin/bash
set -euo pipefail
set -euvo pipefail
cp .travis/sign.key.gpg /tmp
gpg --yes --batch --passphrase=$mypass /tmp/sign.key.gpg
......
#!/bin/bash
set -euo pipefail
set -euvo pipefail
IFS=$'\n\t'
CURL_URL="https://rocket.chat/releases/update"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment