Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error pushing changes to gitreceive: No script output reported #42

Closed
NigelThorne opened this issue May 9, 2016 · 3 comments
Closed

Comments

@NigelThorne
Copy link

I'm trying to put together a simple "gitreceive" docker service, that when pushed a repo will build the docker image and publish it to a docker repository.

I'm just currently trying to get gitreceive to accept a pushed git repo.

https://github.com/NigelThorne/dockerfiles/tree/master/gitreceive-dockerbuilder

I'm getting the following error..

tzm-mac:xxx nwt$ git push gr master
Counting objects: 3, done.
Writing objects: 100% (3/3), 208 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To ssh://git@192.168.99.100:34567/xxx
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://git@192.168.99.100:34567/xxx'

To recreate this...

I build and ran my docker project

docker build -t gitreceive .
docker run -p 34567:22 -d --name gitreceive gitreceive

push ssh key to server

chmod 600 sshkey
cat ~/.ssh/id_rsa.pub | ssh -i sshkey root@192.168.99.100 -p 34567 "gitreceive upload-key nwt"

Then make a repo

mkdir xxx
cd xxx
git init .
echo test > test.txt
git add .
git commit -m "initial commit"
git remote add gr ssh://git@192.168.99.100:32768/xxx
git push gr master

ERROR

Thanks for your time and guidance.

@NigelThorne
Copy link
Author

NigelThorne commented May 9, 2016

I just found this...
http://stackoverflow.com/questions/7986139/git-error-when-trying-to-push-pre-receive-hook-declined

and it fixed it!

git pull --rebase
git push gr master
Counting objects: 3, done.
Writing objects: 100% (3/3), 208 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@192.168.99.100:xxx

  • [new branch] master -> master
    tzm-mac:xxx nwt$

I have no idea why that worked.

@NigelThorne
Copy link
Author

I was expecting to see some of the feedback from the receiver script in the output:

echo "Receiving a push.."
echo "==> repository: $1"
echo "==> revision: $2"
echo "==> username: $3"
echo "==> fingerprint: $4"

but there was nothing. How do I get this script output to appear in the client?

(there is nothing in docker logs either).

@NigelThorne NigelThorne reopened this May 9, 2016
@NigelThorne NigelThorne changed the title Error pushing changes to gitreceive Error pushing changes to gitreceive: No script output reported May 9, 2016
@NigelThorne
Copy link
Author

I believe the receiver script was being overwritten by "gitreceive init", so I had to swap the order of a few commands in the docker file. All working as expected now...

Nothing to see here... move along... move along.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant