openruko / gitmouth

SSH to Git Server for Openruko - Similar to heroku's SSH server
BSD 2-Clause "Simplified" License
19 stars 5 forks source link

Added packaging #6

Closed zyegfryed closed 11 years ago

zyegfryed commented 11 years ago

Hi, I've added Python packaging support to gitmouth. This way, we'll be able to install it from a package manager like pip:

pip install openruko-gitmouth

I also did some pep8 cleaning. Hope it helps.

Filirom1 commented 11 years ago

Thank you for the cleaning.

I will it merge tomorrow, just to make sure everything works as expected.

Filirom1 commented 11 years ago

Now make init need te be executed as root.

Is it possible to change this ?

zyegfryed commented 11 years ago

I don't understand why make init need to be executed as root. It doesn't make any sense. What kind of error are you fighting with ? Did you create the virtualenv with root user ?

Otherwise, the following should work:

git clone git://github.com/zyegfryed/gitmouth.git
cd gitmouth
virtualenv --distribute .
make init
make certs
cat > .env << EOF
APISERVER_KEY=abcdef-342131-123123123-asdasd
EOF
foreman start

Hope it helps.

PS: BTW, i don't think we need the make init command and the launch script, because they both rely on hard-coded virtualenv which is an anti-pattern IMHO. I'll make another commit with updated documentation/code. Stay tuned.

Filirom1 commented 11 years ago

Indeed I forgot the virtualenv --distribute .

It would be great if this command was done in the make init. So a new user just need to run the make init script without thinking of virtualenv.

If everything is declared in the make init, we could remove the launch script.

Thank you for your help with python.

2012/12/18 Sébastien Fievet notifications@github.com

cd gitmouth virtualenv --distribute . make init make certs cat > .env << EOF APISERVER_KEY=abcdef-342131-123123123-asdasd EOF foreman start

zyegfryed commented 11 years ago

The last commit does what you're looking for:

zyegfryed commented 11 years ago

I've ditched the make run command in the last commit to use an environment variable. I think it's cleaner. Let me know what you think.

Filirom1 commented 11 years ago

Hi,

I did somes changes on your pull request:

diff --git a/Procfile b/Procfile
index a3eaccb..0fbc623 100644
--- a/Procfile
+++ b/Procfile
@@ -1 +1 @@
-service: $VENV_PATH/bin/gitmouth
+gitmouth: ./bin/gitmouth
diff --git a/README.md b/README.md
index 7f5dea1..90b4354 100644
--- a/README.md
+++ b/README.md
@@ -58,8 +58,7 @@ supervisord or as part of boot script see `./gitmouth/bin/gitmouth`
 ## Launch

     $ cat > .env << EOF
-    VENV_PATH=.
-    PYTHONUNBUFFERED=true
+    PYTHONUNBUFFERED=true # to avoid buffering logs
     APISERVER_KEY=$WHAT_WAS_WRITTEN_AT_THE_END_OF_APISERVER_SETUP
     EOF
     $ foreman start

And in the vagrant-openruko upstart script:

- exec su - vagrant -c 'cd /home/vagrant/openruko/gitmouth; ./launch;  >> /var/log/openruko/gitmouth.log 2>&1'
+ exec su - vagrant -c 'cd /home/vagrant/openruko/gitmouth; ./bin/gitmouth;  >> /var/log/openruko/gitmouth.log 2>&1'

But it doesn't pass the integration tests :

git push heroku master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

I don't have much time to figure it out this week. I will try again after christmas.

Romain

zyegfryed commented 11 years ago

Hi Romain, The issue was my bad and is now fixed with the last 2 commits. I've run the integration tests with Vagrant, and everything passed. \o/ PS: to help you test the PR, here's the vagrant patch i used [zyegfryed/vagrant-openruko@4760a707a74ea20d12bb6e5deda8ad5717ca0f14]

Filirom1 commented 11 years ago

Just perfect.

Thank you

zyegfryed commented 11 years ago

Last commit reverted the envvar usage. Hope it feels good for you. Regards,

Filirom1 commented 11 years ago

Merged ;)

Thank you !