Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Vagrantfile after #374 #394

Merged
merged 3 commits into from Jul 12, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -58,7 +58,8 @@ matrix:
language: python
python: 3.5
# Not a Salt node, runs test suite instead
- env: SALT_NODE_ID=test
- env:
- SALT_NODE_ID=test
os: linux
sudo: required
dist: trusty
@@ -1,7 +1,8 @@
#!/usr/bin/env sh
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

travis_fold_start () {
printf "travis_fold:start:$1\n"
@@ -31,7 +32,7 @@ run_salt () {
}


if [ "${SALT_NODE_ID}" = "test" ]; then
if [[ "${SALT_NODE_ID}" == "test" ]]; then
# Using .travis.yml to specify Python 3.5 to be preinstalled, just to check
printf "Using $(python3 --version) at $(which python3)\n"

@@ -51,7 +52,7 @@ else

# Only run tests against the new configuration
# TODO: don't hard-code this
if [ "${SALT_NODE_ID}" = "servo-master1" ]; then
if [[ "${SALT_NODE_ID}" == "servo-master1" ]]; then
./test.py sls.buildbot.master sls.homu sls.nginx
fi
fi
@@ -1,11 +1,12 @@
#!/usr/bin/env sh
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

install_salt () {
# Ensure that pinned versions match as closely as possible
if [ "${OS_NAME}" = "linux" ]; then
if [[ "${OS_NAME}" == "linux" ]]; then
printf "$0: installing salt for Linux\n"
# Use Trusty (Ubuntu 14.04) on Travis
# Don't autostart services
@@ -14,7 +15,7 @@ install_salt () {
printf 'deb http://repo.saltstack.com/apt/ubuntu/14.04/amd64/archive/2015.5.8 trusty main\n' | sudo tee /etc/apt/sources.list.d/saltstack.list >/dev/null
sudo apt-get -y update
sudo apt-get -y install salt-minion=2015.5.8+ds-1
elif [ "${OS_NAME}" = "osx" ]; then
elif [[ "${OS_NAME}" == "osx" ]]; then
printf "$0: installing salt for Mac OS X\n"
brew update
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/3461c9c74b2f3aba9a6fbd7165823c81dc2b4792/Formula/saltstack.rb
@@ -63,16 +64,16 @@ while true; do
esac
done

if [ "$#" -lt 1 ]; then
if [[ "$#" -lt 1 ]]; then
printf >&2 "usage: $0 [-c <config_dir> [-F]] [--] os_name\n"
exit 1
fi

OS_NAME="$1"
if [ -z "${CONFIGURE_ONLY}" ]; then
if [[ -z "${CONFIGURE_ONLY}" ]]; then
install_salt
fi

if [ -n "${TEMPORARY_CONFIG_DIR}" ]; then
if [[ -n "${TEMPORARY_CONFIG_DIR}" ]]; then
configure_salt
fi
@@ -1,7 +1,8 @@
#!/usr/bin/env sh
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

setup_salt_roots () {
sudo rm -rf /srv/salt
@@ -1,7 +1,7 @@
require 'yaml'

def extract_id(env)
id = env.split.map do |env_var|
id = env.map do |env_var|
env_var[/^SALT_NODE_ID=(?<node_id>.+)$/, "node_id"]
end.compact
id[0]
@@ -16,11 +16,12 @@ Vagrant.configure(2) do |config|
end

dir = File.dirname(__FILE__)
minion_config = YAML.load_file(File.join(dir, '.travis/minion'))
minion_config_path = File.join(dir, '.travis', 'minion')
minion_config = YAML.load_file(minion_config_path)
state_root = minion_config['file_roots']['base'][0]
pillar_root = minion_config['pillar_roots']['base'][0]

YAML.load_file(File.join(dir,'.travis.yml'))['matrix']['include'].map do |node|
YAML.load_file(File.join(dir, '.travis.yml'))['matrix']['include'].map do |node|
node_config = case node['os']
when 'linux'
case node['dist']
@@ -37,7 +38,7 @@ Vagrant.configure(2) do |config|
elsif node_config[:id] != 'test'
node_config
end
end.compact.each do |node|
end.compact.uniq.each do |node|
config.vm.define node[:id] do |machine|
machine.vm.box = node[:box]
machine.vm.provider :virtualbox do |vbox|
@@ -46,12 +47,12 @@ Vagrant.configure(2) do |config|
vbox.linked_clone = true
end
machine.vm.synced_folder dir, state_root
machine.vm.synced_folder File.join(dir, ".travis/test_pillars"), pillar_root
machine.vm.synced_folder File.join(dir, '.travis', 'test_pillars'), pillar_root
machine.vm.provision :salt do |salt|
salt.bootstrap_script = '.travis/install_salt.sh'
salt.bootstrap_script = File.join(dir, '.travis', 'install_salt.sh')
salt.install_args = node[:os] # Pass OS type to bootstrap script
salt.masterless = true
salt.minion_config = '.travis/minion'
salt.minion_config = minion_config_path
# hack to provide additional options to salt-call
salt.minion_id = node[:id] + ' --retcode-passthrough'
salt.run_highstate = true
@@ -11,7 +11,7 @@

INTERPRETERS = {
'py': 'python3',
'sh': 'sh'
'sh': 'bash'
}


ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.