Tag Info

17

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. 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 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 ... 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

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

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

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

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

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

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

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 ...

1

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 ...

1

Pre-commit hook is not best place (you must commit something in order to fire hook, your hook have to block this commit and perform prepared "nested") I suppose, somehow better choice may be special merge-tool (in which you'll have script, performing merge under hood)

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.

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

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

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 The qemu message protocol (QMP) supports a number of asynchronous messages, including one about restart. If you start your qemu instance with a QMP Server it will report a restart. libvirtd uses QMP to manage qemu guests, so you might try setting something like a proxy qmp server up to look for reboot messages. http://wiki.qemu.org/QMP#Asynchronous_message ... 1 This problem fixed in VisualSVN Server 2.1.3: Fixed: VisualSVNServerHooks.exe does not work if VisualSVN Server service account doesn't have access permissions to all parents of the repositories folder. See change log entry for VisualSVN Server 2.1.3 for more details. 1 You can do this using the "svnlook" command. Here's an example post-commit hook: #!/bin/sh REPOS="$1" REV="$2" /usr/bin/svnlook dirs-changed -r "$REV" "$REPOS" | egrep -q '^mywebsite' if [$? -eq 0 ] ; then # publish site code fi You may need to run svnlook manually a few times to become familiar with the output and see how to set the match pattern ...

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