Shards

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file lib/shards. To experiment with that code, run bin/console for an interactive prompt.

This gem is to manage the shards and sites working with octopus in rails and sycronize between Puppet repository reading shards and sites. Then it has some AWS libraries to update route53 DNS system and create databases in RDS servers.

Basically the gem has mothods to format by default some fields to save code lines in settings, and automation. The target is have a library and a terminal client application to create and delete shards and sites, and create and delete all resources associated with them.

Installation

Add this line to your application's Gemfile:

gem 'shards'

And then execute:

$ bundle

Or install it yourself as:

$ gem install shards

Usage

Add a settings.env file in your root application directory with the variables:


ENGINEERING_ROOT_PATH=/your/root/path/to/engineering/repo/project

CONFIG_FILE=relative/path/to/config.yml

PROXY_SUBDOMAIN=proxy.example.com

DOMAIN=example.com

CONFIG_FILES_ROOT_PATH=puppet/environments/common/bbug_config/files

PATH_TO_ENGINEERING_YAML=puppet/environments/common/bbug_engineering_config/files

SHARDS_FILE_NAME=shards.yml

SITES_FILE_NAME=sites.yml

SHARD_LIST_KEY_ROOT_PATH=octopus production migration_group_shards

CONFIG_DIR_SUFFIX=config_dir_suffix

DNS_ZONE_CODE=DNS Zone Code

PROXY_USER=proxy_username

REMOTE_SERVER_CURRENT_PATH=/rails/project/current_directory

# optional:

TEST=true #only for test.env delete this var in settings.env

CONFIG_REPLACE={ 'prod' => 'web' }

LIVE_BRANCH=shards_test # set this var to use in test.env or to change the default value 'v5'

WORKFLOW_YAML_PATH=path/to/your/workflows/ # you could overwrite yaml files using the same name in the defined path.


# You could overwrite methods using this metaprograming way ading your on your_file.yaml
# Then add this var:

# FORMAT_METHODS_FILE=your/path/to/your_file.yaml

# Finally to overwrite the default behavior write your code in your_file.yaml. The yaml will be merged so you need define just the methods thay you need overwrite.
# The default definitions are in spec/support/format_methods.yaml

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/shards. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Shards project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.