Giter Site home page Giter Site logo

code_sync_tool's Introduction

代码同步小工具

主要用来解决本地切换分支后,PHPSTORM不自动同步所有变更文件到服务端的问题

使用方法

go build -o code_sync_tool main.go
./code_sync_tool -c conf.ini

配置说明

#环境名称
[local_01]
#env 如果需要本地同步到远程,配置为:local,远程热加载可以选择为:server
env = local

#ssh
host = xxx.xxx.com
user = user
password = password
port = 22

#cmd 文件上传或者更新后执行的shell
cmd = ps aux | grep 'Master Process' | grep -v grep | awk '{print $2}' | xargs kill -USR1

#deployment
local_path = /Users/zhaojingxian/dev/php_server
deployment_path = /data/web/code_path

#ignore
ignore_prefix = .git,.idea
ignore_suffix = ~,.swap


[local_02]
#env
env = server

#cmd
cmd = ps aux | grep 'Master Process' | grep -v grep | awk '{print $2}' | xargs kill -USR1
cmd = ps aux | grep 'Master Process' | grep -v grep | awk '{print $2}' | xargs kill -USR2

#deployment
local_path = /data/web/code_path

#ignore
ignore_prefix = .git,.idea
ignore_suffix = ~,.swap

Features

全局

  • 按照前缀和后缀忽略监听文件

本地端模式

  • 监听文件变动,自动通过SFTP上传到远程服务器
  • 文件上传成功后,在远程服务器执行SHELL命令

服务端模式

  • 监听文件变动,自动执行SHELL命令

code_sync_tool's People

Contributors

zhjx922 avatar

Stargazers

gangge avatar John avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.