redmine_with_git 0.13.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/config/initializers/001_patches.rb +5 -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 +6 -1
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,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
|
|
@@ -108,6 +108,7 @@ files:
|
|
|
108
108
|
- config/initializers/menu.rb
|
|
109
109
|
- init.rb
|
|
110
110
|
- installer/default_settings.sh
|
|
111
|
+
- installer/programs/gitolite/query_rc.sh
|
|
111
112
|
- installer/programs/linux/sudo_file_exists.sh
|
|
112
113
|
- installer/programs/linux/sudo_write.sh
|
|
113
114
|
- installer/programs/redmine_git_hosting/ssh_key.sh
|
|
@@ -118,7 +119,10 @@ files:
|
|
|
118
119
|
- installer/setup.sh
|
|
119
120
|
- installer/tasks/_before_run.sh
|
|
120
121
|
- installer/tasks/gitolite.sh
|
|
122
|
+
- installer/tasks/gitolite_admin_base_hooks_clean.sh
|
|
123
|
+
- installer/tasks/gitolite_hooks_ruby.sh
|
|
121
124
|
- installer/tasks/gitolite_rc.sh
|
|
125
|
+
- installer/tasks/gitolite_ruby_access.sh
|
|
122
126
|
- installer/tasks/gitolite_setup.sh
|
|
123
127
|
- installer/tasks/gitolite_user.sh
|
|
124
128
|
- installer/tasks/gitolite_user_home.sh
|
|
@@ -141,6 +145,7 @@ files:
|
|
|
141
145
|
- lib/redmine_with_git/patches/redmine_git_hosting/cache/database.rb
|
|
142
146
|
- lib/redmine_with_git/patches/redmine_git_hosting/commands/git.rb
|
|
143
147
|
- lib/redmine_with_git/patches/redmine_git_hosting/gitolite_hook.rb
|
|
148
|
+
- lib/redmine_with_git/patches/repository/xitolite.rb
|
|
144
149
|
- lib/redmine_with_git/version.rb
|
|
145
150
|
- lib/tasks/redmine_with_git.rake
|
|
146
151
|
licenses: []
|