Giter Club home page Giter Club logo

trellis-simple-sync's Introduction

trellis-simple-sync

Ansible playbooks for Trellis database and uploads sync.
Just copy and run without any extra configuration.

Installation

  1. Copy database.yml and uploads.yml files into Trellis root folder
  2. Copy bin/sync.sh files into Trellis bin folder
  3. (Optional) Add db-backup-*.sql.gz to your Bedrock .gitignore file

Usage

Run ./bin/sync.sh <environment> <site name> <type> <mode>

  • Available <type> options: uploads, database, all
  • Available <mode> options: push, pull
  • The push is for upload data from development and update selected environment, and the pull for download data from selected environment and update development.
  • uploads sync is not destructive, it only adds or update new files, don't delete missing files.
  • On every database sync a datetimed backup db-backup-YYYYMMDDTHHMMSS.sql.gz is saved before import data.

Aliases

You can use alias for a shorter or more intuitive commands

  • staging - stag - s
  • production - prod - p
  • database - db
  • uploads - media
  • push - up
  • pull - down

Examples:
./bin/sync.sh stag example.com db up
./bin/sync.sh prod example.com media down
./bin/sync.sh prod example.com all up

Notes

  • Tested up to Ansible 2.6.1
  • Replace Elementor urls on database sync (if installed).
  • For database sync the development vagrant VM must be powered on every time you run a command
  • On every database sync a db-backup-YYYYMMDDTHHMMSS.sql.gz file is automatically created inside destination environment Bedrock folder. In development, if you don't want it to be saved in the repository:
    • You can add db-backup-*.sql.gz to your Bedrock .gitignore file
    • Or you can comment PULL > Backup development database task on database.yml

Contribute

  • Anyone is welcome to contribute to the plugin.
  • Please merge (squash) all your changes into a single commit before you open a pull request.

License

MIT

Credits

© 2018 Creame. Heavily inspired by trellis-database-uploads-migration and trellis-db-push-and-pull.

Special thanks to the Roots team whose Trellis make this project possible.

trellis-simple-sync's People

Contributors

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