redmine_with_git 0.12.0 → 0.14.0
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.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/redmine_with_git.scss +3 -0
- data/config/initializers/001_patches.rb +5 -0
- data/config/initializers/menu.rb +18 -0
- data/installer/programs/gitolite/query_rc.sh +6 -0
- data/installer/tasks/gitolite_admin_base_hooks_clean.sh +33 -0
- data/installer/tasks/gitolite_hooks_ruby.sh +25 -0
- data/installer/tasks/gitolite_ruby_access.sh +21 -0
- data/installer/tasks/redmine_git_hosting.sh +3 -1
- data/lib/redmine_with_git/patches/repository/xitolite.rb +30 -0
- data/lib/redmine_with_git/version.rb +1 -1
- metadata +16 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a288bce59f5ad5a3febee2b6ff4667becaf4844343a414b21bde5466810d30be
|
|
4
|
+
data.tar.gz: 3b700d17189b56e989468f82aec1f0c1b232ae0b3774dcc8ae8afcf775ca20bf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b19ea725f939f3e19d058c6500103235da5fce6c111e43299ce16cdf03cbc9fda9826927c38298e793739f4d33ce546ca4dbca7415f35ca1618659b0c0d6b299
|
|
7
|
+
data.tar.gz: fc5970c1758e5994fd278dd938cb152143b4cc61eb4c0e70240b955a2360a5c5ab3983749cd2fd5b03530ec94872e311ef1e66d8b0b3cc7e36944187a11a517c
|
|
@@ -5,6 +5,11 @@ EacRubyUtils.patch_module(
|
|
|
5
5
|
RedmineWithGit::Patches::RedmineGitHosting::GitoliteHook
|
|
6
6
|
)
|
|
7
7
|
|
|
8
|
+
EacRubyUtils.patch_module(
|
|
9
|
+
Repository::Xitolite,
|
|
10
|
+
RedmineWithGit::Patches::Repository::Xitolite
|
|
11
|
+
)
|
|
12
|
+
|
|
8
13
|
apply_patches_version_limit = Gem::Version.new('4.0.0')
|
|
9
14
|
redmine_git_hosting_version = Gem::Version.new(
|
|
10
15
|
Redmine::Plugin.registered_plugins[:redmine_git_hosting].version
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
Redmine::MenuManager.map :admin_menu do |menu|
|
|
4
|
+
original_item = menu.find(:redmine_git_hosting)
|
|
5
|
+
next unless original_item
|
|
6
|
+
|
|
7
|
+
parent = original_item.parent
|
|
8
|
+
position = original_item.position
|
|
9
|
+
parent.remove!(original_item)
|
|
10
|
+
parent.add_at(
|
|
11
|
+
Redmine::MenuManager::MenuItem.new(
|
|
12
|
+
:redmine_git_hosting, original_item.url,
|
|
13
|
+
caption: :redmine_git_hosting, plugin: 'additionals', html: { class: 'icon' },
|
|
14
|
+
icon: 'brand-git'
|
|
15
|
+
),
|
|
16
|
+
position
|
|
17
|
+
)
|
|
18
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
set -u
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
RESIDUAL_HOOKS=(post-receive post-receive.d lib)
|
|
7
|
+
|
|
8
|
+
function gitolite_admin_base_hooks_dir {
|
|
9
|
+
printf '%s/hooks/common' "$(programeiro /gitolite/query_rc GL_ADMIN_BASE)"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function task_dependencies {
|
|
13
|
+
echo gitolite_setup
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function task_condition {
|
|
17
|
+
local dir
|
|
18
|
+
dir="$(gitolite_admin_base_hooks_dir)"
|
|
19
|
+
for hook in "${RESIDUAL_HOOKS[@]}"; do
|
|
20
|
+
if sudo -u "$gitolite_user" test -e "$dir/$hook"; then
|
|
21
|
+
return 1
|
|
22
|
+
fi
|
|
23
|
+
done
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function task_fix {
|
|
27
|
+
local dir
|
|
28
|
+
dir="$(gitolite_admin_base_hooks_dir)"
|
|
29
|
+
for hook in "${RESIDUAL_HOOKS[@]}"; do
|
|
30
|
+
sudo -u "$gitolite_user" rm -rf "$dir/$hook"
|
|
31
|
+
done
|
|
32
|
+
sudo -u "$gitolite_user" -H gitolite setup --hooks-only
|
|
33
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
set -u
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
function gitolite_hook_path {
|
|
7
|
+
printf '%s/hooks/common/post-receive' "$(programeiro /gitolite/query_rc LOCAL_CODE)"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function task_dependencies {
|
|
11
|
+
echo gitolite_admin_base_hooks_clean redmine_bundle redmine_git_hosting_settings
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function task_condition {
|
|
15
|
+
if bool_r "$SKIP_DATABASE"; then return 0; fi
|
|
16
|
+
|
|
17
|
+
local hook_path
|
|
18
|
+
hook_path="$(gitolite_hook_path)"
|
|
19
|
+
if ! sudo -u "$gitolite_user" test -f "$hook_path"; then return 0; fi
|
|
20
|
+
[ "$(sudo -u "$gitolite_user" head -n 1 "$hook_path")" == "#!$(programeiro /ruby/path)" ]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function task_fix {
|
|
24
|
+
programeiro /rails/rake redmine_git_hosting:install_hook_files
|
|
25
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
set -u
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
function task_dependencies {
|
|
7
|
+
echo gitolite_user ruby
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function task_condition {
|
|
11
|
+
sudo -u "$gitolite_user" "$(programeiro /ruby/path)" -v > /dev/null 2>&1
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function task_fix {
|
|
15
|
+
local ruby_path
|
|
16
|
+
ruby_path="$(programeiro /ruby/path)"
|
|
17
|
+
infom "User \"$gitolite_user\" cannot execute \"$ruby_path\"" \
|
|
18
|
+
"(required by Gitolite hooks)."
|
|
19
|
+
infom "Grant traverse permission to the blocking directories. Run" \
|
|
20
|
+
"\"sudo -u $gitolite_user namei -l $ruby_path\" to find them."
|
|
21
|
+
}
|
|
@@ -8,5 +8,7 @@ function task_condition {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
function task_dependencies {
|
|
11
|
-
echo
|
|
11
|
+
echo gitolite_admin_base_hooks_clean gitolite_ruby_access gitolite_setup \
|
|
12
|
+
redmine_gitolite_sudoer redmine_git_hosting_settings rugged_ssh_support \
|
|
13
|
+
gitolite_hooks_ruby
|
|
12
14
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RedmineWithGit
|
|
4
|
+
module Patches
|
|
5
|
+
module Repository
|
|
6
|
+
module Xitolite
|
|
7
|
+
def self.included(base)
|
|
8
|
+
base.prepend(InstanceMethods)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
module InstanceMethods
|
|
12
|
+
# @param prev_db_heads [Array<String>]
|
|
13
|
+
# @param repo_heads [Array<String>]
|
|
14
|
+
# @return [void]
|
|
15
|
+
def save_revisions(prev_db_heads, repo_heads)
|
|
16
|
+
super(prev_db_heads.select { |head| commit_exist?(head) }, repo_heads)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
# @param revision [String]
|
|
22
|
+
# @return [Boolean]
|
|
23
|
+
def commit_exist?(revision)
|
|
24
|
+
scm.rev_parse("#{revision}^{commit}").present?
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: redmine_with_git
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.14.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Esquilo Azul Company
|
|
@@ -29,14 +29,14 @@ dependencies:
|
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '0.
|
|
32
|
+
version: '0.33'
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '0.
|
|
39
|
+
version: '0.33'
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: eac_ruby_utils
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -86,6 +86,9 @@ dependencies:
|
|
|
86
86
|
- - "~>"
|
|
87
87
|
- !ruby/object:Gem::Version
|
|
88
88
|
version: '0.15'
|
|
89
|
+
- - ">="
|
|
90
|
+
- !ruby/object:Gem::Version
|
|
91
|
+
version: 0.15.3
|
|
89
92
|
type: :development
|
|
90
93
|
prerelease: false
|
|
91
94
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -93,13 +96,19 @@ dependencies:
|
|
|
93
96
|
- - "~>"
|
|
94
97
|
- !ruby/object:Gem::Version
|
|
95
98
|
version: '0.15'
|
|
99
|
+
- - ">="
|
|
100
|
+
- !ruby/object:Gem::Version
|
|
101
|
+
version: 0.15.3
|
|
96
102
|
executables: []
|
|
97
103
|
extensions: []
|
|
98
104
|
extra_rdoc_files: []
|
|
99
105
|
files:
|
|
106
|
+
- app/assets/stylesheets/redmine_with_git.scss
|
|
100
107
|
- config/initializers/001_patches.rb
|
|
108
|
+
- config/initializers/menu.rb
|
|
101
109
|
- init.rb
|
|
102
110
|
- installer/default_settings.sh
|
|
111
|
+
- installer/programs/gitolite/query_rc.sh
|
|
103
112
|
- installer/programs/linux/sudo_file_exists.sh
|
|
104
113
|
- installer/programs/linux/sudo_write.sh
|
|
105
114
|
- installer/programs/redmine_git_hosting/ssh_key.sh
|
|
@@ -110,7 +119,10 @@ files:
|
|
|
110
119
|
- installer/setup.sh
|
|
111
120
|
- installer/tasks/_before_run.sh
|
|
112
121
|
- installer/tasks/gitolite.sh
|
|
122
|
+
- installer/tasks/gitolite_admin_base_hooks_clean.sh
|
|
123
|
+
- installer/tasks/gitolite_hooks_ruby.sh
|
|
113
124
|
- installer/tasks/gitolite_rc.sh
|
|
125
|
+
- installer/tasks/gitolite_ruby_access.sh
|
|
114
126
|
- installer/tasks/gitolite_setup.sh
|
|
115
127
|
- installer/tasks/gitolite_user.sh
|
|
116
128
|
- installer/tasks/gitolite_user_home.sh
|
|
@@ -133,6 +145,7 @@ files:
|
|
|
133
145
|
- lib/redmine_with_git/patches/redmine_git_hosting/cache/database.rb
|
|
134
146
|
- lib/redmine_with_git/patches/redmine_git_hosting/commands/git.rb
|
|
135
147
|
- lib/redmine_with_git/patches/redmine_git_hosting/gitolite_hook.rb
|
|
148
|
+
- lib/redmine_with_git/patches/repository/xitolite.rb
|
|
136
149
|
- lib/redmine_with_git/version.rb
|
|
137
150
|
- lib/tasks/redmine_with_git.rake
|
|
138
151
|
licenses: []
|