Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-shell
Commits
73e2cf53
Commit
73e2cf53
authored
Jan 12, 2018
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the GitlabProjects implementation
parent
f8f31489
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
1267 deletions
+24
-1267
README.md
README.md
+0
-35
bin/create-hooks
bin/create-hooks
+24
-2
bin/gitlab-projects
bin/gitlab-projects
+0
-29
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+0
-518
spec/gitlab_projects_spec.rb
spec/gitlab_projects_spec.rb
+0
-683
No files found.
README.md
View file @
73e2cf53
...
@@ -77,41 +77,6 @@ To install gitlab-shell you also need a Go compiler version 1.8 or newer. https:
...
@@ -77,41 +77,6 @@ To install gitlab-shell you also need a Go compiler version 1.8 or newer. https:
./bin/check
./bin/check
## Repos
Add repo:
./bin/gitlab-projects add-project gitlab/gitlab-ci.git
Remove repo:
./bin/gitlab-projects rm-project gitlab/gitlab-ci.git
List repos:
./bin/gitlab-projects list-projects
Import repo:
# Default timeout is 2 minutes
./bin/gitlab-projects import-project randx/six.git https://github.com/randx/six.git
# Override timeout in seconds
./bin/gitlab-projects import-project randx/six.git https://github.com/randx/six.git 90
Fork repo:
./bin/gitlab-projects fork-project gitlab/gitlab-ci.git randx
Create tag (lightweight & annotated):
./bin/gitlab-projects create-tag gitlab/gitlab-ci.git v3.0.0 3-0-stable
./bin/gitlab-projects create-tag gitlab/gitlab-ci.git v3.0.0 3-0-stable 'annotated message goes here'
Gc repo:
./bin/gitlab-projects gc gitlab/gitlab-ci.git
## Keys
## Keys
Add key:
Add key:
...
...
bin/create-hooks
View file @
73e2cf53
...
@@ -5,16 +5,38 @@
...
@@ -5,16 +5,38 @@
# This script is used when restoring a GitLab backup.
# This script is used when restoring a GitLab backup.
require_relative
'../lib/gitlab_init'
require_relative
'../lib/gitlab_init'
require
File
.
join
(
ROOT_PATH
,
'lib'
,
'gitlab_projects'
)
require
File
.
join
(
ROOT_PATH
,
'lib'
,
'gitlab_metrics'
)
require
File
.
join
(
ROOT_PATH
,
'lib'
,
'gitlab_metrics'
)
def
create_hooks
(
path
)
global_hooks_directory
=
File
.
join
(
ROOT_PATH
,
'hooks'
)
local_hooks_directory
=
File
.
join
(
path
,
'hooks'
)
real_local_hooks_directory
=
:not_found
begin
real_local_hooks_directory
=
File
.
realpath
(
local_hooks_directory
)
rescue
Errno
::
ENOENT
# real_local_hooks_directory == :not_found
end
if
real_local_hooks_directory
!=
File
.
realpath
(
global_hooks_directory
)
if
File
.
exist?
(
local_hooks_directory
)
$logger
.
info
"Moving existing hooks directory and symlinking global hooks directory for
#{
path
}
."
FileUtils
.
mv
(
local_hooks_directory
,
"
#{
local_hooks_directory
}
.old.
#{
Time
.
now
.
to_i
}
"
)
end
FileUtils
.
ln_sf
(
global_hooks_directory
,
local_hooks_directory
)
else
$logger
.
info
"Hooks already exist for
#{
path
}
."
true
end
end
repository_storage_paths
=
ARGV
repository_storage_paths
=
ARGV
repository_storage_paths
.
each
do
|
repo_path
|
repository_storage_paths
.
each
do
|
repo_path
|
Dir
[
"
#{
repo_path
.
chomp
(
'/'
)
}
/**/*.git"
].
each
do
|
repo
|
Dir
[
"
#{
repo_path
.
chomp
(
'/'
)
}
/**/*.git"
].
each
do
|
repo
|
begin
begin
GitlabMetrics
.
measure
(
'command-create-hooks'
)
do
GitlabMetrics
.
measure
(
'command-create-hooks'
)
do
GitlabProjects
.
create_hooks
(
repo
)
create_hooks
(
repo
)
end
end
rescue
Errno
::
ENOENT
rescue
Errno
::
ENOENT
# The user must have deleted their repository. Ignore.
# The user must have deleted their repository. Ignore.
...
...
bin/gitlab-projects
deleted
100755 → 0
View file @
f8f31489
#!/usr/bin/env ruby
require_relative
'../lib/gitlab_init'
#
# GitLab Projects shell. Add/remove projects from /home/git/repositories
#
# Ex.
# /bin/gitlab-projects add-project gitlab/gitlab-ci.git
#
# /bin/gitlab-projects rm-project gitlab/gitlab-ci.git
#
# /bin/gitlab-projects list-projects
#
# /bin/gitlab-projects mv-project gitlab/gitlab-ci.git randx/fork.git
#
# /bin/gitlab-projects fork-project gitlab/gitlab-ci.git randx
#
# /bin/gitlab-projects import-project randx/six.git https://github.com/randx/six.git
#
require
File
.
join
(
ROOT_PATH
,
'lib'
,
'gitlab_projects'
)
# Return non-zero if command execution was not successful
if
GitlabProjects
.
new
.
exec
exit
0
else
exit
1
end
lib/gitlab_projects.rb
deleted
100644 → 0
View file @
f8f31489
This diff is collapsed.
Click to expand it.
spec/gitlab_projects_spec.rb
deleted
100644 → 0
View file @
f8f31489
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment