Tag Info

Hot answers tagged

18

While the hook is running, GIT_DIR and (if the worktree was defined explicitly) GIT_WORK_TREE are set. That means your pull won't run with the second repository in the directory you changed to. Try git --git-dir ~/websites/testing/.git --work-tree ~/websites/testing pull; or unset git's repo-local environment with this: unset $(git rev-parse ...


6

incron, based on inotify, implements just such a hook in a cron-like way. Unfortunately, it is Linux-specific, not generic to UNIX.


5

See :he :autocmd and :he BufWritePost The line would look like this: :autocmd BufWritePost /path/to/file/or/pattern !command <afile> If the <afile> thing does not work use %:p.


4

As requested, a bit of a tutorial on groups. Hopefully this isn't too elementary. By default, most user accounts are also part of a group of the same name. To determine what groups an account is a member of, use the groups command. # groups root root : root bin daemon sys adm disk wheel The first one listed is the primary group, and will be the default ...


4

You might find incron of interest if you're using Linux.


4

I'm wondering if there's a better way of identifying which of the DIRS I should use and only update that one. svnlook dirs-changed is what you're looking for: # svnlook dirs-changed -r 40270 /path/to/the/repo project1/foo/bar Try something like this: #!/usr/local/bash4/bin/bash typeset -A IP typeset -A DOCROOT PROJECTS="project1 project2" ...


4

gitlab already uses the post-receive hook internally. you could fiddle around with that script and call your hook as well, but from the docs it looks like the "official" way would be to use "web-hooks", i.e. let gitlab call your webserver on post-receive and your webserver then pulls the repository. I haven't tried this myself, but since no one answered so ...


3

If you want to grant a user (such as git in your examples) access to another user's space, put them in the same group and set group rights accordingly. If you need more complex access control list functionality, you should look into POSIX ACLs as provided by getfacl(1) and setfacl(1).


3

The usual way to do something like that is CVS keyword expansion: http://cvsbook.red-bean.com/cvsbook.html#Using%20Keyword%20Expansion A small drawback is, that you'll have the $ signs in the file, but many people are used to this convention.


2

I have had problems with case sensitivity and subversion on windows before. Could that be the problem? I would try this: echo "%VISUALSVN_SERVER%\bin\VisualSVNServerHooks.exe" ^ commit-notification "%1" -r %2 ^ --from <from-email> --to <to-email> ^ --smtp-server <smtp-server> > <somepath>\text.txt Check that the command echoed ...


2

If you are writing to a file, you could just write to "|yourimportscript" and have it run off the piped input. When apache is restarted, it would restart the process. It would spend the majority of its time waiting until it received input and wouldn't require a cron job. You could write your script as a daemon and use famd to see if the file was modified. ...


2

Use svn update instead of svn checkout Make sure that you have Apache setup to ignore svn files


2

I don't believe there are any accessible hooks for new user creation in AD. You could do a script to poll for users, keep track of the existing ones, and then provision any new users. I think that's about as good as you're going to get. The other option is to provision your AD users with Python from your intranet side. Creating AD users is fairly easily ...


2

Short Answer: You can't get there from here. Longer Answer: There is no hook for "on account creation". You would have to wrap your user-creation into a script/process that also executes this python script after the account creation. Or, You can change your user-account-creation so that it is done from within a python script (or add those steps to your ...


2

Gitlab doesn't have a post-receive hook since the developers replaced gitolite with gitlab-shell. Therefore you can: sudo -u git bash touch /home/git/repositories/<repository name>.git/hooks/post-receive vim /home/git/repositories/<repository name>.git/hooks/post-receive Make sure the git user has all the permissions needed to run the ...


2

I think the problem lies in the fact that you've set up a command in the authorized_keys file, but man sshd's section on the authorized_keys file format clearly states: command="command" Specifies that the command is executed whenever this key is used for authentication. The command supplied by the user (if any) is ignored. (…) This means that ...


2

Thanks everyone for your answers. I managed to get it working in the end with the help of this post by doing the following: 1. Using Separate Script Add this line to sudoers file (using visudo). gituser ALL=(web-user) NOPASSWD: /usr/local/sbin/startnode Contents of file /usr/local/sbin/startnode changed to following: #!/bin/bash cd ...


2

You can use hooks to accomplish this. It has been discussed on stackoverflow. http://stackoverflow.com/questions/7147699/limiting-file-size-in-git-repository


2

This is the default behavior of SVN when working with a certificate it does not trust. Take a look at the SSL Certificate Management section in "Version Control with Subversion". If the client receives a server certificate, it needs to verify that it trusts the certificate: is the server really who it claims to be? The OpenSSL library does this ...


2

Do I need to restart Apache No. SVN-hooks aren't Apache side of game, it's pure Subversion toys, thus - create and use immediately on svn-events


1

There are benefits to the implementation you've done. Although you have omitted some possible edge-cases like checking for un-staged changes in other branches (you might want to add/stash first). The alternative to this is using a continuous integration system like Jenkins to handle the updates: https://wiki.jenkins-ci.org/display/JENKINS/Meet+Jenkins ...


1

If you run Solaris 10 or newer, an OpenSolaris based distribution, FreeBSD, (a recent) NetBSD or MacOS X, a dtrace script will easily do that job.


1

Each argument to the post-update is the name of a ref which was updated by the push, and a branch is a ref whose name looks like refs/heads/<branch> so a script to do what you want would look something like this: #!/bin/sh for ref in "$@" do case "$ref" in refs/heads/*) /path/to/rebuild-site `basename $ref`;; esac done


1

Here's the script I ended up using, based on quanta's help: REPO="$1" REV="$2" declare -A PROJECTS PROJECTS=(\ [project1]="/path/to/projects/project1 /path/to/projects/project1-devel" \ [project2]="/path/to/projects/project2 /path/to/projects/project2-devel" \ [project3]="/path/to/projects/project3 /path/to/projects/project3-devel" \ ) ...


1

I'd use incron. This uses the kernel's inotify hooks to run arbitrary commands on specified filesystem events.


1

I was able to accomplish this with ProFTPd & the mod_exec module.


1

No, you cannot do this. You need a network connection to be able to talk to the virtual machine/host. You can make a script that populates your host machine hosts file with the VM's hostname though. I have no idea why I added this as a comment oops.


1

I believe it should happen immediately. No apache restart required.


1

A simple thresholding tool like Monit would provide quick drop-in alerting for system resources. It's well-supported, stable and is covered heavily here on Server Fault. The examples in the documentation would work for what you're trying to do.



Only top voted, non community-wiki answers of a minimum length are eligible