Proxy for synchronizing repositories between git and Subversion.
npm install gitsvnGsproxy is currently for internal use. It has some exclusive code for renren, so can not be use widely. If you intrest, fork the repository and make some changes for your own project.
Gsproxy is a repo synchronizer for frontend developer. It encourages using multiple repositories(Git recommend) for development and one repository for production to make code clean. Multiple repositories make project granulate, which is especially great for frontend. Gsproxy allow static resource files(like javascript and css files) combining across repositories, so everyone can work independently and share the great ideas. More importantly, multiple repositories can be easly integrated with other tools like JIRA and Phabraicator, which is very suitable for agile development.
Gsproxy uses VCS hooks(pre-commit) to integrate lint and unit tests, besides it support coffee and less autocompiling.
Gsproxy has two daemon server program, one is normally installed in server for synchronizing files from development repositories to production repository, the other is installed in local where programmer coding for generating temple files based on static resource requst, and more, it can accomplish some tasks like lint and unit tests before commiting changes.
First, install the application with: npm install -g gsproxy.
gspadmin command.repos.json and members.json.gspadmin start on directory above to start a daemon for synchronizing repositories.#### repos.json
```
{
development: [
git@github.com:renrenfed/d1.git,
git@github.com:renrenfed/d2.git
],
production: git@github.com:renrenfed/p.git
}
#### members.json
``
{
administrator: ['viclm'],
users: {
viclm: 'password'
}
}
in a new directory(path/to/workspace, for example) to clone all the development repositories.
2. Run gsp start on directory above to start a local server for static resource requst
3. Config a webserver(nginx/apache/lighttpd) and start#### Configs for nginx
`text
Gsproxy use gsproxy.com for connectting server and clients, you need to specify a proxy for this.
server {
listen 80;
server_name gsproxy.com; location / {
# The port of server server is 7071
proxy_pass http://server:7071;
}
}
Local static resource request prioxy.
server {
listen 80;
server_name customdomain.com;
charset utf-8;
autoindex on;
autoindex_exact_size on; rewrite ^/a?([0-9])+/(.*)$ /$2 last;
rewrite (.*)\.[0-9]+\.css /$1.css;
rewrite (.*)\.[0-9]+\.js /$1.js;
location / {
index index.html index.htm;
}
location ~* /.+\.(css|js)$ {
proxy_set_header x-request-filename $request_filename;
# The port of local server is 7070
proxy_pass http://127.0.0.1:7070;
}
}
`Repository configuration
Every development repository should contain a
.gspconfig file.`
{
"id" : "project_id",
"publish_dir" : "dist",
"lint": {
"js": {
"engine": "eslint",
"config": "eslint.json"
},
"css": {
"engine": "csslint",
"config": "csslint.json"
}
}
}
``