ktec-subtrac 0.1.46 → 0.1.47
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/VERSION.yml +1 -1
- data/bin/subtrac +14 -4
- data/lib/subtrac/commands/create.rb +23 -5
- data/lib/subtrac/commands/create_template.rb +11 -0
- data/lib/subtrac/commands/install.rb +0 -1
- data/lib/subtrac/commands.rb +1 -0
- data/lib/subtrac/config/config.yml +1 -2
- data/lib/subtrac/config.rb +5 -11
- data/lib/subtrac/project/template/svn/trunk/svn/branches/README +0 -0
- data/lib/subtrac/project/template/svn/trunk/svn/tags/README +0 -0
- data/lib/subtrac/project/template/svn/trunk/svn/trunk/README +1 -0
- data/lib/subtrac/project/{new → template/svn/trunk}/trac/wiki/WikiStart +22 -1
- data/lib/subtrac/project/template/trac/wiki/WikiStart +60 -0
- data/lib/subtrac/project.rb +26 -5
- data/lib/subtrac/svn.rb +2 -11
- data/lib/subtrac/trac.rb +1 -2
- data/lib/subtrac.rb +118 -107
- metadata +8 -4
- data/lib/subtrac/project/new/svn/trunk/trac/wiki/WikiStart +0 -31
data/VERSION.yml
CHANGED
data/bin/subtrac
CHANGED
@@ -23,13 +23,23 @@ end
|
|
23
23
|
command :create do |c|
|
24
24
|
c.syntax = 'subtrac create [options]'
|
25
25
|
c.summary = 'Creates a new Subversion repository and associated Trac site for to specified project and client.'
|
26
|
-
c.description = 'Creates a new Subversion repository and associated Trac site for
|
27
|
-
c.example 'subtrac create', 'Creates a new project.'
|
28
|
-
c.option '-p','--project PROJECT', 'Name of project to create'
|
29
|
-
c.option '-c','--client CLIENT', 'Name of client to create the project for'
|
26
|
+
c.description = 'Creates a new Subversion repository and associated Trac site for the specified project and client.'
|
27
|
+
c.example 'subtrac create -p new_project -c subtrac', 'Creates a new project called "new_project" in the "subtrac" client group.'
|
28
|
+
c.option '-p','--project PROJECT', 'Name of project to create.'
|
29
|
+
c.option '-c','--client CLIENT', 'Name of client to create the project for.'
|
30
|
+
c.option '-t','--template TEMPLATE', 'Name of template to use when creating the project.'
|
30
31
|
c.when_called Subtrac::Commands::Create
|
31
32
|
end
|
32
33
|
|
34
|
+
command :create_template do |c|
|
35
|
+
c.syntax = 'subtrac create_template [options]'
|
36
|
+
c.summary = 'Creates a new Subversion repository and associated Trac site for to specified project template.'
|
37
|
+
c.description = 'Creates a new Subversion repository and associated Trac site for the specified project template and client.'
|
38
|
+
c.example 'subtrac create as3_template', 'Creates a new project template called "as3_template".'
|
39
|
+
c.option '-t','--template TEMPLATE', 'Name of project template to create.'
|
40
|
+
c.when_called Subtrac::Commands::CreateTemplate
|
41
|
+
end
|
42
|
+
|
33
43
|
=begin
|
34
44
|
command :delete do |c|
|
35
45
|
c.syntax = 'subtrac delete [options]'
|
@@ -2,11 +2,29 @@ module Subtrac
|
|
2
2
|
module Commands
|
3
3
|
class Create
|
4
4
|
def initialize(args, options)
|
5
|
-
options.project = ask("What is the name of the project you would like to create? ") if
|
6
|
-
options.client = ask("Which client is this project for? ") if
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
options.project = ask("What is the name of the project you would like to create? ") if options.project.nil?
|
6
|
+
options.client = ask("Which client is this project for? ") if options.client.nil?
|
7
|
+
use_custom_template = agree("Would you like to use a custom template for this project? [y/n]") if options.template.nil?
|
8
|
+
if use_custom_template then
|
9
|
+
Subtrac.load_config()
|
10
|
+
list_of_templates = Dir.entries(File.join(Config.svn_dir,"templates"))
|
11
|
+
|
12
|
+
# The new and improved choose()...
|
13
|
+
#choices = %{#{list_of_templates}} # %w{ruby python perl}
|
14
|
+
say("\nThis is the new mode (default)...")
|
15
|
+
choose do |menu|
|
16
|
+
menu.prompt = "Which template would you like to use for this project? "
|
17
|
+
list_of_templates.each do |t|
|
18
|
+
unless File.directory?(t)
|
19
|
+
menu.choice t do options.template = t end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
Subtrac.create_project(options.project,options.client,options.template)
|
25
|
+
else
|
26
|
+
Subtrac.create_project(options.project,options.client)
|
27
|
+
end
|
10
28
|
end
|
11
29
|
end
|
12
30
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Subtrac
|
2
|
+
module Commands
|
3
|
+
class CreateTemplate
|
4
|
+
def initialize(args, options)
|
5
|
+
options.project = ask("What is the name of the template project you would like to create? ") if options.project.nil?
|
6
|
+
options.client = "templates"
|
7
|
+
Subtrac.create_project(options.project,options.client,"template")
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/subtrac/commands.rb
CHANGED
@@ -9,12 +9,11 @@ development: &non_production_settings
|
|
9
9
|
|
10
10
|
:installation_dir: /var/subtrac
|
11
11
|
|
12
|
-
:default_project_type: "blank"
|
13
12
|
:default_client: "Subtrac"
|
14
13
|
:default_project: "Public"
|
15
14
|
|
16
15
|
:apache_conf_dir: /etc/apache2/sites-available
|
17
|
-
|
16
|
+
|
18
17
|
:ldap:
|
19
18
|
:enable: false
|
20
19
|
:host:
|
data/lib/subtrac/config.rb
CHANGED
@@ -21,6 +21,10 @@ module Subtrac
|
|
21
21
|
binding
|
22
22
|
end
|
23
23
|
|
24
|
+
def loaded?
|
25
|
+
@loaded ||= false
|
26
|
+
end
|
27
|
+
|
24
28
|
# Loads the configuration YML file
|
25
29
|
def load
|
26
30
|
# TODO: We need to refactor this code so it will load the default configuration only if one has not been created
|
@@ -37,6 +41,7 @@ module Subtrac
|
|
37
41
|
if yamlFile
|
38
42
|
if yamlFile[SUBTRAC_ENV]
|
39
43
|
@data = yamlFile[SUBTRAC_ENV]
|
44
|
+
@loaded = true
|
40
45
|
else
|
41
46
|
raise StandardError, "config/config.yml exists, but doesn't have a configuration for #{SUBTRAC_ENV}."
|
42
47
|
end
|
@@ -112,20 +117,9 @@ module Subtrac
|
|
112
117
|
end
|
113
118
|
|
114
119
|
def default_project=(name)
|
115
|
-
puts "Updating default_project to #{name}"
|
116
120
|
@data[:default_project] = @default_project = name
|
117
121
|
end
|
118
122
|
|
119
|
-
def default_project_type
|
120
|
-
@default_project_type ||= @data[:default_project_type]
|
121
|
-
end
|
122
|
-
|
123
|
-
def default_project_type=(name)
|
124
|
-
puts "Updating default_project_type to #{name}"
|
125
|
-
@data[:default_project_type] = @default_project_type = name
|
126
|
-
end
|
127
|
-
|
128
|
-
|
129
123
|
# Filesystem directories
|
130
124
|
def root
|
131
125
|
Pathname.new(SUBTRAC_ROOT) if defined?(SUBTRAC_ROOT)
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
project: ${project.display_name}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
[[PageOutline]]
|
2
2
|
= Welcome to the <%= server_name %> for <%= project.display_name %> =
|
3
3
|
|
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.
|
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
|
|
@@ -30,6 +30,27 @@ svn import . http://<%= server_hostname %><%= svn_url %>/<%= client.path %>/<%=
|
|
30
30
|
* [http://scplugin.tigris.org/ For OS X use SCPlugin]
|
31
31
|
* [http://theappleblog.com/2009/02/23/12-subversion-apps-for-os-x/ There's loads more if you don't like these]
|
32
32
|
|
33
|
+
= About Trac =
|
34
|
+
|
35
|
+
Trac is a '''minimalistic''' approach to '''web-based''' management of
|
36
|
+
'''software projects'''. Its goal is to simplify effective tracking and handling of software issues, enhancements and overall progress.
|
37
|
+
|
38
|
+
All aspects of Trac have been designed with the single goal to
|
39
|
+
'''help developers write great software''' while '''staying out of the way'''
|
40
|
+
and imposing as little as possible on a team's established process and
|
41
|
+
culture.
|
42
|
+
|
43
|
+
As all Wiki pages, this page is editable, this means that you can
|
44
|
+
modify the contents of this page simply by using your
|
45
|
+
web-browser. Simply click on the "Edit this page" link at the bottom
|
46
|
+
of the page. WikiFormatting will give you a detailed description of
|
47
|
+
available Wiki formatting commands.
|
48
|
+
|
49
|
+
TracGuide is a good place to start.
|
50
|
+
|
51
|
+
Enjoy! [[BR]]
|
52
|
+
''The Saint Team''
|
53
|
+
|
33
54
|
== Starting Points ==
|
34
55
|
|
35
56
|
* TracGuide -- Built-in Documentation
|
@@ -0,0 +1,60 @@
|
|
1
|
+
[[PageOutline]]
|
2
|
+
= Welcome to the <%= server_name %> for <%= project.display_name %> =
|
3
|
+
|
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
|
+
|
6
|
+
== Starting Points ==
|
7
|
+
|
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
|
+
|
11
|
+
=== How to check this project out ===
|
12
|
+
|
13
|
+
Make sure you have subversion client installed, then you can check the project out using:
|
14
|
+
|
15
|
+
{{{
|
16
|
+
svn checkout http://<%= server_hostname %><%= svn_url %>/<%= client.path %>/<%= project.path %>/trunk <%= project.path %>
|
17
|
+
}}}
|
18
|
+
|
19
|
+
=== How to import existing files into this repository ===
|
20
|
+
|
21
|
+
The following example will import all files in the current directory into the repository.
|
22
|
+
|
23
|
+
{{{
|
24
|
+
svn import . http://<%= server_hostname %><%= svn_url %>/<%= client.path %>/<%= project.path %>/trunk -m "initial import"
|
25
|
+
}}}
|
26
|
+
|
27
|
+
=== Using SVN ===
|
28
|
+
|
29
|
+
* [http://tortoisesvn.tigris.org/ For Windows use Tortoise SVN]
|
30
|
+
* [http://scplugin.tigris.org/ For OS X use SCPlugin]
|
31
|
+
* [http://theappleblog.com/2009/02/23/12-subversion-apps-for-os-x/ There's loads more if you don't like these]
|
32
|
+
|
33
|
+
= About Trac =
|
34
|
+
|
35
|
+
Trac is a '''minimalistic''' approach to '''web-based''' management of
|
36
|
+
'''software projects'''. Its goal is to simplify effective tracking and handling of software issues, enhancements and overall progress.
|
37
|
+
|
38
|
+
All aspects of Trac have been designed with the single goal to
|
39
|
+
'''help developers write great software''' while '''staying out of the way'''
|
40
|
+
and imposing as little as possible on a team's established process and
|
41
|
+
culture.
|
42
|
+
|
43
|
+
As all Wiki pages, this page is editable, this means that you can
|
44
|
+
modify the contents of this page simply by using your
|
45
|
+
web-browser. Simply click on the "Edit this page" link at the bottom
|
46
|
+
of the page. WikiFormatting will give you a detailed description of
|
47
|
+
available Wiki formatting commands.
|
48
|
+
|
49
|
+
TracGuide is a good place to start.
|
50
|
+
|
51
|
+
Enjoy! [[BR]]
|
52
|
+
''The Saint Team''
|
53
|
+
|
54
|
+
== Starting Points ==
|
55
|
+
|
56
|
+
* TracGuide -- Built-in Documentation
|
57
|
+
* [http://trac.edgewall.org/wiki/TracFaq Trac FAQ] -- Frequently Asked Questions
|
58
|
+
* TracSupport -- Trac Support
|
59
|
+
|
60
|
+
For a complete list of local wiki pages, see TitleIndex.
|
data/lib/subtrac/project.rb
CHANGED
@@ -1,14 +1,35 @@
|
|
1
1
|
require 'subtrac/client'
|
2
2
|
module Subtrac
|
3
3
|
class Project
|
4
|
-
attr_reader :display_name, :path, :client, :
|
5
|
-
attr_accessor :svn_dir, :trac_dir
|
6
|
-
def initialize(project_name,client_name,
|
4
|
+
attr_reader :display_name, :path, :client, :template
|
5
|
+
attr_accessor :svn_dir, :trac_dir#, :temp_dir
|
6
|
+
def initialize(project_name,client_name,template)
|
7
7
|
@display_name = project_name.gsub(/^[a-z]|\s+[a-z]/) { |a| a.upcase }
|
8
8
|
@path = project_name.downcase
|
9
9
|
@client = Client.new(client_name)
|
10
|
-
@
|
11
|
-
|
10
|
+
@template = File.join(File.dirname(__FILE__), "project", template)
|
11
|
+
#@template = template
|
12
|
+
unless File.exists?(@template)
|
13
|
+
# attempt download of remote template
|
14
|
+
template_location = "file://#{Config.svn_dir}/templates/#{template}/trunk"
|
15
|
+
@template = File.join(Config.temp_dir,template)
|
16
|
+
`svn export #{template_location} #{@template} --quiet --username #{Config.data[:admin_user]} --password #{Config.data[:admin_pass]}`
|
17
|
+
# replace the tokens in the project
|
18
|
+
glob_path, exp_search, exp_replace = "#{@template}/**","", @display_name
|
19
|
+
puts "Lets see what the filter has returned: #{Dir.glob(glob_path)}"
|
20
|
+
Dir.glob(glob_path).each do |file|
|
21
|
+
unless File.directory?(file) # only mess with files
|
22
|
+
buffer = File.new(file,'r').read.gsub(/\$\{project.display_name\}/,exp_replace)
|
23
|
+
puts buffer
|
24
|
+
File.open(file,'w') {|fw| fw.write(buffer)}
|
25
|
+
end
|
26
|
+
end
|
27
|
+
# TODO: We'll need to run through and do some renaming if necessary
|
28
|
+
end
|
29
|
+
end
|
30
|
+
def clear_temp
|
31
|
+
# delete the temporary directory
|
32
|
+
#FileUtils.rm_r(@temp_dir, :force => true)
|
12
33
|
end
|
13
34
|
end
|
14
35
|
end
|
data/lib/subtrac/svn.rb
CHANGED
@@ -26,25 +26,16 @@ module Subtrac
|
|
26
26
|
|
27
27
|
# TODO: Need to handle this exception...
|
28
28
|
if (File.directory? project.svn_dir) then
|
29
|
-
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."
|
29
|
+
raise StandardError, "A project called #{project.display_name} already exists in the #{client.display_name} repository. Please delete it or choose an alternate project name and run this script again."
|
30
30
|
end
|
31
31
|
|
32
32
|
# create a new subversion repository
|
33
33
|
say("Creating a new subversion repository...")
|
34
34
|
`svnadmin create #{project.svn_dir}`
|
35
35
|
|
36
|
-
# copy template svn project to a temp folder, then svn import it into the repo
|
37
|
-
say("Create temporary project directory and copy template files...")
|
38
|
-
svn_template_dir = File.join(project.template,"svn")
|
39
|
-
project_temp_dir = File.join(Config.temp_dir,project.path)
|
40
|
-
FileUtils.cp_r(svn_template_dir,project_temp_dir)
|
41
|
-
|
42
36
|
# import into svn
|
43
37
|
say("Importing temporary project into the new subversion repository...")
|
44
|
-
`svn import #{
|
45
|
-
|
46
|
-
# delete the temporary directory
|
47
|
-
FileUtils.rm_r(project_temp_dir, :force => true)
|
38
|
+
`svn import #{project.template}/svn file:///#{project.svn_dir} --message "initial import"`
|
48
39
|
|
49
40
|
# this should fix the 'can't open activity db error'
|
50
41
|
`sudo chmod 770 #{project.svn_dir}`
|
data/lib/subtrac/trac.rb
CHANGED
@@ -48,10 +48,9 @@ module Subtrac
|
|
48
48
|
`sudo trac-admin #{project.trac_dir} permission add #{key} #{value}`
|
49
49
|
end
|
50
50
|
|
51
|
-
say("Adding default trac wiki pages
|
51
|
+
say("Adding default trac wiki pages...#{project.template}")
|
52
52
|
# loop through the directory and import all pages
|
53
53
|
Dir.foreach("#{project.template}/trac/wiki/.") do |file|
|
54
|
-
# do something with the file here
|
55
54
|
unless ['.', '..','.svn'].include? file
|
56
55
|
temp_file = File.join(Config.temp_dir,file)
|
57
56
|
template = Template.new(File.join(project.template,"trac/wiki",file))
|
data/lib/subtrac.rb
CHANGED
@@ -45,142 +45,153 @@ module Subtrac
|
|
45
45
|
SUBTRAC_ROOT = "#{File.dirname(__FILE__)}/" unless defined?(SUBTRAC_ROOT)
|
46
46
|
SUBTRAC_ENV = (ENV['SUBTRAC_ENV'] || 'development').dup unless defined?(SUBTRAC_ENV)
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
class << self
|
49
|
+
|
50
|
+
# Loads the configuration YML file
|
51
|
+
def load_config
|
52
|
+
Config.load() if !Config.loaded?
|
53
|
+
end
|
52
54
|
|
53
|
-
|
54
|
-
|
55
|
-
|
55
|
+
# Install
|
56
|
+
def install(args,options)
|
57
|
+
|
58
|
+
load_config()
|
59
|
+
|
60
|
+
puts "\n==== Installing development server files ===="
|
56
61
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
62
|
+
if options.defaults then
|
63
|
+
overwrite = options.clean
|
64
|
+
confirm_default_client = true
|
65
|
+
else
|
66
|
+
# check where we are installing
|
67
|
+
Config.confirm_or_update(:install_dir,"install_dir")
|
63
68
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
+
unless !File.directory?(install_dir)
|
70
|
+
# Ask if the user agrees (yes or no)
|
71
|
+
confirm_clean = agree("Err, it seems there's some stuff in there. You sure you want me to overwrite? [Y/n]") if options.clean
|
72
|
+
overwrite = agree("Doubly sure? I can't undo this....[Y/n]") if confirm_clean
|
73
|
+
end
|
69
74
|
|
70
|
-
|
71
|
-
|
75
|
+
# confirm server
|
76
|
+
Config.confirm_or_update(:server_name,"server_name")
|
72
77
|
|
73
|
-
|
74
|
-
|
78
|
+
# ask for hostname
|
79
|
+
Config.confirm_or_update(:server_hostname,"server_hostname")
|
75
80
|
|
76
|
-
|
77
|
-
|
78
|
-
|
81
|
+
# default client/project name
|
82
|
+
Config.confirm_or_update(:default_client,"default_client")
|
83
|
+
Config.confirm_or_update(:default_project,"default_project")
|
79
84
|
|
80
|
-
|
85
|
+
end
|
81
86
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
87
|
+
say("Ok we're about to install now, these are the options you have chosen:
|
88
|
+
installation directory: #{Config.install_dir}
|
89
|
+
overwrite: #{overwrite}
|
90
|
+
server name: #{Config.server_name}
|
91
|
+
server hostname: #{Config.server_hostname}
|
92
|
+
default client: #{Config.default_client}
|
93
|
+
default project: #{Config.default_project}")
|
94
|
+
|
95
|
+
confirm = agree("Is this ok? [y/n]")
|
91
96
|
|
92
|
-
|
97
|
+
exit 0 if !confirm
|
93
98
|
|
94
|
-
|
99
|
+
create_environment_directories(overwrite)
|
95
100
|
|
96
|
-
|
97
|
-
|
98
|
-
|
101
|
+
#create a new virtual host
|
102
|
+
apache = Apache.new
|
103
|
+
apache.create_virtual_host()
|
99
104
|
|
100
|
-
|
101
|
-
|
102
|
-
|
105
|
+
# create the trac site
|
106
|
+
trac = Trac.new
|
107
|
+
trac.install_common_files()
|
103
108
|
|
104
|
-
|
105
|
-
|
109
|
+
install_common_files()
|
110
|
+
configure_admin_user()
|
106
111
|
|
107
|
-
|
108
|
-
|
112
|
+
# create default project
|
113
|
+
create_project(Config.default_project,Config.default_client)
|
109
114
|
|
110
|
-
|
111
|
-
|
115
|
+
# store any user preferences for later use
|
116
|
+
Config.save()
|
112
117
|
|
113
|
-
|
118
|
+
end
|
114
119
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
120
|
+
def create_project(project,client,template="blank")
|
121
|
+
|
122
|
+
load_config()
|
123
|
+
|
124
|
+
# create default project
|
125
|
+
project = Project.new(project,client,template)
|
119
126
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
127
|
+
# get these out for binding...we'll tidy up later
|
128
|
+
#client = project.client
|
129
|
+
Config.project = project
|
130
|
+
Config.client = project.client
|
131
|
+
|
132
|
+
# create the svn repo
|
133
|
+
svn = Svn.new
|
134
|
+
svn.create_project(project)
|
128
135
|
|
129
|
-
|
130
|
-
|
131
|
-
|
136
|
+
# create the trac site
|
137
|
+
trac = Trac.new
|
138
|
+
trac.create_project(project)
|
132
139
|
|
133
|
-
|
134
|
-
|
135
|
-
|
140
|
+
# create the apache configuration
|
141
|
+
apache = Apache.new
|
142
|
+
apache.create_project(project)
|
143
|
+
|
144
|
+
project.clear_temp()
|
136
145
|
|
137
|
-
|
138
|
-
|
146
|
+
# fix privileges
|
147
|
+
give_apache_privileges()
|
139
148
|
|
140
|
-
|
149
|
+
end
|
141
150
|
|
142
|
-
|
151
|
+
private
|
143
152
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
153
|
+
def give_apache_privileges
|
154
|
+
# make sure apache can operate on these files
|
155
|
+
`sudo chown -R www-data:www-data #{Config.install_dir}`
|
156
|
+
end
|
148
157
|
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
158
|
+
def install_common_files
|
159
|
+
puts "\n==== Installing common files ===="
|
160
|
+
# TODO: implement a mask for .svn folders
|
161
|
+
# TODO: refactor /common to the app config
|
162
|
+
FileUtils.cp_r(Dir.glob(File.join(Config.subtrac_path, "common/.")),Config.docs_dir)
|
163
|
+
end
|
155
164
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
165
|
+
def configure_admin_user
|
166
|
+
puts "\n==== Configure admin user ===="
|
167
|
+
# create admin user
|
168
|
+
admin_user = ask("New admin user: ") { |q| q.echo = true }
|
169
|
+
admin_pass = ask("New password: ") { |q| q.echo = "*" }
|
170
|
+
admin_pass_confirm = ask("Re-type new password: ") { |q| q.echo = "*" }
|
171
|
+
if (admin_pass == admin_pass_confirm) then
|
172
|
+
passwd_file = File.join(Config.install_dir, ".passwd")
|
173
|
+
`htpasswd -c -b #{passwd_file} #{admin_user} #{admin_pass}`
|
174
|
+
Config.data[:admin_user] = admin_user
|
175
|
+
Config.data[:admin_pass] = admin_pass
|
176
|
+
# ensure this guy is added to trac admin group
|
177
|
+
Config.data[:trac][:permissions][admin_user] = "admins"
|
178
|
+
else
|
179
|
+
# call the password chooser again
|
180
|
+
configure_admin_user()
|
181
|
+
end
|
172
182
|
end
|
173
|
-
end
|
174
183
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
184
|
+
def create_environment_directories(overwrite=false)
|
185
|
+
puts "\n==== Creating new environment directories ===="
|
186
|
+
FileUtils.rm_rf Config.install_dir if overwrite
|
187
|
+
File.create_if_missing Config.install_dir
|
188
|
+
# create the environment directories
|
189
|
+
Config.data[:dirs].each do |key, value|
|
190
|
+
dir = File.join(Config.install_dir,value)
|
191
|
+
File.create_if_missing dir
|
192
|
+
end
|
183
193
|
end
|
194
|
+
|
184
195
|
end
|
185
196
|
|
186
197
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ktec-subtrac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keith Salisbury
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-05-
|
12
|
+
date: 2009-05-04 00:00:00 -07:00
|
13
13
|
default_executable: subtrac
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -44,6 +44,7 @@ files:
|
|
44
44
|
- lib/subtrac/client.rb
|
45
45
|
- lib/subtrac/commands.rb
|
46
46
|
- lib/subtrac/commands/create.rb
|
47
|
+
- lib/subtrac/commands/create_template.rb
|
47
48
|
- lib/subtrac/commands/install.rb
|
48
49
|
- lib/subtrac/common/favicon.ico
|
49
50
|
- lib/subtrac/common/images/trac/banner_bg.jpg
|
@@ -60,8 +61,11 @@ files:
|
|
60
61
|
- lib/subtrac/project/blank/svn/tags/README
|
61
62
|
- lib/subtrac/project/blank/svn/trunk/README
|
62
63
|
- lib/subtrac/project/blank/trac/wiki/WikiStart
|
63
|
-
- lib/subtrac/project/
|
64
|
-
- lib/subtrac/project/
|
64
|
+
- lib/subtrac/project/template/svn/trunk/svn/branches/README
|
65
|
+
- lib/subtrac/project/template/svn/trunk/svn/tags/README
|
66
|
+
- lib/subtrac/project/template/svn/trunk/svn/trunk/README
|
67
|
+
- lib/subtrac/project/template/svn/trunk/trac/wiki/WikiStart
|
68
|
+
- lib/subtrac/project/template/trac/wiki/WikiStart
|
65
69
|
- lib/subtrac/svn.rb
|
66
70
|
- lib/subtrac/template.rb
|
67
71
|
- lib/subtrac/trac.rb
|
@@ -1,31 +0,0 @@
|
|
1
|
-
[[PageOutline]]
|
2
|
-
= Welcome to the <%= server_name %> for <%= project.display_name %> =
|
3
|
-
|
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
|
-
|
6
|
-
== Starting Points ==
|
7
|
-
|
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
|
-
|
11
|
-
=== How to check this project out ===
|
12
|
-
|
13
|
-
Make sure you have subversion client installed, then you can check the project out using:
|
14
|
-
|
15
|
-
{{{
|
16
|
-
svn checkout <%= svn_url %>/<%= client.path %>/<%= project.path %>/trunk <%= project.path %>
|
17
|
-
}}}
|
18
|
-
|
19
|
-
=== Using SVN ===
|
20
|
-
|
21
|
-
* [http://tortoisesvn.tigris.org/ For Windows use Tortoise SVN]
|
22
|
-
* [http://scplugin.tigris.org/ For OS X use SCPlugin]
|
23
|
-
* [http://theappleblog.com/2009/02/23/12-subversion-apps-for-os-x/ There's loads more if you don't like these]
|
24
|
-
|
25
|
-
== Starting Points ==
|
26
|
-
|
27
|
-
* TracGuide -- Built-in Documentation
|
28
|
-
* [http://trac.edgewall.org/wiki/TracFaq Trac FAQ] -- Frequently Asked Questions
|
29
|
-
* TracSupport -- Trac Support
|
30
|
-
|
31
|
-
For a complete list of local wiki pages, see TitleIndex.
|