instigator 0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.bundle/config +2 -0
- data/.gitignore +1 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +38 -0
- data/LICENSE +30 -0
- data/README.md +22 -0
- data/Rakefile +2 -0
- data/TODO +1 -0
- data/bin/instigate +5 -0
- data/instigator.gemspec +30 -0
- data/lib/app.rb +29 -0
- data/lib/git_config.rb +42 -0
- data/lib/github.rb +83 -0
- data/lib/haskell.rb +83 -0
- data/lib/instigator/util.rb +24 -0
- data/lib/instigator/version.rb +3 -0
- data/lib/jenkins.rb +47 -0
- data/lib/sinatra.rb +38 -0
- data/tasks/app.thor +5 -0
- data/templates/README.tt +10 -0
- data/templates/cabal.tt +23 -0
- data/templates/config_xml.tt +70 -0
- data/templates/module.tt +3 -0
- data/templates/test.tt +10 -0
- data/templates/watchr.tt +8 -0
- metadata +197 -0
data/.bundle/config
ADDED
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
instigator (0.9)
|
5
|
+
activesupport
|
6
|
+
awesome_print
|
7
|
+
i18n
|
8
|
+
open4
|
9
|
+
thor
|
10
|
+
uuid
|
11
|
+
watchr
|
12
|
+
|
13
|
+
GEM
|
14
|
+
remote: http://rubygems.org/
|
15
|
+
specs:
|
16
|
+
activesupport (3.0.6)
|
17
|
+
awesome_print (0.3.2)
|
18
|
+
i18n (0.5.0)
|
19
|
+
macaddr (1.0.0)
|
20
|
+
open4 (1.0.1)
|
21
|
+
thor (0.14.6)
|
22
|
+
uuid (2.3.1)
|
23
|
+
macaddr (~> 1.0)
|
24
|
+
watchr (0.7)
|
25
|
+
|
26
|
+
PLATFORMS
|
27
|
+
ruby
|
28
|
+
|
29
|
+
DEPENDENCIES
|
30
|
+
activesupport
|
31
|
+
awesome_print
|
32
|
+
bundler (>= 1.0.0.rc.6)
|
33
|
+
i18n
|
34
|
+
instigator!
|
35
|
+
open4
|
36
|
+
thor
|
37
|
+
uuid
|
38
|
+
watchr
|
data/LICENSE
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
Copyright (c)2011, Mark Wotton
|
2
|
+
|
3
|
+
All rights reserved.
|
4
|
+
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
7
|
+
|
8
|
+
* Redistributions of source code must retain the above copyright
|
9
|
+
notice, this list of conditions and the following disclaimer.
|
10
|
+
|
11
|
+
* Redistributions in binary form must reproduce the above
|
12
|
+
copyright notice, this list of conditions and the following
|
13
|
+
disclaimer in the documentation and/or other materials provided
|
14
|
+
with the distribution.
|
15
|
+
|
16
|
+
* Neither the name of Mark Wotton nor the names of other
|
17
|
+
contributors may be used to endorse or promote products derived
|
18
|
+
from this software without specific prior written permission.
|
19
|
+
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
21
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
22
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
23
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
24
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
25
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
26
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
27
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
28
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
29
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
30
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Instigator is a template for starting new projects, intended to make it
|
2
|
+
easier to start a project with all of the goodies like testing, github
|
3
|
+
repo and optionally Jenkins integration set up.
|
4
|
+
|
5
|
+
Currently there are recipes for Sinatra apps running on heroku, and
|
6
|
+
Haskell apps and libraries.
|
7
|
+
|
8
|
+
Getting started:
|
9
|
+
|
10
|
+
bundle
|
11
|
+
# only needs to be done once per machine - substitue your CI server here.
|
12
|
+
jenkins nodes --host ci.shimweasel.com --port 80
|
13
|
+
git config --global github.token YOURTOKEN
|
14
|
+
git config --global github.user YOURLOGIN
|
15
|
+
git config --global jenkins.user YOURJENKINSUSER
|
16
|
+
git config --global jenkins.password YOURJENKINSPASSWORD
|
17
|
+
|
18
|
+
|
19
|
+
# a haskell library
|
20
|
+
instigate MYAPPNAME --project_type=haskell --lib
|
21
|
+
# or a sinatra project on heroku
|
22
|
+
instigate MYAPPNAME --project_type=sinatra
|
data/Rakefile
ADDED
data/bin/instigate
ADDED
data/instigator.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path("../lib/instigator/version", __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "instigator"
|
6
|
+
s.version = Instigator::VERSION
|
7
|
+
s.platform = Gem::Platform::RUBY
|
8
|
+
s.authors = ["Mark Wotton"]
|
9
|
+
s.email = ['mwotton@gmail.com']
|
10
|
+
s.homepage = "http://rubygems.org/gems/instigator"
|
11
|
+
s.summary = "Project starter for Haskell"
|
12
|
+
s.description = "Project starter for Haskell: sets up CI & github integration, along with best-practice stuff like tests and hlint"
|
13
|
+
|
14
|
+
s.required_rubygems_version = ">= 1.3.6"
|
15
|
+
s.rubyforge_project = "instigator"
|
16
|
+
|
17
|
+
s.add_development_dependency "bundler", ">= 1.0.0.rc.6"
|
18
|
+
s.add_dependency 'thor'
|
19
|
+
s.add_dependency 'activesupport'
|
20
|
+
s.add_dependency 'i18n'
|
21
|
+
s.add_dependency 'uuid'
|
22
|
+
s.add_dependency 'watchr'
|
23
|
+
s.add_dependency 'open4'
|
24
|
+
s.add_dependency 'awesome_print'
|
25
|
+
|
26
|
+
|
27
|
+
s.files = `git ls-files`.split("\n")
|
28
|
+
s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
|
29
|
+
s.require_path = 'lib'
|
30
|
+
end
|
data/lib/app.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# must be a nicer way of doing this
|
2
|
+
# $LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
|
3
|
+
require 'github'
|
4
|
+
require 'jenkins'
|
5
|
+
|
6
|
+
class App < Thor
|
7
|
+
desc "setup", "create a new app"
|
8
|
+
argument :name # don't need it here, but still...
|
9
|
+
method_option :project_type, :type => :string, :default => "haskell"
|
10
|
+
def setup
|
11
|
+
require options.project_type rescue raise "No such project type #{options.project_type}"
|
12
|
+
|
13
|
+
[options.project_type, "github", "jenkins"].each do |task_group|
|
14
|
+
# run preflight if it exists
|
15
|
+
invoke "#{task_group}:preflight" # rescue puts "no preflight for #{task_group}"
|
16
|
+
end
|
17
|
+
|
18
|
+
invoke "#{options.project_type}:setup", [name]
|
19
|
+
|
20
|
+
invoke "github:new_project"
|
21
|
+
invoke "jenkins:new_project"
|
22
|
+
# this has to come last so that the hook set up for jenkins can be fired.
|
23
|
+
invoke "github:push"
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
|
data/lib/git_config.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'net/https'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
module GitConfig
|
6
|
+
|
7
|
+
def email
|
8
|
+
git_attribute 'user.email', 'email'
|
9
|
+
end
|
10
|
+
|
11
|
+
def author
|
12
|
+
git_attribute 'user.name', 'author'
|
13
|
+
end
|
14
|
+
|
15
|
+
def github_token
|
16
|
+
git_attribute 'github.token', 'token'
|
17
|
+
end
|
18
|
+
|
19
|
+
def github_user
|
20
|
+
git_attribute 'github.user', 'username'
|
21
|
+
end
|
22
|
+
|
23
|
+
def jenkins_server
|
24
|
+
git_attribute 'jenkins.server', 'server'
|
25
|
+
end
|
26
|
+
|
27
|
+
def jenkins_user
|
28
|
+
git_attribute 'jenkins.user', 'user'
|
29
|
+
end
|
30
|
+
|
31
|
+
def jenkins_password
|
32
|
+
git_attribute 'jenkins.password', 'password'
|
33
|
+
end
|
34
|
+
|
35
|
+
protected
|
36
|
+
def git_attribute(tag, name)
|
37
|
+
guarded("git config --global #{tag}") do |error|
|
38
|
+
abort "please add your #{name} to ~/.gitconfig with\n git config --global #{tag} #{name.upcase}"
|
39
|
+
end.chomp
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
data/lib/github.rb
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
require 'uuid'
|
2
|
+
require 'net/https'
|
3
|
+
require 'net/http'
|
4
|
+
require 'json'
|
5
|
+
require 'git_config'
|
6
|
+
|
7
|
+
class Github < Thor
|
8
|
+
include GitConfig
|
9
|
+
argument :name
|
10
|
+
|
11
|
+
desc "preflight", "check dependencies"
|
12
|
+
def preflight
|
13
|
+
abort "you already have a #{name} project on github" unless
|
14
|
+
HTTParty.get("http://github.com/#{github_user}/#{name}").code == 404
|
15
|
+
github_user
|
16
|
+
github_token
|
17
|
+
end
|
18
|
+
|
19
|
+
desc "delete_project", "erase github project. BE VERY SURE"
|
20
|
+
method_option :confirm, :type => :boolean
|
21
|
+
def delete_project
|
22
|
+
abort "set --confirm to show you really mean it" unless options.confirm?
|
23
|
+
res = github_post("/repos/delete/#{github_user}/#{name}", :name => name)
|
24
|
+
delete_token = JSON.parse(res.body)['delete_token']
|
25
|
+
github_post("/repos/delete/#{github_user}/#{name}", :name => name, :delete_token => delete_token)
|
26
|
+
end
|
27
|
+
|
28
|
+
desc "new_project", "new project on github"
|
29
|
+
def new_project
|
30
|
+
Dir.chdir name do
|
31
|
+
guarded "git init"
|
32
|
+
guarded "git add ."
|
33
|
+
guarded "git commit -m 'initial commit'" do end
|
34
|
+
github_post('/repos/create', :name => name)
|
35
|
+
guarded "git remote add origin git@github.com:#{github_user}/#{name}"
|
36
|
+
announce "new project on github"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
desc "push", "push to github"
|
41
|
+
def push
|
42
|
+
Dir.chdir(name) { guarded "git push -u origin master" }
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
desc "attach", "sync up github and jenkins"
|
47
|
+
method_option :token, :type => :string, :required => true
|
48
|
+
def attach
|
49
|
+
#ganked from https://gist.github.com/238305
|
50
|
+
github_post "/#{github_user}/#{name}/edit/postreceive_urls",
|
51
|
+
"urls[]" => "#{jenkins_server}/job/#{name}/build?token=#{options.token}",
|
52
|
+
:raw => true
|
53
|
+
announce "attached github project to jenkins"
|
54
|
+
rescue => e
|
55
|
+
puts e
|
56
|
+
abort "failed in attach"
|
57
|
+
end
|
58
|
+
|
59
|
+
no_tasks do
|
60
|
+
|
61
|
+
def github_post(path, args)
|
62
|
+
# More like NOT::HTTP, amirite?
|
63
|
+
# sadly, octokit isn't working right now.
|
64
|
+
# @client = Octokit::Client.new(:login => 'pengwynn', :token => 'OU812')
|
65
|
+
options = args.merge(:login => github_user, :token => github_token)
|
66
|
+
net = Net::HTTP.new('github.com',443)
|
67
|
+
net.use_ssl = true
|
68
|
+
url = args.delete(:raw) ? path : "/api/v2/json#{path}"
|
69
|
+
req = Net::HTTP::Post.new(url)
|
70
|
+
req.set_form_data(options)
|
71
|
+
|
72
|
+
response=net.request(req)
|
73
|
+
|
74
|
+
if not [200,302].include? response.code.to_i
|
75
|
+
error = JSON.parse(response.body)['error'] rescue "unparsable"
|
76
|
+
raise StandardError, ap(:error => :github, :parsed => error, :code => response.code, :url => url)
|
77
|
+
end
|
78
|
+
response
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
data/lib/haskell.rb
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
require 'active_support/inflector'
|
2
|
+
$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
|
3
|
+
require 'git_config'
|
4
|
+
require 'instigator/util'
|
5
|
+
require 'thor'
|
6
|
+
|
7
|
+
class Haskell < Thor
|
8
|
+
include GitConfig
|
9
|
+
include Thor::Actions
|
10
|
+
|
11
|
+
attr_reader :mod
|
12
|
+
argument :name
|
13
|
+
|
14
|
+
def self.source_root
|
15
|
+
File.join(File.dirname(__FILE__), '..', 'templates')
|
16
|
+
end
|
17
|
+
|
18
|
+
desc "preflight", "Check for preconditions"
|
19
|
+
def preflight
|
20
|
+
author
|
21
|
+
email
|
22
|
+
abort "#{name} already taken on hackage" unless
|
23
|
+
HTTParty.get("http://hackage.haskell.org/package/#{name}").code == 404
|
24
|
+
%x{cabal list --simple-output #{name}} == ""
|
25
|
+
abort "#{name} directory already exists!" if Dir.exists? name
|
26
|
+
end
|
27
|
+
|
28
|
+
desc "setup", "set up a haskell project"
|
29
|
+
def setup
|
30
|
+
invoke :mkdir
|
31
|
+
Dir.chdir name do
|
32
|
+
invoke :skeleton
|
33
|
+
invoke :cabal_dev
|
34
|
+
end
|
35
|
+
announce "new haskell project set up"
|
36
|
+
end
|
37
|
+
|
38
|
+
desc "mkdir","create the directory"
|
39
|
+
|
40
|
+
def mkdir
|
41
|
+
puts "creating #{Dir.getwd}/#{name}"
|
42
|
+
Dir.mkdir name
|
43
|
+
Dir.mkdir "#{name}/Tests"
|
44
|
+
end
|
45
|
+
|
46
|
+
desc "skeleton", "set up a skeleton haskell project"
|
47
|
+
# method_option :name, :option => :required, :type=>:string
|
48
|
+
method_option :category, :option => :required, :type => :string
|
49
|
+
method_option :lib, :default => true, :type => :boolean
|
50
|
+
method_options :app => false, :type => :boolean
|
51
|
+
def skeleton
|
52
|
+
@mod = name.camelize
|
53
|
+
guarded "cabal init -m -n #{name} -l BSD3 -a Mark Wotton -e mwotton@gmail.com -c #{options.category} -q"
|
54
|
+
guarded "rm #{name}.cabal" do end
|
55
|
+
# overwrite the cabal file
|
56
|
+
template 'cabal.tt', "#{name}/#{name}.cabal"
|
57
|
+
template 'test.tt', "#{name}/Tests/Test#{@mod}.hs"
|
58
|
+
template 'module.tt', "#{name}/src/#{@mod}.hs"
|
59
|
+
template 'main.tt', "#{name}/src/Main.hs" if options.app?
|
60
|
+
template 'watchr.tt', "#{name}/watchr.rb"
|
61
|
+
template 'README.tt', "#{name}/README.md"
|
62
|
+
File.open("runtests.sh", "w") do |f|
|
63
|
+
f.write "tbc -v Tests"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
desc "cabal_dev", "ensure cabal-dev is present"
|
68
|
+
def cabal_dev
|
69
|
+
["cabal-dev", "happy"].each do |prereq|
|
70
|
+
guarded "[ -x `which #{prereq}` ]" do
|
71
|
+
warn "#{prereq} not installed, attempting..."
|
72
|
+
guarded "cabal install #{prereq}" do |err|
|
73
|
+
abort "#{prereq} not installable: #{ap err}"
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# system "cabal-dev install-deps"
|
79
|
+
guarded "cabal install -v"
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'open4'
|
2
|
+
require 'awesome_print'
|
3
|
+
|
4
|
+
def announce(str)
|
5
|
+
puts " #{str}"
|
6
|
+
end
|
7
|
+
|
8
|
+
def guarded(task)
|
9
|
+
pid, stdin, stdout, stderr = Open4.popen4 task
|
10
|
+
ignored, status = Process.waitpid2 pid
|
11
|
+
|
12
|
+
if status == 0
|
13
|
+
stderr.read
|
14
|
+
stdout.read
|
15
|
+
else
|
16
|
+
err = { :status => status, :stdout => stdout.read, :stderr => stderr.read }
|
17
|
+
if block_given?
|
18
|
+
yield err
|
19
|
+
else
|
20
|
+
abort "bad exit:\n#{ap err}"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
data/lib/jenkins.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'uuid'
|
2
|
+
require 'httparty'
|
3
|
+
require 'git_config'
|
4
|
+
require 'thor'
|
5
|
+
|
6
|
+
class Jenkins < Thor
|
7
|
+
argument :name
|
8
|
+
include GitConfig
|
9
|
+
include Thor::Actions
|
10
|
+
attr_reader :secret
|
11
|
+
|
12
|
+
desc "preflight", "Check for dependencies"
|
13
|
+
def preflight
|
14
|
+
jenkins_password && jenkins_user
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
desc "new_project", "set up new jenkins project"
|
19
|
+
def new_project
|
20
|
+
@secret = UUID.new.generate
|
21
|
+
config = ERB.new(File.read File.join(Jenkins.source_root, 'config_xml.tt'))
|
22
|
+
jenkins_post "/createItem/api/xml?name=#{name}", config.result(binding)
|
23
|
+
announce "new project on jenkins"
|
24
|
+
invoke 'github:attach', [name], :token => @secret
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.source_root
|
28
|
+
File.join(File.dirname(File.expand_path(__FILE__)), '..', 'templates')
|
29
|
+
end
|
30
|
+
|
31
|
+
no_tasks do
|
32
|
+
|
33
|
+
def jenkins_post(path,raw)
|
34
|
+
HTTParty.post jenkins_server + path,
|
35
|
+
:basic_auth => {
|
36
|
+
:username => jenkins_user,
|
37
|
+
:password => jenkins_password
|
38
|
+
},
|
39
|
+
:format => :xml,
|
40
|
+
:headers => { 'content-type' => 'application/xml' },
|
41
|
+
:body => raw
|
42
|
+
rescue => e
|
43
|
+
abort "couldn't post to jenkins: #{e.inspect}"
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
data/lib/sinatra.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
|
2
|
+
require 'instigator/util'
|
3
|
+
require 'git_config'
|
4
|
+
require 'thor'
|
5
|
+
|
6
|
+
class Sinatra < Thor
|
7
|
+
include GitConfig
|
8
|
+
include Thor::Actions
|
9
|
+
|
10
|
+
argument :name
|
11
|
+
|
12
|
+
desc "preflight", "Check for preconditions"
|
13
|
+
def preflight
|
14
|
+
# bit rough and ready, but no heroku api for querying
|
15
|
+
# app namespace
|
16
|
+
abort "#{name} is already taken on heroku" unless
|
17
|
+
HTTParty.get("http://#{name}.heroku.com").code == 404
|
18
|
+
|
19
|
+
# these will abort anyway.
|
20
|
+
author && email
|
21
|
+
end
|
22
|
+
|
23
|
+
desc "setup", "set up a sinatra-heroku project"
|
24
|
+
def setup
|
25
|
+
|
26
|
+
guarded "git clone git://github.com/mwotton/heroku-sinatra-app.git #{name}"
|
27
|
+
|
28
|
+
Dir.chdir name do
|
29
|
+
guarded "git remote rm origin" # hide the evidence
|
30
|
+
guarded "heroku create #{name}"
|
31
|
+
File.open("runtests.sh", "w") do |f|
|
32
|
+
f.write "bundle exec rspec spec"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
data/tasks/app.thor
ADDED
data/templates/README.tt
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
This is an autogenerated README for the <%= name %> project.
|
2
|
+
|
3
|
+
Things you can do:
|
4
|
+
-- run the tests by running 'tbc'
|
5
|
+
-- have an automatic test loop by running 'watchr watchr.rb'
|
6
|
+
-- install locally with "cabal install"
|
7
|
+
-- push to hackage with "FIXME"
|
8
|
+
-- push to github with "git push"
|
9
|
+
|
10
|
+
Pushing to github should run the tests on the CI server too.
|
data/templates/cabal.tt
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
Name: <%= name %>
|
2
|
+
Version: 0.1
|
3
|
+
License: BSD3
|
4
|
+
License-file: LICENSE
|
5
|
+
Author: <%= author %>, <<%= email %>>
|
6
|
+
Maintainer: <%= author %>, <<%= email %>>
|
7
|
+
Category: Development
|
8
|
+
Build-type: Simple
|
9
|
+
Cabal-version: >=1.2
|
10
|
+
|
11
|
+
<% if options.lib? %>
|
12
|
+
Library
|
13
|
+
-- this is an awful hack, but if we don't specify QC1 here
|
14
|
+
-- tbc will grab something else. FIXME PLZ!
|
15
|
+
Build-Depends: base, QuickCheck >= 1.1 && <2, hlint, TBC
|
16
|
+
Hs-source-dirs: src
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<% if options.app? %>
|
20
|
+
Executable <%= name %>
|
21
|
+
Main-is: src/Main.hs
|
22
|
+
Hs-source-dirs: src
|
23
|
+
<% end %>
|
@@ -0,0 +1,70 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
2
|
+
<matrix-project>
|
3
|
+
<actions/>
|
4
|
+
<description></description>
|
5
|
+
<keepDependencies>false</keepDependencies>
|
6
|
+
<properties>
|
7
|
+
<org.jvnet.hudson.plugins.shelveproject.ShelveProjectProperty/>
|
8
|
+
</properties>
|
9
|
+
<scm class="hudson.plugins.git.GitSCM">
|
10
|
+
<configVersion>1</configVersion>
|
11
|
+
<remoteRepositories>
|
12
|
+
<org.spearce.jgit.transport.RemoteConfig>
|
13
|
+
<string>origin</string>
|
14
|
+
<int>5</int>
|
15
|
+
<string>fetch</string>
|
16
|
+
<string>+refs/heads/*:refs/remotes/origin/*</string>
|
17
|
+
<string>receivepack</string>
|
18
|
+
<string>git-upload-pack</string>
|
19
|
+
<string>uploadpack</string>
|
20
|
+
<string>git-upload-pack</string>
|
21
|
+
<string>url</string>
|
22
|
+
<string>git://github.com/<%=github_user%>/<%=name%>.git</string>
|
23
|
+
<string>tagopt</string>
|
24
|
+
<string></string>
|
25
|
+
</org.spearce.jgit.transport.RemoteConfig>
|
26
|
+
</remoteRepositories>
|
27
|
+
<branches>
|
28
|
+
<hudson.plugins.git.BranchSpec>
|
29
|
+
<name>master</name>
|
30
|
+
</hudson.plugins.git.BranchSpec>
|
31
|
+
</branches>
|
32
|
+
<localBranch></localBranch>
|
33
|
+
<mergeOptions/>
|
34
|
+
<recursiveSubmodules>false</recursiveSubmodules>
|
35
|
+
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
|
36
|
+
<authorOrCommitter>false</authorOrCommitter>
|
37
|
+
<clean>false</clean>
|
38
|
+
<wipeOutWorkspace>false</wipeOutWorkspace>
|
39
|
+
<pruneBranches>false</pruneBranches>
|
40
|
+
<buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
|
41
|
+
<gitTool>Default</gitTool>
|
42
|
+
<submoduleCfg class="list"/>
|
43
|
+
<relativeTargetDir></relativeTargetDir>
|
44
|
+
<excludedRegions></excludedRegions>
|
45
|
+
<excludedUsers></excludedUsers>
|
46
|
+
</scm>
|
47
|
+
<canRoam>true</canRoam>
|
48
|
+
<disabled>false</disabled>
|
49
|
+
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
50
|
+
<authToken><%= secret %></authToken>
|
51
|
+
<triggers class="vector"/>
|
52
|
+
<concurrentBuild>false</concurrentBuild>
|
53
|
+
<axes>
|
54
|
+
<hudson.matrix.LabelAxis>
|
55
|
+
<name>label</name>
|
56
|
+
<values>
|
57
|
+
<string>mac</string>
|
58
|
+
</values>
|
59
|
+
</hudson.matrix.LabelAxis>
|
60
|
+
</axes>
|
61
|
+
<builders>
|
62
|
+
<hudson.tasks.Shell>
|
63
|
+
<command>bash -c -l 'sh ./runtests.sh'</command>
|
64
|
+
</hudson.tasks.Shell>
|
65
|
+
</builders>
|
66
|
+
<publishers>
|
67
|
+
</publishers>
|
68
|
+
<buildWrappers/>
|
69
|
+
<runSequentially>true</runSequentially>
|
70
|
+
</matrix-project>
|
data/templates/module.tt
ADDED
data/templates/test.tt
ADDED
data/templates/watchr.tt
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
# run tests when they're changed
|
2
|
+
watch('Tests/.*hs'){|md| system "tbc #{md[0]}"}
|
3
|
+
# for the moment, when anything changes, run everything
|
4
|
+
# we could be more sophisticated, but let's get it running first.
|
5
|
+
# bit of a conflict here - tbc wants test_*, which hlint doesn't like
|
6
|
+
# finesse it away for now.
|
7
|
+
watch('src/(.*).hs') {|md| system "tbc Tests; hlint Tests -i 'Use camelCase'; hlint src"}
|
8
|
+
|
metadata
ADDED
@@ -0,0 +1,197 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: instigator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 9
|
8
|
+
version: "0.9"
|
9
|
+
platform: ruby
|
10
|
+
authors:
|
11
|
+
- Mark Wotton
|
12
|
+
autorequire:
|
13
|
+
bindir: bin
|
14
|
+
cert_chain: []
|
15
|
+
|
16
|
+
date: 2011-05-08 00:00:00 +10:00
|
17
|
+
default_executable:
|
18
|
+
dependencies:
|
19
|
+
- !ruby/object:Gem::Dependency
|
20
|
+
name: bundler
|
21
|
+
prerelease: false
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 1
|
29
|
+
- 0
|
30
|
+
- 0
|
31
|
+
- rc
|
32
|
+
- 6
|
33
|
+
version: 1.0.0.rc.6
|
34
|
+
type: :development
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: thor
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: activesupport
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
version: "0"
|
60
|
+
type: :runtime
|
61
|
+
version_requirements: *id003
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: i18n
|
64
|
+
prerelease: false
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
segments:
|
71
|
+
- 0
|
72
|
+
version: "0"
|
73
|
+
type: :runtime
|
74
|
+
version_requirements: *id004
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: uuid
|
77
|
+
prerelease: false
|
78
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
79
|
+
none: false
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
segments:
|
84
|
+
- 0
|
85
|
+
version: "0"
|
86
|
+
type: :runtime
|
87
|
+
version_requirements: *id005
|
88
|
+
- !ruby/object:Gem::Dependency
|
89
|
+
name: watchr
|
90
|
+
prerelease: false
|
91
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
segments:
|
97
|
+
- 0
|
98
|
+
version: "0"
|
99
|
+
type: :runtime
|
100
|
+
version_requirements: *id006
|
101
|
+
- !ruby/object:Gem::Dependency
|
102
|
+
name: open4
|
103
|
+
prerelease: false
|
104
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
segments:
|
110
|
+
- 0
|
111
|
+
version: "0"
|
112
|
+
type: :runtime
|
113
|
+
version_requirements: *id007
|
114
|
+
- !ruby/object:Gem::Dependency
|
115
|
+
name: awesome_print
|
116
|
+
prerelease: false
|
117
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
segments:
|
123
|
+
- 0
|
124
|
+
version: "0"
|
125
|
+
type: :runtime
|
126
|
+
version_requirements: *id008
|
127
|
+
description: "Project starter for Haskell: sets up CI & github integration, along with best-practice stuff like tests and hlint"
|
128
|
+
email:
|
129
|
+
- mwotton@gmail.com
|
130
|
+
executables:
|
131
|
+
- instigate
|
132
|
+
extensions: []
|
133
|
+
|
134
|
+
extra_rdoc_files: []
|
135
|
+
|
136
|
+
files:
|
137
|
+
- .bundle/config
|
138
|
+
- .gitignore
|
139
|
+
- Gemfile
|
140
|
+
- Gemfile.lock
|
141
|
+
- LICENSE
|
142
|
+
- README.md
|
143
|
+
- Rakefile
|
144
|
+
- TODO
|
145
|
+
- bin/instigate
|
146
|
+
- instigator.gemspec
|
147
|
+
- lib/app.rb
|
148
|
+
- lib/git_config.rb
|
149
|
+
- lib/github.rb
|
150
|
+
- lib/haskell.rb
|
151
|
+
- lib/instigator/util.rb
|
152
|
+
- lib/instigator/version.rb
|
153
|
+
- lib/jenkins.rb
|
154
|
+
- lib/sinatra.rb
|
155
|
+
- tasks/app.thor
|
156
|
+
- templates/README.tt
|
157
|
+
- templates/cabal.tt
|
158
|
+
- templates/config_xml.tt
|
159
|
+
- templates/module.tt
|
160
|
+
- templates/test.tt
|
161
|
+
- templates/watchr.tt
|
162
|
+
has_rdoc: true
|
163
|
+
homepage: http://rubygems.org/gems/instigator
|
164
|
+
licenses: []
|
165
|
+
|
166
|
+
post_install_message:
|
167
|
+
rdoc_options: []
|
168
|
+
|
169
|
+
require_paths:
|
170
|
+
- lib
|
171
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
172
|
+
none: false
|
173
|
+
requirements:
|
174
|
+
- - ">="
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
segments:
|
177
|
+
- 0
|
178
|
+
version: "0"
|
179
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
|
+
none: false
|
181
|
+
requirements:
|
182
|
+
- - ">="
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
segments:
|
185
|
+
- 1
|
186
|
+
- 3
|
187
|
+
- 6
|
188
|
+
version: 1.3.6
|
189
|
+
requirements: []
|
190
|
+
|
191
|
+
rubyforge_project: instigator
|
192
|
+
rubygems_version: 1.3.7
|
193
|
+
signing_key:
|
194
|
+
specification_version: 3
|
195
|
+
summary: Project starter for Haskell
|
196
|
+
test_files: []
|
197
|
+
|