Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
= Reflection
Reflection is designed to keep your development system in sync with your production system's files and database (by dumping). It uses a shared git repository to store these files, which allows you to mirror your production environment without the need of direct access to your production servers.
It provides two main command modes:
== Get it
Reflection is a gem, hosted on Gemcutter:
gem install reflection
== Stashing your production data
==== The simplest form:
$ reflection --stash --directory /path/to/your/assets --repository git@your-shared-repository.git
This will clone git@your-shared-repository.git and add the directory /path/to/your/assets to the repository. Reflection keeps a local version of your repository in HOME/.reflection/stash. So the next time you run the command, there is no need of cloning it again.
==== Now, lets include a database dump
$ reflection --stash \
--directory /path/to/your/assets \
--repository git@your-shared-repository.git \
--rails /rails/root
--rails-env production
This does the same as above, but additionally dumps your production database and adds the fresh dump to your repository.
==== I'm lazy..
You too, aren't you? So Reflection allows you to store all command line options in a config file.
$ reflection --stash \ --directory /path/to/your/assets \ --repository git@your-shared-repository.git \ --rails /rails/root \ --rails-env production \ --write /path/to/your/config
The next time you want to run the same command as above (useful for cron), you could simply call Reflection with:
$ reflection /path/to/your/config
== Getting the production stuff on your local development machine
This works exactly the same as describe above, but you would use --apply instead of --stash:
$ reflection --apply \ --directory /path/to/your/assets \ --repository git@your-shared-repository.git \ --rails /rails/root \ --rails-env development
This clones or pulls git@your-shared-repository.git (again, Reflection keeps a version of your Repository in HOME/.reflection/apply), copies the content to the specified directory (e.g. rails/application/public/assets) and optionally loads the dump into your database.
As you may have noticed, the Reflection command above got called with --rails-env development, which loads the dump in your development database (as defined by /rails/root/config/database.yml).
==== A little productivity hint
If you have a reflection.yml config file in your current application-development-directory, syncing your server-production environment is as easy as running:
$ reflection
== reflection --help
$ reflection --help Usage: reflection --COMMAND --repository=GIT_REPO --directory=PATH -or- Usage: reflection /path/to/reflection-config-file.yml
On the server side: -s, --stash Store your assets and/or a database dump in a git-repository. On the client side: -a, --apply Apply assets and/or a database dump loaded from a git-repository.
Required options for both: -r, --repository GIT_URL A Git repository(url) to be used as storage -d, --directory PATH Path to your asset directory
Additional options for both: --rails [RAILS_ROOT] Enable dumping/applying of a Rails managed MySQL database --rails-env [ENV] Rails environment to instrument --write [FILE] Create a configuration FILE from the current commandline options --force Hide tedious warnings -v, --verbose Include debug information in output --version Show version
== Note on Patches/Pull Requests
== Copyright
Copyright (c) 2009 Andreas Wolff. See LICENSE for details.
FAQs
Unknown package
We found that basiszwo-reflection demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.