Git Product home page Git Product logo

go-sync's Introduction

go-sync utility

GitHub release license Build Status Github All Releases Github Releases

Easy project file and database synchronization for developers

Successor for CliTools Sync written on Golang

Features

General:

  • Yaml based configuration files (gosync.yml or .gosync.yml)
  • PostgreSQL and MySQL support
  • SSH and Docker support (with docker-compose support)

Sync:

  • Filesync (rsync) from remote servers using SSH
  • Create file stubs instead of fetching files from remote (with real images, see options.generate-stubs = true)
  • Dump databases from remote servers using SSH, Docker and SSH+Docker
  • Restore databases to local database servers or Docker/Docker-Compose containers
  • Filtering databases tables with regexp
  • Rsync filters
  • Custom exec scripts (startup/finish) on local or remote machine (using SSH)

Deployment:

  • Filesync (rsync) from local to remote servers using SSH
  • Dump databases from local database servers or Docker/Docker-Compose containers
  • Filtering databases tabes with regexp
  • Rsync filters
  • Custom exec scripts (startup/finish) on local or remote machine (using SSH)

Install

The binary file can be found in the project releases.

DOWNLOAD_VERSION=0.5.5
DOWNLOAD_OS=linux
DOWNLOAD_ARCH=x64

wget -O/usr/local/bin/gosync "https://github.com/webdevops/go-sync/releases/download/${DOWNLOAD_VERSION}/gosync-${DOWNLOAD_OS}-${DOWNLOAD_ARCH}"
chmod +x /usr/local/bin/gosync

Help

Usage:
  gosync [OPTIONS] <command>

Application Options:
  -v, --verbose  verbose mode

Help Options:
  -h, --help     Show this help message

Available commands:
  deploy       Deploy to server
  list         List server configurations
  self-update  Self update
  sync         Sync from server
  version      Show version

Configuration (gosync.yml)

Gosync is controlled by gosync.yml (or .gosync.yml) which will be searched in current and parent directories.

Example

> gosync sync production

:: Initialisation
   -> found configuration file /Users/xxxxxx/Projects/examples/gosync.yml
   -> using production server
   -> using connection Exec[Type:ssh SSH:[email protected]]
:: Starting exec mode "startup"
   -> executing >> Exec[Type:local Command:date +%s]
   -> executing >> Exec[Type:local Command:date +%s]
   -> executing >> Exec[Type:local Workdir:/ Command:date]
   -> executing >> Exec[Type:local Workdir:/ Command:date]
   -> executing >> Exec[Type:remote Workdir:/ Command:date]
:: Starting sync of Filesystem[Path:/home/xxxxxx/application1/ -> Local:./application1/]
:: Starting sync of Filesystem[Path:/home/xxxxxx/application2/ -> Local:./application2/]
:: Starting sync of Database[Schema:application1 User:mysql-user Passwd:***** -> Schema:test-local]
   -> dropping local database "test-application1"
   -> creating local database "test-application1"
   -> syncing database structure
   -> get list of mysql tables for table filter
   -> syncing database data
:: Starting sync of Database[Schema:application2 User:mysql-user Passwd:***** -> Schema:test]
   -> dropping local database "test-application2"
   -> creating local database "test-application2"
   -> syncing database structure
   -> get list of mysql tables for table filter
   -> syncing database data
:: Starting exec mode "finish"
   -> executing >> Exec[Type:remote Workdir:/ Command:date]
-> finished

Docker support

Docker support

Using the configuration connection.docker=configuration this command can be execued with docker containers. If the container id is passed the container is used without lookup using eg. docker-compose.

docker-compose:

CONTAINER is the name of the docker-compose container.

DSN style configuration Description
compose:CONTAINER Use container with docker-compose in current directory
compose:CONTAINER;path=/path/to/project Use container with docker-compose in /path/to/project directory
compose:CONTAINER;path=/path/to/project;file=custom-compose.yml Use container with docker-compose in /path/to/project directory and custom-compose.yml file
compose:CONTAINER;project-name=foobar Use container with docker-compose in current directory with project name foobar
compose:CONTAINER;host=example.com Use container with docker-compose in current directory with docker host example.com
compose:CONTAINER;env[FOOBAR]=BARFOO Use container with docker-compose in current directory with env var FOOBAR set to BARFOO
Query style configuration Description
compose://CONTAINER Use container with docker-compose in current directory
compose://CONTAINER?path=/path/to/project Use container with docker-compose in /path/to/project directory
compose://CONTAINER?path=/path/to/project&file=custom-compose.yml Use container with docker-compose in /path/to/project directory and custom-compose.yml file
compose://CONTAINER?project-name=foobar Use container with docker-compose in current directory with project name foobar
compose://CONTAINER?host=example.com Use container with docker-compose in current directory with docker host example.com
compose://CONTAINER?env[FOOBAR]=BARFOO Use container with docker-compose in current directory with env var FOOBAR set to BARFOO

go-sync's People

Contributors

josefglatz avatar mblaschke avatar

Watchers

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