As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Commit a7304fe0 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fix truncate repos. Added path option to import

parent 918068df
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -25,7 +25,7 @@ Remove repo
Import repo
./bin/gitlab-projects import-project https://github.com/randx/six.git
./bin/gitlab-projects import-project randx/six.git https://github.com/randx/six.git
### Keys:
Loading
Loading
Loading
Loading
@@ -11,6 +11,8 @@ require_relative '../lib/gitlab_init'
#
# /bin/gitlab-projects rm-project gitlab/gitlab-ci.git
#
# /bin/gitlab-projects import-project randx/six.git https://github.com/randx/six.git
#
require File.join(ROOT_PATH, 'lib', 'gitlab_projects')
GitlabProjects.new.exec
Loading
Loading
Loading
Loading
@@ -41,8 +41,8 @@ class GitlabProjects
end
def import_project
dir = @project_name.match(/[a-zA-Z\.\_\-]+\.git$/).to_s
cmd = "cd #{@repos_path} && git clone --bare #{@project_name} #{dir} && #{create_hooks_cmd}"
@source = ARGV.shift
cmd = "cd #{@repos_path} && git clone --bare #{@source} #{@project_name} && #{create_hooks_cmd}"
system(cmd)
end
end
Loading
Loading
@@ -6,7 +6,7 @@ echo "Danger!!! Data Loss"
while true; do
read -p "Do you wish to delete all directories (except gitolite-admin.git) from $home_dir/repositories/ (y/n) ?: " yn
case $yn in
[Yy]* ) sh -c "find $home_dir/repositories/. -maxdepth 1 -not -name 'gitolite-admin.git' -not -name '.' | xargs sudo rm -rf"; break;;
[Yy]* ) sh -c "find $home_dir/repositories/. -maxdepth 1 -not -name 'gitolite-admin.git' -not -name '.' | xargs rm -rf"; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment