On 28/02/2015 06:46 πμ, Paul Johnson wrote:
> Thanks to your help earlier in the week, I now have Gitlab running, able
> to spawn users & projects.  Now, I want a customization.
> 
> When a repo is created, I want some git config commands to run.  How to
> do so?
> 
> One example would be insert the same .gitignore in the top of every
> project that gets created.
> 
> Another example is accommodating some advice on the Sparkleshare
> website. I'll have some users running Sparkleshare to keep the repo up
> to date automatically.  On the Sparkleshare website, they suggest using
> a script to create projects on the server.  They have couple of settings
> I'd like to add to all repositories.  From their dazzle script
> (https://raw.githubusercontent.com/hbons/Dazzle/master/dazzle.sh) that
> creates repositories,  I will paste in a snippit
> 
>     $GIT init --quiet --bare "$DAZZLE_HOME/$1"
>     # Don't allow force-pushing and data to get lost
>     $GIT config --file "$DAZZLE_HOME/$1/config" receive.denyNonFastForwards 
> true
> 
>     # Add list of files that Git should not compress
>     EXTENSIONS="jpg jpeg png tiff gif psd xcf flac mp3 ogg oga avi mov mpg 
> mpeg mkv ogv ogx webm zip gz bz xz bz2 rpm deb tgz rar ace 7z pak msi iso dmg"
>     for EXTENSION in $EXTENSIONS; do
>       sleep 0.05
>       echo -ne "  -> echo \"*.$EXTENSION -delta\" >> 
> $DAZZLE_HOME/$1/info/attributes      \r"
>       echo "*.$EXTENSION -delta" >> "$DAZZLE_HOME/$1/info/attributes"
>       sleep 0.05
>       EXTENSION_UPPERCASE=`echo $EXTENSION | tr '[:lower:]' '[:upper:]'`
>       echo -ne "  -> echo \"*.$EXTENSION_UPPERCASE -delta\" >> 
> $DAZZLE_HOME/$1/info/attributes      \r"
>       echo "*.$EXTENSION_UPPERCASE -delta" >> 
> "$DAZZLE_HOME/$1/info/attributes"
>     done
> 
> 
> Looks like 1 config statement and a bunch of symbols to dump into a file
> called attributes. After that runs, the attributes file looks like so:
> 
> *.jpg -delta
> *.JPG -delta
> *.jpeg -delta
> *.JPEG -delta
> *.png -delta
> *.PNG -delta
> *.tiff -delta
> *.TIFF -delta
> *.gif -delta
> *.GIF -delta
> *.flac -delta
> *.FLAC -delta
> *.mp3 -delta
> *.MP3 -delta
> [snip]
> 
> 
> I've been studying Gitlab hooks, but they seem to relate to commit
> events, not repository creation.
> 

Have you looked at system hooks?

http://doc.gitlab.com/ce/system_hooks/system_hooks.html

"Your GitLab instance can perform HTTP POST requests on the following
events: project_create, project_destroy, user_add_to_team,
user_remove_from_team, user_create, user_destroy, key_create,
key_destroy, group_create, group_destroy, user_add_to_group and
user_remove_from_group."


-- 
GPG : 0x3A7DDABC985EDC6E
Blog: http://axilleas.me

-- 
You received this message because you are subscribed to the Google Groups 
"GitLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitlabhq+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/gitlabhq/54F190E1.6040105%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to