ktec-subtrac 0.1.28 → 0.1.33
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +0 -1
- data/VERSION.yml +1 -1
- data/lib/subtrac/apache/location.conf.erb +16 -0
- data/lib/subtrac/{templates → apache}/vhost.conf.erb +2 -2
- data/lib/subtrac/apache.rb +47 -0
- data/lib/subtrac/client.rb +9 -0
- data/lib/subtrac/config/config.yml +6 -11
- data/lib/subtrac/core_ext/file.rb +12 -0
- data/lib/subtrac/core_ext.rb +1 -0
- data/lib/subtrac/{templates/projects → project}/blank/svn/branches/README +0 -0
- data/lib/subtrac/{templates/projects → project}/blank/svn/tags/README +0 -0
- data/lib/subtrac/{templates/projects → project}/blank/svn/trunk/README +0 -0
- data/lib/subtrac/{templates/projects → project}/blank/trac/wiki/WikiStart +5 -5
- data/lib/subtrac/{templates/projects → project}/new/svn/trunk/trac/wiki/WikiStart +4 -4
- data/lib/subtrac/{templates/projects → project}/new/trac/wiki/WikiStart +4 -4
- data/lib/subtrac/project.rb +14 -0
- data/lib/subtrac/svn.rb +56 -0
- data/lib/subtrac/template.rb +18 -0
- data/lib/subtrac/trac/common.trac.ini.erb +163 -0
- data/lib/subtrac/{templates → trac}/trac.ini.erb +2 -2
- data/lib/subtrac/trac.rb +64 -0
- data/lib/subtrac.rb +75 -196
- metadata +20 -122
- data/lib/subtrac/common/static/404.html +0 -14
- data/lib/subtrac/common/styles/trac.css +0 -222
- data/lib/subtrac/templates/location.erb +0 -16
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/__init__.py +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/bg.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/bg_page.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/bg_page_in.jpg +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/btn_more.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/col_bg.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/col_title_bg.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/col_top.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/content_article_bg.jpg +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/content_title_bg.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/footer.jpg +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/header.jpg +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/ico_archive.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/ico_archive2.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/ico_cat.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/ico_comments.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/ico_date.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/ico_links.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/ico_list.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/ico_rss.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/ico_top.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/ico_user.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/search_input.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/search_submit.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/tab_active_l.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/tab_active_r.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/tab_hover.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/tab_hover_l.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/tab_hover_r.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/tab_link.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/tab_link_l.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/tab_link_r.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/img/tmp_photo.gif +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/saint.css +0 -168
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/htdocs/screenshot.png +0 -0
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/templates/saint_theme.html +0 -143
- data/lib/subtrac/templates/trac/themes/sainttheme/crystalxtheme/theme.py +0 -12
- data/lib/subtrac/templates/trac/themes/sainttheme/setup.py +0 -29
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/css/subtrac.css +0 -1805
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/archive-li-first.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/archive-li-hover.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/archive-li-last.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/archive-li.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/archive.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/body-home.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/body.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/content-product.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/content.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/entry.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/footer.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/gallery-nav.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/header.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/inner.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/logo.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/master.css +0 -1805
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/masthead.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/more.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/nav-a-first.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/nav-a-last.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/nav-a.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/nav-li.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/products-li-large.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/products-li.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/rss-span.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/rss.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/search.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/sec-navigation-li.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/sec-navigation.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/slogan.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/wrapper-home.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/img/wrapper.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/prototype/subtractheme.html +0 -115
- data/lib/subtrac/templates/trac/themes/subtractheme/setup.py +0 -29
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/__init__.py +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/archive-li-first.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/archive-li-hover.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/archive-li-last.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/archive-li.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/archive.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/body-home.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/body.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/content-product.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/content.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/entry.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/footer.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/gallery-nav.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/header.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/inner.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/logo.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/master.css +0 -1805
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/masthead.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/more.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/nav-a-first.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/nav-a-last.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/nav-a.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/nav-li.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/products-li-large.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/products-li.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/rss-span.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/rss.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/search.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/sec-navigation-li.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/sec-navigation.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/slogan.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/wrapper-home.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/img/wrapper.png +0 -0
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/htdocs/subtrac.css +0 -1805
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/templates/subtrac_theme.html +0 -143
- data/lib/subtrac/templates/trac/themes/subtractheme/subtractheme/theme.py +0 -12
data/README.markdown
CHANGED
data/VERSION.yml
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
<location /<%= client.path %>>
|
2
|
+
SetHandler mod_python
|
3
|
+
PythonInterpreter main_interpreter
|
4
|
+
PythonHandler trac.web.modpython_frontend
|
5
|
+
PythonOption TracEnvParentDir <%= trac_dir %>/<%= client.path %>
|
6
|
+
PythonOption TracUriRoot /<%= client.path %>
|
7
|
+
PythonOption TracEnvIndexTemplate <%= trac_dir %>/<%= client.path %>/.theme/index/index.html
|
8
|
+
PythonOption PYTHON_EGG_CACHE <%= temp_dir %>
|
9
|
+
</location>
|
10
|
+
<location <%= svn_url %>/<%= client.path %>>
|
11
|
+
DAV svn
|
12
|
+
SVNParentPath <%= svn_dir %>/<%= client.path %>
|
13
|
+
SVNListParentPath On
|
14
|
+
SVNAutoversioning On
|
15
|
+
SVNReposName "<%= server_name %> for <%= client.display_name %>"
|
16
|
+
</location>
|
@@ -25,9 +25,9 @@
|
|
25
25
|
<% end %>
|
26
26
|
</location>
|
27
27
|
|
28
|
-
<location <%=
|
28
|
+
<location <%= svn_url %>>
|
29
29
|
DAV svn
|
30
|
-
SVNParentPath <%=
|
30
|
+
SVNParentPath <%= svn_dir %>/
|
31
31
|
SVNListParentPath On
|
32
32
|
SVNAutoversioning On
|
33
33
|
SVNReposName '<%= server_name %>'
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Copyright (c) 2009, Keith Salisbury (www.globalkeith.com)
|
3
|
+
# All rights reserved.
|
4
|
+
# All the apache stuff should go in here...
|
5
|
+
|
6
|
+
require 'subtrac/template'
|
7
|
+
|
8
|
+
module Subtrac
|
9
|
+
class Apache
|
10
|
+
def initialize(binding)
|
11
|
+
@apache_conf_dir = Subtrac::apache_conf_dir
|
12
|
+
@subtrac_path = Subtrac::subtrac_path
|
13
|
+
@server_hostname = Subtrac::server_hostname
|
14
|
+
@locations_dir = Subtrac::locations_dir
|
15
|
+
@binding = binding
|
16
|
+
end
|
17
|
+
def create_virtual_host()
|
18
|
+
puts "\n==== Creating new virtual host ===="
|
19
|
+
# TODO: Place a file in apache2 conf with Include directive which points to our conf folder
|
20
|
+
template = Template.new(File.join(File.dirname(__FILE__), "apache", "vhost.conf.erb"))
|
21
|
+
template.write(File.join(@apache_conf_dir,@server_hostname), @binding)
|
22
|
+
enable_site()
|
23
|
+
force_reload()
|
24
|
+
end
|
25
|
+
# creates the files necessary for a new client
|
26
|
+
def create_client(client)
|
27
|
+
client_config = File.join(@locations_dir,"#{client.path}.conf")
|
28
|
+
if (!File.exists?(client_config)) then
|
29
|
+
template = Template.new(File.join(File.dirname(__FILE__), "apache", "location.conf.erb"))
|
30
|
+
template.write(client_config,@binding)
|
31
|
+
force_reload()
|
32
|
+
end
|
33
|
+
end
|
34
|
+
def force_reload
|
35
|
+
# reload apache configuration
|
36
|
+
`/etc/init.d/apache2 force-reload` if SUBTRAC_ENV != 'test'
|
37
|
+
end
|
38
|
+
def enable_site
|
39
|
+
# tell apache enable site
|
40
|
+
`a2ensite #{@server_hostname}` if SUBTRAC_ENV != 'test'
|
41
|
+
end
|
42
|
+
def create_project(project)
|
43
|
+
# we dont need to do anything for each project, but we do need to ensure a client location exists
|
44
|
+
create_client(project.client)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -3,11 +3,13 @@ development: &non_production_settings
|
|
3
3
|
:admin_user: "admin"
|
4
4
|
:server_name: "Subtrac Development Server"
|
5
5
|
:server_hostname: "dev.subtrac.com"
|
6
|
-
|
7
|
-
:installation_dir: test
|
8
6
|
|
9
|
-
:
|
10
|
-
|
7
|
+
:urls:
|
8
|
+
:svn: "/svn"
|
9
|
+
|
10
|
+
:installation_dir: /var/subtrac
|
11
|
+
|
12
|
+
:default_project_type: "blank"
|
11
13
|
:default_client: "Subtrac"
|
12
14
|
:default_project: "Public"
|
13
15
|
:shared_trac_ini: "shared/trac.ini"
|
@@ -42,13 +44,6 @@ development: &non_production_settings
|
|
42
44
|
:conf: conf
|
43
45
|
:locations: locations
|
44
46
|
:temp: tmp
|
45
|
-
:urls:
|
46
|
-
:svn: "/svn"
|
47
|
-
:templates:
|
48
|
-
:virtual_host: "templates/vhost.conf.erb"
|
49
|
-
:location: "templates/location.erb"
|
50
|
-
:trac: "templates/trac.ini.erb"
|
51
|
-
:projects: "templates/projects"
|
52
47
|
|
53
48
|
test:
|
54
49
|
<<: *non_production_settings
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'subtrac/core_ext/file'
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,19 +1,19 @@
|
|
1
1
|
[[PageOutline]]
|
2
|
-
= Welcome to the <%= server_name %> for <%=
|
2
|
+
= Welcome to the <%= server_name %> for <%= project.display_name %> =
|
3
3
|
|
4
|
-
This is the home of development for <%=
|
4
|
+
This is the home of development for <%= client.display_name %>. This page is editable by design. That means YOU. If something is missing, fix it. This is what you make of it so get involved.
|
5
5
|
|
6
6
|
== Starting Points ==
|
7
7
|
|
8
|
-
* [<%= svn_url %>/<%=
|
9
|
-
* [<%= svn_url %>/<%=
|
8
|
+
* [<%= svn_url %>/<%= client.path %> Browse all <%= client.display_name %> SVN Repositories]
|
9
|
+
* [<%= svn_url %>/<%= client.path %>/<%= project.path %> Browse the <%= project.display_name %> repository]
|
10
10
|
|
11
11
|
=== How to check this project out ===
|
12
12
|
|
13
13
|
Make sure you have subversion client installed, then you can check the project out using:
|
14
14
|
|
15
15
|
{{{
|
16
|
-
svn checkout
|
16
|
+
svn checkout http://<%= server_hostname %>/<%= svn_url %>/<%= client.path %>/<%= project.path %>/trunk <%= project.path %>
|
17
17
|
}}}
|
18
18
|
|
19
19
|
=== Using SVN ===
|
@@ -1,19 +1,19 @@
|
|
1
1
|
[[PageOutline]]
|
2
|
-
= Welcome to the <%= server_name %> for <%=
|
2
|
+
= Welcome to the <%= server_name %> for <%= project.display_name %> =
|
3
3
|
|
4
4
|
This is the home of development for <%= client %>. This page is editable by design. That means YOU. If something is missing, fix it. This is what you make of it so get involved.
|
5
5
|
|
6
6
|
== Starting Points ==
|
7
7
|
|
8
|
-
* [<%= svn_url %>/<%=
|
9
|
-
* [<%= svn_url %>/<%=
|
8
|
+
* [<%= svn_url %>/<%= client.path %> Browse all <%= client.display_name %> SVN Repositories]
|
9
|
+
* [<%= svn_url %>/<%= client.path %>/<%= project.path %> Browse the <%= project.display_name %> repository]
|
10
10
|
|
11
11
|
=== How to check this project out ===
|
12
12
|
|
13
13
|
Make sure you have subversion client installed, then you can check the project out using:
|
14
14
|
|
15
15
|
{{{
|
16
|
-
svn checkout <%= svn_url %>/<%=
|
16
|
+
svn checkout <%= svn_url %>/<%= client.path %>/<%= project.path %>/trunk <%= project.path %>
|
17
17
|
}}}
|
18
18
|
|
19
19
|
=== Using SVN ===
|
@@ -1,19 +1,19 @@
|
|
1
1
|
[[PageOutline]]
|
2
|
-
= Welcome to the <%= server_name %> for <%=
|
2
|
+
= Welcome to the <%= server_name %> for <%= project.display_name %> =
|
3
3
|
|
4
4
|
This is the home of development for <%= client %>. This page is editable by design. That means YOU. If something is missing, fix it. This is what you make of it so get involved.
|
5
5
|
|
6
6
|
== Starting Points ==
|
7
7
|
|
8
|
-
* [<%= svn_url %>/<%=
|
9
|
-
* [<%= svn_url %>/<%=
|
8
|
+
* [<%= svn_url %>/<%= client.path %> Browse all <%= client.display_name %> SVN Repositories]
|
9
|
+
* [<%= svn_url %>/<%= client.path %>/<%= project.path %> Browse the <%= project.display_name %> repository]
|
10
10
|
|
11
11
|
=== How to check this project out ===
|
12
12
|
|
13
13
|
Make sure you have subversion client installed, then you can check the project out using:
|
14
14
|
|
15
15
|
{{{
|
16
|
-
svn checkout
|
16
|
+
svn checkout http://<%= server_hostname %>/<%= svn_url %>/<%= client.path %>/<%= project.path %>/trunk <%= project.path %>
|
17
17
|
}}}
|
18
18
|
|
19
19
|
=== Using SVN ===
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'subtrac/client'
|
2
|
+
module Subtrac
|
3
|
+
class Project
|
4
|
+
attr_reader :display_name, :path, :client, :type, :template
|
5
|
+
attr_accessor :svn_dir, :trac_dir
|
6
|
+
def initialize(project_name,client_name,project_type)
|
7
|
+
@display_name = project_name.gsub(/^[a-z]|\s+[a-z]/) { |a| a.upcase }
|
8
|
+
@path = project_name.downcase
|
9
|
+
@client = Client.new(client_name)
|
10
|
+
@type = project_type
|
11
|
+
@template = File.join(File.dirname(__FILE__), "project", project_type)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/subtrac/svn.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Copyright (c) 2009, Keith Salisbury (www.globalkeith.com)
|
3
|
+
# All rights reserved.
|
4
|
+
# All the svn stuff should go in here...
|
5
|
+
|
6
|
+
require 'fileutils'
|
7
|
+
|
8
|
+
module Subtrac
|
9
|
+
class Svn
|
10
|
+
|
11
|
+
def initialize(svn_dir, binding)
|
12
|
+
# create svn directory if required
|
13
|
+
@svn_dir = svn_dir
|
14
|
+
File.create_if_missing(@svn_dir)
|
15
|
+
@temp_dir = Subtrac::temp_dir
|
16
|
+
@binding = binding
|
17
|
+
end
|
18
|
+
|
19
|
+
# creates a new svn repository for the project
|
20
|
+
def create_project(project)
|
21
|
+
|
22
|
+
# get the client for this project
|
23
|
+
client = project.client
|
24
|
+
|
25
|
+
# create the client folder
|
26
|
+
File.create_if_missing(File.join(@svn_dir,client.path))
|
27
|
+
|
28
|
+
# create the project folder
|
29
|
+
project.svn_dir = File.join(@svn_dir,client.path,project.path)
|
30
|
+
|
31
|
+
# TODO: Need to handle this exception...
|
32
|
+
if (File.directory? project.svn_dir) then
|
33
|
+
raise StandardError, "A project called #{project} already exists in the #{client} repository. Please delete it or choose an alternate project name and run this script again."
|
34
|
+
end
|
35
|
+
|
36
|
+
# create a new subversion repository
|
37
|
+
say("Creating a new subversion repository...")
|
38
|
+
`svnadmin create #{project.svn_dir}`
|
39
|
+
|
40
|
+
# copy template svn project to a temp folder, then svn import it into the repo
|
41
|
+
say("Create temporary project directory and copy template files...")
|
42
|
+
svn_template_dir = File.join(project.template,"svn")
|
43
|
+
project_temp_dir = File.join(@temp_dir,project.path)
|
44
|
+
FileUtils.cp_r(svn_template_dir,project_temp_dir)
|
45
|
+
|
46
|
+
# import into svn
|
47
|
+
say("Importing temporary project into the new subversion repository...")
|
48
|
+
`svn import #{project_temp_dir} file:///#{project.svn_dir} --message "initial import"`
|
49
|
+
|
50
|
+
# delete the temporary directory
|
51
|
+
FileUtils.rm_r(project_temp_dir, :force => true)
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Subtrac
|
2
|
+
class Template
|
3
|
+
def initialize(template)
|
4
|
+
@template = template
|
5
|
+
end
|
6
|
+
def render(binding)
|
7
|
+
ERB.new(IO.read(@template)).result(binding)
|
8
|
+
end
|
9
|
+
def write(outfile,binding)
|
10
|
+
file = File.open(outfile, 'w+')
|
11
|
+
if file
|
12
|
+
file.syswrite(render(binding))
|
13
|
+
else
|
14
|
+
raise "Unable to open file for writing. file #{outfile}"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,163 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
[attachment]
|
4
|
+
max_size = 262144
|
5
|
+
render_unsafe_content = false
|
6
|
+
|
7
|
+
[browser]
|
8
|
+
color_scale = True
|
9
|
+
downloadable_paths = /trunk, /branches/*, /tags/*
|
10
|
+
hide_properties = svk:merge
|
11
|
+
intermediate_color =
|
12
|
+
intermediate_point =
|
13
|
+
newest_color = (255, 136, 136)
|
14
|
+
oldest_color = (136, 136, 255)
|
15
|
+
oneliner_properties = trac:summary
|
16
|
+
render_unsafe_content = false
|
17
|
+
wiki_properties = trac:description
|
18
|
+
|
19
|
+
[changeset]
|
20
|
+
max_diff_bytes = 10000000
|
21
|
+
max_diff_files = 0
|
22
|
+
wiki_format_messages = true
|
23
|
+
|
24
|
+
[inherit]
|
25
|
+
plugins_dir =
|
26
|
+
templates_dir =
|
27
|
+
|
28
|
+
[logging]
|
29
|
+
log_file = trac.log
|
30
|
+
# log_format = <inherited>
|
31
|
+
log_level = DEBUG
|
32
|
+
log_type = none
|
33
|
+
|
34
|
+
[milestone]
|
35
|
+
stats_provider = DefaultTicketGroupStatsProvider
|
36
|
+
|
37
|
+
[mimeviewer]
|
38
|
+
enscript_modes = text/x-dylan:dylan:4
|
39
|
+
enscript_path = enscript
|
40
|
+
max_preview_size = 262144
|
41
|
+
mime_map = text/x-dylan:dylan,text/x-idl:ice,text/x-ada:ads:adb
|
42
|
+
php_path = php
|
43
|
+
tab_width = 8
|
44
|
+
|
45
|
+
[notification]
|
46
|
+
admit_domains =
|
47
|
+
always_notify_owner = false
|
48
|
+
always_notify_reporter = false
|
49
|
+
always_notify_updater = true
|
50
|
+
ignore_domains =
|
51
|
+
mime_encoding = base64
|
52
|
+
smtp_always_bcc =
|
53
|
+
smtp_always_cc =
|
54
|
+
smtp_default_domain =
|
55
|
+
smtp_enabled = false
|
56
|
+
smtp_from = trac@localhost
|
57
|
+
smtp_from_name =
|
58
|
+
smtp_password =
|
59
|
+
smtp_port = 25
|
60
|
+
smtp_replyto = trac@localhost
|
61
|
+
smtp_server = localhost
|
62
|
+
smtp_subject_prefix = __default__
|
63
|
+
smtp_user =
|
64
|
+
ticket_subject_template = $prefix #$ticket.id: $summary
|
65
|
+
use_public_cc = false
|
66
|
+
use_short_addr = false
|
67
|
+
use_tls = false
|
68
|
+
|
69
|
+
[query]
|
70
|
+
default_anonymous_query = status!=closed&cc~=$USER
|
71
|
+
default_query = status!=closed&owner=$USER
|
72
|
+
items_per_page = 100
|
73
|
+
|
74
|
+
[report]
|
75
|
+
items_per_page = 100
|
76
|
+
items_per_page_rss = 0
|
77
|
+
|
78
|
+
[revisionlog]
|
79
|
+
default_log_limit = 100
|
80
|
+
|
81
|
+
[roadmap]
|
82
|
+
stats_provider = DefaultTicketGroupStatsProvider
|
83
|
+
|
84
|
+
[search]
|
85
|
+
min_query_length = 3
|
86
|
+
|
87
|
+
[svn]
|
88
|
+
branches = trunk,branches/*
|
89
|
+
tags = tags/*
|
90
|
+
|
91
|
+
[ticket]
|
92
|
+
default_cc =
|
93
|
+
default_component =
|
94
|
+
default_description =
|
95
|
+
default_keywords =
|
96
|
+
default_milestone =
|
97
|
+
default_owner =
|
98
|
+
default_priority = major
|
99
|
+
default_resolution = fixed
|
100
|
+
default_severity =
|
101
|
+
default_summary =
|
102
|
+
default_type = defect
|
103
|
+
default_version =
|
104
|
+
max_comment_size = 262144
|
105
|
+
max_description_size = 262144
|
106
|
+
preserve_newlines = default
|
107
|
+
restrict_owner = false
|
108
|
+
workflow = ConfigurableTicketWorkflow
|
109
|
+
|
110
|
+
[ticket-workflow]
|
111
|
+
accept = new,assigned,accepted,reopened -> accepted
|
112
|
+
accept.operations = set_owner_to_self
|
113
|
+
accept.permissions = TICKET_MODIFY
|
114
|
+
leave = * -> *
|
115
|
+
leave.default = 1
|
116
|
+
leave.operations = leave_status
|
117
|
+
reassign = new,assigned,accepted,reopened -> assigned
|
118
|
+
reassign.operations = set_owner
|
119
|
+
reassign.permissions = TICKET_MODIFY
|
120
|
+
reopen = closed -> reopened
|
121
|
+
reopen.operations = del_resolution
|
122
|
+
reopen.permissions = TICKET_CREATE
|
123
|
+
resolve = new,assigned,accepted,reopened -> closed
|
124
|
+
resolve.operations = set_resolution
|
125
|
+
resolve.permissions = TICKET_MODIFY
|
126
|
+
|
127
|
+
[timeline]
|
128
|
+
abbreviated_messages = True
|
129
|
+
changeset_collapse_events = false
|
130
|
+
changeset_long_messages = false
|
131
|
+
changeset_show_files = 0
|
132
|
+
default_daysback = 30
|
133
|
+
max_daysback = 90
|
134
|
+
newticket_formatter = oneliner
|
135
|
+
ticket_show_details = false
|
136
|
+
|
137
|
+
[trac]
|
138
|
+
authz_file =
|
139
|
+
authz_module_name =
|
140
|
+
auto_reload = False
|
141
|
+
base_url =
|
142
|
+
check_auth_ip = false
|
143
|
+
database = sqlite:db/trac.db
|
144
|
+
default_charset = iso-8859-15
|
145
|
+
htdocs_location =
|
146
|
+
ignore_auth_case = false
|
147
|
+
mainnav = wiki,timeline,roadmap,browser,tickets,newticket,search
|
148
|
+
metanav = login,logout,prefs,help,about
|
149
|
+
permission_policies = DefaultPermissionPolicy, LegacyAttachmentPolicy
|
150
|
+
permission_store = DefaultPermissionStore
|
151
|
+
repository_type = svn
|
152
|
+
secure_cookies = False
|
153
|
+
show_email_addresses = false
|
154
|
+
show_ip_addresses = false
|
155
|
+
timeout = 20
|
156
|
+
use_base_url_for_redirect = False
|
157
|
+
|
158
|
+
[wiki]
|
159
|
+
ignore_missing_pages = false
|
160
|
+
max_size = 262144
|
161
|
+
render_unsafe_content = false
|
162
|
+
split_page_names = false
|
163
|
+
|