Мой сценарий выглядит следующим образом:Пульт дистанционного управления Gitlab: у вас нет разрешений для этого. при выполнении скриптового GIT толчок
мы имеем gitlab создать для нашей команды, где мы делаем все наше развитие с филиалами и т.д., и т.д. У нас также есть официальный репо, организованном нашей компании, где мы хотели бы, чтобы наша главная отрасль была зеркальной, чтобы люди (имеющие доступ к этому репо в нашей компании) могли просматривать наш код.
Я написал post-receive
крюк, который будет отражать коммитов толкнул освоить ветвь на gitlab к официальному репо: (/opt/gitlab/embedded/service/gitlab-shell/hooks/post-receive
на gitlab)
#!/opt/gitlab/embedded/bin/ruby
# Fix the PATH so that gitlab-shell can find git-upload-pack and friends.
ENV['PATH'] = '/opt/gitlab/bin:/opt/gitlab/embedded/bin:' + ENV['PATH']
#!/usr/bin/env ruby
# This file was placed here by GitLab. It makes sure that your pushed commits
# will be processed properly.
#
deveo_server="[email protected]:XXXX/projects/XXXX/repositories/git/Project"
from, to, branch = ARGF.read.split " "
if (branch =~ /master$/) == nil
puts "Received branch #{branch}, not deploying."
exit
end
`git remote add deveo #{deveo_server} >/dev/null 2>&1`
`git push deveo master`
puts "DEPLOY: master(#{to}) mirrored to '#{deveo_server}'"
refs = ARGF.read
key_id = ENV['GL_ID']
repo_path = Dir.pwd
require_relative '../lib/gitlab_custom_hook'
require_relative '../lib/gitlab_post_receive'
if GitlabPostReceive.new(repo_path, key_id, refs).exec &&
GitlabCustomHook.new.post_receive(refs, repo_path)
exit 0
else
exit 1
end
Проблема заключается в том, что когда я делаю это я получаю следующее на Обязуется gitlab магистерского филиал:
[master aa4a4f2] testing hooks 7
0 files changed
create mode 100644 testing_hooks_7
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 264 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)
remote: You do not have permissions to do this.
remote: fatal: Could not read from remote repository.
remote:
remote: Please make sure you have the correct access rights
remote: and the repository exists.
remote: DEPLOY: master(aa4a4f218b7bc335ee3e0d6d52df5cfd5ddc1c99) mirrored to '[email protected]:XXXX/projects/XXXX/repositories/git/Project'
To [email protected]:XXXX/Project.git
1e92695..aa4a4f2 master -> master
Я запустил SSH агента там и добавил SSH git
пользователя из gitlab в deveo, но чего-то не хватает.
Это работает, когда я создал это с голой репо рядом с моим локальным репозиторием на моей локальной машине - так там должно быть несколько ключей не хватает где-то .. но где :(