Skip to content

Commit

Permalink
Merge branch 'master' into ha-feature-trusty
Browse files Browse the repository at this point in the history
  • Loading branch information
BanzaiMan committed Mar 6, 2015
2 parents 3e092f7 + ebc4b25 commit 1c98383
Show file tree
Hide file tree
Showing 17 changed files with 219 additions and 31 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIT LICENSE

Copyright (c) 2011 Sven Fuchs <svenfuchs@artweb-design.de>
Copyright (c) 2011-2012 Travis CI Development Team <contact@travis-ci.org>
Copyright (c) 2011-2015 Travis CI Development Team <contact@travis-ci.org>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 0 additions & 3 deletions Rakefile
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env rake

require 'foodcritic'
require 'rspec/core/rake_task'

Expand All @@ -13,4 +11,3 @@ FoodCritic::Rake::LintTask.new do |t|
end

RSpec::Core::RakeTask.new

22 changes: 22 additions & 0 deletions ci_environment/kerl/attributes/binary.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
default[:kerl][:checksum] = {
'17.0' => '48fc017ed0e9a6f65c94c40c62d4b7daa1cab264925ec6746005b77e4c880453',
'17.1' => '38a069e7419b4ad9bdeb992bf2721055492deb32ff6170514a4b9e8ee4a4a5c4',
'17.3' => '1284b182bfc185d5f094d70e21c566f0cd400a300e79779deed5b5a3d8d743d3',
'17.4' => 'c43dd4cefc2337663806b7e474d9f0284131d582d598aae313b0d40d622238e4',
'R14B02' => '6b460f00467b800d2b4a0b193dc37fe7b5b6b0cf6dd44e55c91cdefcceb98450',
'R14B03' => '84711d4807bc6d36bc4ff378758d3f485b98c728ed30e55983069d5acdc54df7',
'R14B04' => 'bd710f894c2a9aae3ba872dfb0c19dc7b98cb1804e62b28f9884e83b0a7a562e',
'R15B01' => 'c37fbb5f2f0270c04d15c1a5b8206524be84398f4bc17791833f3b12433573ff',
'R15B02' => '5419ff69848299d224010d06dd0119ad513bbb0ea4bc79d6825f55016eade323',
'R15B03' => 'b5281eb941d6bfe03796642fb3321ff9557081372478f9914f59d8968b5b9ac7',
'R15B' => '95499c0e40bc8acb08431310252f0aa083f37bfba7d5abe6e1efd3da8b3de917',
'R16B01' => '7f11ba06714314c21472a09fb7fb24efca5bca838deb626f661ba01f3ac71388',
'R16B02' => '5d898af83587c0b6827686f55d81ae6e732f7b6f85ab41e2193897bab566c887',
'R16B03-1' => '0cd50a2c88f16371ddef457465d11008b6a8749abaf04e9e91f4e93557fc3beb',
'R16B03' => '3a093c7f3e68b552b0cc430fc0db06567e2696d11b8edb8d7e066dcb9a5c29d0',
'R16B' => '6fdc6ae988adb3e68da3a91180cc0b6a3461701221e36c6d4b2cf4ce50c09547'
}

default[:kerl][:releases] = default[:kerl][:checksum].keys

default[:kerl][:path] = "/usr/local/bin/kerl"
2 changes: 1 addition & 1 deletion ci_environment/kerl/attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include_attribute "kerl::source"
include_attribute "kerl::binary"
115 changes: 115 additions & 0 deletions ci_environment/kerl/recipes/binary.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#
# Cookbook Name:: kerl
# Recipe:: binary
#
# Copyright 2011-2012, Michael S. Klishin, Ward Bekker
# Copyright 2015, Travis CI GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

include_recipe "libreadline"
include_recipe "libssl"
include_recipe "libncurses"

package "curl" do
action :install
end

package "unixodbc-dev" do
action :install
end

installation_root = "/home/#{node.travis_build_environment.user}/otp"

directory(installation_root) do
owner node.travis_build_environment.user
group node.travis_build_environment.group
mode "0755"
action :create
end

remote_file(node.kerl.path) do
source "https://raw.githubusercontent.com/spawngrid/kerl/master/kerl"
mode "0755"
end


home = "/home/#{node.travis_build_environment.user}"
env = {
'HOME' => home,
'USER' => node.travis_build_environment.user,
'KERL_DISABLE_AGNER' => 'yes',
"KERL_BASE_DIR" => "#{home}/.kerl",
'CPPFLAGS' => "#{ENV['CPPFLAGS']} -DEPMD6"
}

case [node[:platform], node[:platform_version]]
when ["ubuntu", "11.04"] then
# fixes compilation with Ubuntu 11.04 zlib. MK.
env["KERL_CONFIGURE_OPTIONS"] = "--enable-dynamic-ssl-lib --enable-hipe"
end

# updates list of available releases. Needed for kerl to recognize
# R15B, for example. MK.
execute "erlang.releases.update" do
command "#{node.kerl.path} update releases"

user node.travis_build_environment.user
group node.travis_build_environment.group

environment(env)

# run when kerl script is downloaded & installed
subscribes :run, resources(:remote_file => node.kerl.path)
end

cookbook_file "#{node.travis_build_environment.home}/.erlang.cookie" do
owner node.travis_build_environment.user
group node.travis_build_environment.group
mode 0600

source "erlang.cookie"
end

cookbook_file "#{node.travis_build_environment.home}/.build_plt" do
owner node.travis_build_environment.user
group node.travis_build_environment.group
mode 0700

source "build_plt"
end


node.kerl.releases.each do |rel|

require 'tmpdir'

local_archive = File.join(Dir.tmpdir, "erlang-#{rel}-x86_64.tar.bz2")

remote_file local_archive do
source "https://s3.amazonaws.com/travis-otp-releases/#{node.platform}/#{node.platform_version}/erlang-#{rel}-x86_64.tar.bz2"
checksum node.kerl.checksum[rel]
end

bash "Expand Erlang #{rel} archive" do
user node.travis_build_environment.user
group node.travis_build_environment.group

code <<-EOF
tar xjf #{local_archive} --directory #{File.join(node.travis_build_environment.home, 'otp')}
EOF

not_if File.exist?(File.join(node.travis_build_environment.home, 'otp', rel))
end

end
2 changes: 1 addition & 1 deletion ci_environment/kerl/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

include_recipe "kerl::source"
include_recipe "kerl::binary"
6 changes: 3 additions & 3 deletions ci_environment/kiex/attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
default[:kiex][:elixir_versions] = ['1.0.2']
default[:kiex][:default_elixir_version] = '1.0.2'
default[:kiex][:default_elixir_version] = '1.0.3'
default[:kiex][:elixir_versions] = [ default[:kiex][:default_elixir_version] ]
# we assume that required OTP releases are installed by 'kerl' cookbook
default[:kiex][:required_otp_release_for] = {
'1.0.2' => '17.4'
'1.0.3' => '17.4'
}
2 changes: 1 addition & 1 deletion ci_environment/kiex/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Copyright 2014, Travis CI GmbH
#

include_recipe 'kerl'
include_recipe 'kerl::binary'

env = {
'HOME' => "/home/#{node.travis_build_environment.user}",
Expand Down
29 changes: 29 additions & 0 deletions ci_environment/php/recipes/5.2.17.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
include_recipe "bison"
include_recipe "libreadline"

include_recipe "phpenv"
include_recipe "phpbuild"

# This recipe downloads our own 5.2.17 archive for Precise

if node[:platform] == 'ubuntu' && node[:platform_version] == '12.04'
require 'tmpdir'

local_archive = File.join(Dir.tmpdir, 'php-5.2.17.tar.bz2')

remote_file local_archive do
source 'https://s3.amazonaws.com/travis-php-archives/php-5.2.17.tar.bz2'
checksum '5deb018f585fb40d781917e6cd744f3ecaf8aabbc6eaf53d4f1300e61d8fd915'
end

bash 'Expand PHP 5.2.17 archive' do
user node.travis_build_environment.user
group node.travis_build_environment.group

code <<-EOF
tar xjf #{local_archive} --directory #{File.join(node.travis_build_environment.home, '.phpenv', 'versions')}
EOF

not_if File.exist?(File.join(node.travis_build_environment.home, '.phpenv', 'versions', '5.2.17'))
end
end
6 changes: 3 additions & 3 deletions ci_environment/python/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
default['python']['pyenv']['revision'] = "9146f44db137a5b1f37b9da15ff360bbf3a28ba0"
default['python']['pyenv']['revision'] = "efe461d2b4995d7d25828fc12f3fd00f05ae70aa"

# Order matters for this list of Pythons. It will be used to construct the
# $PATH so items earlier in the list will take precedence over items later in
Expand All @@ -26,7 +26,7 @@
default['python']['pyenv']['pythons'] = [
"2.7.9",
"2.6.9",
"3.4.2",
"3.4.3",
"3.3.5",
"3.2.5",
"pypy-2.5.0",
Expand All @@ -38,7 +38,7 @@
"2.7.9" => ["2.7"],
"3.2.5" => ["3.2"],
"3.3.5" => ["3.3"],
"3.4.2" => ["3.4"],
"3.4.3" => ["3.4"],
"pypy-2.5.0" => ["pypy"],
"pypy3-2.4.0" => ["pypy3"],
}
Expand Down
2 changes: 1 addition & 1 deletion ci_environment/python/recipes/virtualenv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@


python_pip "virtualenv" do
version '12.0.6'
version '12.0.7'
action :install
end
2 changes: 1 addition & 1 deletion ci_environment/rebar/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

include_recipe('kerl')
include_recipe 'kerl::binary'

remote_file("/usr/local/bin/rebar") do
source node.rebar.release
Expand Down
2 changes: 1 addition & 1 deletion vm_templates/common/erlang.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
recipes:
- kerl
- kerl::binary
- kiex
- rebar
- system_info
Expand Down
9 changes: 5 additions & 4 deletions vm_templates/common/node-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ json:
- 0.8.27
- 0.10.18
- 0.10.36
- 0.11.15
- 0.11.16
- 0.12.0
aliases:
"0.10": '0.1'
0.11.15: node-head
0.11.15: node-unstable
default: 0.10.36
0.11.16: node-head
0.11.16: node-unstable
default: 0.12.0
recipes:
- nodejs::multi
- nodejs::iojs
Expand Down
1 change: 1 addition & 0 deletions vm_templates/common/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ json:
github_oauth_token: 2d8490a1060eb8e8a1ae9588b14e3a039b9e01c6
recipes:
- php::multi
- php::5.2.17
- composer
- system_info
- sweeper
4 changes: 2 additions & 2 deletions vm_templates/common/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ json:
- name: ree
- name: 1.9.2
- name: 2.0.0
- name: 2.1.2
- name: 2.1.3
- name: 2.1.4
- name: 2.1.5
- name: 2.2.0
- name: 2.2.1
gems:
- bundler
- rake
Expand All @@ -31,7 +31,7 @@ json:
jruby: jruby-19mode
"2.0": "ruby-2.0.0"
"2.1": "ruby-2.1.5"
"2.2": "ruby-2.2.0"
"2.2": "ruby-2.2.1"
java:
alternate_versions:
- openjdk6
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,43 @@
#!/bin/bash
# vim:filetype=sh
# Chef manages this file on <%= node.name %> <3 <3 <3
exec 2>&1
<% if @options[:docker] %>
for lang in <%= @options[:docker_languages].join(" ") %>; do
docker pull quay.io/travisci/travis-$lang:latest || { echo "Pulling $lang image failed"; exit 1; }
docker tag quay.io/travisci/travis-$lang:latest travis:$lang || { echo "Tagging $lang image failed"; exit 1; }
done
<% end %>
cd <%= @options[:worker_home] %>

if [[ -f /etc/default/travis-worker-chef ]] ; then
set -a
source /etc/default/travis-worker-chef
set +a
fi

if [[ -f /etc/default/travis-worker ]] ; then
set -a
source /etc/default/travis-worker
set +a
fi

: ${TRAVIS_WORKER_DOCKER_LANGUAGES:=<%= @options[:docker_languages].join(' ') %>}
: ${TRAVIS_WORKER_HOME:=<%= @options[:worker_home] %>}
: ${TRAVIS_WORKER_USER:=<%= @options[:user] %>}
: ${TRAVIS_WORKER_GROUP:=<%= @options[:group] %>}
: ${TRAVIS_WORKER_JRUBY:=<%= @options[:jruby] %>}
: ${TRAVIS_WORKER_DOCKER_PRESEED_ENABLED:=false}
: ${TRAVIS_WORKER_DOCKER_PRESEED_TOUCHFILE:=/mnt/docker/.preseeded}
: ${TRAVIS_WORKER_DOCKER_PRESEED_WAIT_SLEEP:=30}

if [[ $TRAVIS_WORKER_DOCKER_PRESEED_ENABLED = true && ! -f "$TRAVIS_WORKER_DOCKER_PRESEED_TOUCHFILE" ]] ; then
echo "Docker preseed not done yet"
sleep "${TRAVIS_WORKER_DOCKER_PRESEED_WAIT_SLEEP}"
exit 1
fi

for lang in ${TRAVIS_WORKER_DOCKER_LANGUAGES} ; do
docker pull "quay.io/travisci/travis-${lang}:latest" || { echo "Pulling ${lang} image failed"; exit 1; }
docker tag "quay.io/travisci/travis-${lang}:latest" "travis:${lang}" || { echo "Tagging ${lang} image failed"; exit 1; }
done

cd "${TRAVIS_WORKER_HOME}"

exec chpst \
-u <%= @options[:user] %>:<%= @options[:group] %> \
/usr/local/bin/signal_wrapper <%= @options[:jruby] %> \
-u "${TRAVIS_WORKER_USER}:${TRAVIS_WORKER_GROUP}" \
/usr/local/bin/signal_wrapper "${TRAVIS_WORKER_JRUBY}" \
./bin/thor travis:worker:boot

0 comments on commit 1c98383

Please sign in to comment.