Skip to content

Commit 4b71434

Browse files
committed
Merge commit '596f85f6dcf6db2ad214d75d35d59dd795cb8c1d'
2 parents bb1f38e + 596f85f commit 4b71434

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+7297
-537
lines changed
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.test
2+
.vagrant/
3+
tachyon
4+
tachyon-linux-amd64
5+
scratch/
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
language: go
3+
install:
4+
- sudo apt-get update
5+
- sudo apt-get install at # for testing upstart
6+
- mkdir ~/go
7+
- go get -d -v ./... && go build -v ./...
8+
go:
9+
- 1.2
10+
script: sudo GOPATH=$GOPATH PATH=$PATH `which go` test -v ./...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### Modules that should be builtin
2+
3+
* download
4+
* untar

src/github.com/vektra/tachyon/LICENSE

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright (c) 2014, Evan Phoenix
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
10+
* Redistributions in binary form must reproduce the above copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
14+
* Neither the name of the {organization} nor the names of its
15+
contributors may be used to endorse or promote products derived from
16+
this software without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

src/github.com/vektra/tachyon/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## tachyon
22

3+
[![Build Status](https://travis-ci.org/vektra/tachyon.svg?branch=master)](https://travis-ci.org/vektra/tachyon)
4+
35
Tachyon is an experimental configuration management tool inspired by ansible implemented in golang.
46

57
#### Ok.. why?
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
flags = ""
3+
4+
namespace :build do
5+
task :deps do
6+
sh "go get ./..."
7+
end
8+
9+
task :host do
10+
sh "go build #{flags} cmd/tachyon.go"
11+
end
12+
13+
task :linux do
14+
sh "sh -c 'GOOS=linux GOARCH=amd64 go build #{flags} -o tachyon-linux-amd64 cmd/tachyon.go'"
15+
end
16+
17+
task :nightly do
18+
flags = %Q!-ldflags "-X main.Release nightly"!
19+
end
20+
21+
task :all => [:host, :linux]
22+
end
23+
24+
namespace :test do
25+
task :normal do
26+
sh "go test -v"
27+
end
28+
29+
task :package do
30+
sh "sudo GOPATH=#{ENV['GOPATH']} /usr/bin/go test ./package/apt -v"
31+
end
32+
end
33+
34+
task :test => ["build:deps", "test:normal", "test:package"]
35+
36+
task :default => :test
+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5+
VAGRANTFILE_API_VERSION = "2"
6+
7+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8+
# All Vagrant configuration is done here. The most common configuration
9+
# options are documented and commented below. For a complete reference,
10+
# please see the online documentation at vagrantup.com.
11+
12+
# Every Vagrant virtual environment requires a box to build off of.
13+
config.vm.box = "modern-precise"
14+
15+
# The url from where the 'config.vm.box' box will be fetched if it
16+
# doesn't already exist on the user's system.
17+
config.vm.box_url = "https://www.dropbox.com/s/qp0qkqsddlzql0t/modern-precise.box"
18+
19+
# Create a forwarded port mapping which allows access to a specific port
20+
# within the machine from a port on the host machine. In the example below,
21+
# accessing "localhost:8080" will access port 80 on the guest machine.
22+
# config.vm.network :forwarded_port, guest: 80, host: 8080
23+
24+
# Create a private network, which allows host-only access to the machine
25+
# using a specific IP.
26+
# config.vm.network :private_network, ip: "192.168.33.10"
27+
28+
# Create a public network, which generally matched to bridged network.
29+
# Bridged networks make the machine appear as another physical device on
30+
# your network.
31+
# config.vm.network :public_network
32+
33+
# If true, then any SSH connections made will enable agent forwarding.
34+
# Default value: false
35+
# config.ssh.forward_agent = true
36+
37+
# Share an additional folder to the guest VM. The first argument is
38+
# the path on the host to the actual folder. The second argument is
39+
# the path on the guest to mount the folder. And the optional third
40+
# argument is a set of non-required options.
41+
# config.vm.synced_folder "../data", "/vagrant_data"
42+
43+
# Provider-specific configuration so you can fine-tune various
44+
# backing providers for Vagrant. These expose provider-specific options.
45+
# Example for VirtualBox:
46+
#
47+
# config.vm.provider :virtualbox do |vb|
48+
# # Don't boot with headless mode
49+
# vb.gui = true
50+
#
51+
# # Use VBoxManage to customize the VM. For example to change memory:
52+
# vb.customize ["modifyvm", :id, "--memory", "1024"]
53+
# end
54+
#
55+
# View the documentation for the provider you're using for more
56+
# information on available options.
57+
58+
config.vm.provision :tachyon do |t|
59+
t.tachyon_path = "vagrant-tachyon"
60+
end
61+
62+
# Enable provisioning with Puppet stand alone. Puppet manifests
63+
# are contained in a directory path relative to this Vagrantfile.
64+
# You will need to create the manifests directory and a manifest in
65+
# the file base.pp in the manifests_path directory.
66+
#
67+
# An example Puppet manifest to provision the message of the day:
68+
#
69+
# # group { "puppet":
70+
# # ensure => "present",
71+
# # }
72+
# #
73+
# # File { owner => 0, group => 0, mode => 0644 }
74+
# #
75+
# # file { '/etc/motd':
76+
# # content => "Welcome to your Vagrant-built virtual machine!
77+
# # Managed by Puppet.\n"
78+
# # }
79+
#
80+
# config.vm.provision :puppet do |puppet|
81+
# puppet.manifests_path = "manifests"
82+
# puppet.manifest_file = "site.pp"
83+
# end
84+
85+
# Enable provisioning with chef solo, specifying a cookbooks path, roles
86+
# path, and data_bags path (all relative to this Vagrantfile), and adding
87+
# some recipes and/or roles.
88+
#
89+
# config.vm.provision :chef_solo do |chef|
90+
# chef.cookbooks_path = "../my-recipes/cookbooks"
91+
# chef.roles_path = "../my-recipes/roles"
92+
# chef.data_bags_path = "../my-recipes/data_bags"
93+
# chef.add_recipe "mysql"
94+
# chef.add_role "web"
95+
#
96+
# # You may also specify custom JSON attributes:
97+
# chef.json = { :mysql_password => "foo" }
98+
# end
99+
100+
# Enable provisioning with chef server, specifying the chef server URL,
101+
# and the path to the validation key (relative to this Vagrantfile).
102+
#
103+
# The Opscode Platform uses HTTPS. Substitute your organization for
104+
# ORGNAME in the URL and validation key.
105+
#
106+
# If you have your own Chef Server, use the appropriate URL, which may be
107+
# HTTP instead of HTTPS depending on your configuration. Also change the
108+
# validation key to validation.pem.
109+
#
110+
# config.vm.provision :chef_client do |chef|
111+
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
112+
# chef.validation_key_path = "ORGNAME-validator.pem"
113+
# end
114+
#
115+
# If you're using the Opscode platform, your validator client is
116+
# ORGNAME-validator, replacing ORGNAME with your organization name.
117+
#
118+
# If you have your own Chef Server, the default validation client name is
119+
# chef-validator, unless you changed the configuration.
120+
#
121+
# chef.validation_client_name = "ORGNAME-validator"
122+
end
+12-16
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,35 @@
11
package tachyon
22

3-
import (
4-
"fmt"
5-
)
6-
73
type AsyncAction struct {
84
Task *Task
95
Error error
6+
Result *Result
107
status chan *AsyncAction
118
}
129

13-
func (a *AsyncAction) Init(pe *PlayEnv) {
14-
pe.wait.Add(1)
15-
a.status = pe.AsyncChannel()
10+
func (a *AsyncAction) Init(r *Runner) {
11+
r.wait.Add(1)
12+
a.status = r.AsyncChannel()
1613
}
1714

18-
func (a *AsyncAction) Finish(err error) {
15+
func (a *AsyncAction) Finish(res *Result, err error) {
1916
a.Error = err
17+
a.Result = res
2018
a.status <- a
2119
}
2220

23-
func (pe *PlayEnv) handleAsync() {
21+
func (r *Runner) handleAsync() {
2422
for {
25-
act := <-pe.async
23+
act := <-r.async
2624

27-
if act.Error == nil {
28-
fmt.Printf("- %s (async success)\n", act.Task.Name())
25+
r.env.report.FinishAsyncTask(act)
2926

27+
if act.Error == nil {
3028
for _, x := range act.Task.Notify() {
31-
pe.AddNotify(x)
29+
r.AddNotify(x)
3230
}
33-
} else {
34-
fmt.Printf("- %s (async error:%s)\n", act.Task.Name(), act.Error)
3531
}
3632

37-
pe.wait.Done()
33+
r.wait.Done()
3834
}
3935
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: gem
3+
tasks:
4+
- name: Check for installation
5+
shell:
6+
command: gem list $name | grep $name
7+
ignore_failure: true
8+
register: check
9+
10+
- name: Install gem
11+
shell: gem install --no-ri --no-rdoc $name
12+
when: $(== check.rc 1)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
- name: Update apt-get cache
3+
apt: update_cache=yes cache_time=60m
4+
5+
- name: Install build packages
6+
apt: pkg=$item state=present
7+
with_items:
8+
- autoconf
9+
- binutils-doc
10+
- bison
11+
- build-essential
12+
- flex
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
- hosts: all
3+
roles:
4+
- build_essential

0 commit comments

Comments
 (0)