ttiny / apache-git-sync-tool Goto Github PK
View Code? Open in Web Editor NEWPHP script for synchronizing GitHub repositories with remote server.
PHP script for synchronizing GitHub repositories with remote server.
Just had to do this for Bitbucket support:
if ( _executeCommand( 'Testing ssh access to github', 'ssh -T [email protected]' ) == 255 ) {
if ( _executeCommand( 'Testing ssh access to github', 'ssh -T [email protected]' ) == 255 ) {
Why not just detect this from the "remote" config setting instead of hard-coding? I'm using Bitbucket private repos and it appears to be working great. I setup the webhook in Bitbucket also, but haven't committed anything yet. I'll update if there are issues.
{"projects": { "name": {} }}
$config->user
, $config->pass
$config->logs
(true or path)$config->supportEmailFrom
git@github...
not https://github...
or key authentication will not work and git will fail even for public reposHave something like $AUTHORS which will email all who submitted since last pull in case of error.
Emails of all authors of un-pulled remote changes:
git --no-pager log --pretty='%ae' HEAD..@{u} | sort | uniq
Consider the case where there is no existing repository and authors are all authors.
git --no-pager log --pretty='%ae' | sort | uniq
For specific branch add "--branches=test".
And the payload seems to contain info about the pusher.
so the output will look nice in github's hook history
Node.js 0.11.12 has execSync so we can easily port to nodejs with cli git and get rid of the php dependency. Not so important though.
We need to able to configure in the JSON which branches to synchronize per project and they should go to separate directories, so we can have multiple versions. For example:
{
"name": "test",
"remote": "[email protected]:Perennials/test.git",
"branches": {
"master": {
"local": "~/test/dev",
"autosyncEnabled": true,
"commandOnFinish": "ls -l",
"urlOnFinish": "http://google.com",
"cleanAndCloneLatestVersion" : false,
"syncSubmodules": false
},
"stable": {
"local": "~/test/stable",
"autosyncEnabled": true,
"commandOnFinish": "ls -l",
"urlOnFinish": "http://google.com",
"cleanAndCloneLatestVersion" : false,
"syncSubmodules": false
}
}
}
Also please compare the branch in the commit and ignore the notification if it for commit in different branch, so we won't trigger updates when devs commit to their own branches http://stackoverflow.com/questions/20791210/how-to-restrict-github-post-receive-webhook-to-master-branch-only
E.g. if the repo doesn't exist it may require different command than when existing repo is updated. E.g. start service and restart service.
Be able to include other jsons on project level.
Please add support email per project that can override the global one (if provided). I want to organize our workflow so project managers will take care of their projects, they will setup the sync tool and the repositories for their projects and they will take care of it, not a central support.
We can now have multiple commands on finish, so special chmod support makes no sense.
This is only supposed to retry pulls and clones, not all commands.
GitHub sends notification when branches are deleted, so delete them locally (should be disableable on global and project level).
Also GitHub sends push notification when tags are added and sync.php takes refs/tag/TAGNAME as brach called TAGNAME, where branches come as refs/heads/BRANCHNAME, so do be naive about this stuff and check what is actually coming.
If the path does not start with, make it relative to the project or the gobal base path.
Please add default values for the config fields, so one can fill only the ones he needs and the undefined properties will be replaced with the default:
{
"autosyncEnabled": true,
"commandOnFinish": null,
"urlOnFinish": null,
"cleanAndCloneLatestVersion" : false,
"syncSubmodules": true
}
For example in the config there could branch called "*", which will tell sync.php to sync all branches in the specified directory, and possibly make the repo bare, and possibly sync all history. This is useful for redmine.
&branch=1.0&tag=1.0.3
Branch will still be required. Only for manual reversal to specific tag, instead of tip of the branch.
This is confusing and could definitely be expounded upon. I honestly have no idea what this means or how to go about doing it.
Although there was a bit misunderstanding between my idea and your implementation, your implementation turned out better. But please make the clean option simpler - it should be argument like &clean=true and all it should is rm -rf
the directory before checkout, no need to delete the .git directory etc. This will be useful option when testing update/install scripts of projects.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.