Hi all,
1º) The Scenario.
Typical web server with apache, and svn server running also. Linux
CentOS.
The repositories are stored in /repositorios/ (one of them called
proyectosWeb)
The web server html documents are in /var/www/html/
2º) The hook
The goal of this hook is maintaining a working copy of the repository
(which are php web application projects) published in the web server so the
develoment group can test the applications publishing them through svn
repository.
I created a working copy with the a svn -co command.
sudo -u apache svn co http://localhost/proyectosWeb/ html --username
name --password pass
The user apache is who's running the web-server service.
I have tested two different ways for implementing the hook.
A) A script which calls a C program:
A.1) post-commit script:
#!/bin/sh
/repositorios/proyectosWeb/hooks/update-dev
A.2) update-dev.c
#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
int main(void)
{
system("/usr/bin/svn update /var/www/html/
--non-interactive --username name--password pass");
}
B) A small C application called post-commit which send the update
command directly:
post-commit.c
#include <stddef.h >
#include <stdlib.h>
#include <unistd.h>
int main(void)
{
system("/usr/bin/svn update /var/www/html/
--non-interactive --username name --password pass");
}
All right, isnt't it? I give all the permisions to the /var/www/html/ path
so I try to discard permissions problems.
Then I run "Share project" from subclipse client (the eclipse plugin for
svn) for a php project to upload a new project to the repository, and that
way publish it in the web-server. And the problem is the working copy don't
contain all the files we uploaded to the repository, some files and/or
directories are missing.
Curiously, when I run the post-commit script A, or the post-commit
application B; DIRECTLY in the shell of the server it updates the working
copy correctly, adding the files/directories that were missing.
I run the post-commit with "sudo -u apache ./post-commit" to have the same
rights.
Also curiously, if I delete the project from repository and working copy and
I re-"Share project" from eclipse THE SAME files/directories are missing
again.
Is this a permissions problem? Is this a bug? I've been a week to implement
the hook, so my boss is going to kill me :-D.
Please, any help will be useful.
Greetings from Seville, spain
--
Saludos,
Alejandro F.
--
Saludos,
Alejandro F.
Received on Fri Jan 19 11:34:42 2007