Code Monkey home page Code Monkey logo

heroku_cli's Introduction

Ruby

HerokuCLI

This gem will wrap the Heroku CLI so it may be used in ruby code

Installation

Add this line to your application's Gemfile:

gem 'heroku_cli'

And then execute:

$ bundle

Or install it yourself as:

$ gem install heroku_cli

Usage

Create a new database in staging that follows the production database and promote it to main DB when ready

require 'heroku_cli'

production  = HerokuCLI.application('production')
production_db = production.pg.main

staging = HerokuCLI.application('staging')
staging.pg.create_follower(production_db)
staging.pg.wait
new_db = staging.pg.followers.first
staging.pg.promote(new_db, wait: true)

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/bergholdt/heroku_cli. 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 HerokuCLI project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

heroku_cli's People

Contributors

bergholdt avatar

Watchers

 avatar James Cloos avatar Kenneth Normann Jeppesen avatar  avatar  avatar

heroku_cli's Issues

Make sure un_follow waits on till successful

After we have moved to pipeline setup the step of un_follow and promote does not work because the DB takes some time before it goes from being a follower to a fork

Please ensure that un_follow commands waits or that this tool provide a command to wait for state change

▶ heroku pg:info -a flightlogger-eu-beta
 ›   Warning: heroku update available from 7.50.0 to 7.51.0.
=== DATABASE_URL, HEROKU_POSTGRESQL_NAVY_URL
Plan:                  Standard 2
Status:                Available
Data Size:             75.7 GB
Tables:                189
PG Version:            12.6
Connections:           6/400
Connection Pooling:    Available
Credentials:           1
Fork/Follow:           Unavailable on followers
Rollback:              earliest from 2021-03-22 12:04 
Created:               2021-03-22 12:04 
Region:                eu
Data Encryption:       In Use
Continuous Protection: On (on leader)
Following:             ec2-54-229-100-128.eu-west-1.compute.amazonaws.com:5432/d9ip89b6vojscq
Behind By:             0 commits
Maintenance:           not required
Maintenance window:    Fridays 21:30 to Saturdays 01:30 UTC
Add-on:                postgresql-deep-37267


Development/FlightLogger/flightlogger  staging ✗                                                                                                                                                                                                                        5h2m ⚑  
▶ heroku pg:info -a flightlogger-eu-beta
 ›   Warning: heroku update available from 7.50.0 to 7.51.0.
=== DATABASE_URL, HEROKU_POSTGRESQL_NAVY_URL
Plan:                  Standard 2
Status:                Available
Data Size:             75.7 GB
Tables:                189
PG Version:            12.6
Connections:           6/400
Connection Pooling:    Available
Credentials:           1
Fork/Follow:           Temporarily Unavailable
Rollback:              Temporarily Unavailable
Created:               2021-03-22 12:04 
Region:                eu
Data Encryption:       In Use
Continuous Protection: On
Forked From:           ec2-54-229-100-128.eu-west-1.compute.amazonaws.com:5432/d9ip89b6vojscq
Maintenance:           not required
Maintenance window:    Fridays 21:30 to Saturdays 01:30 UTC
Add-on:                postgresql-deep-37267

Notice the

Following:             ec2-54-229-100-128.eu-west-1.compute.amazonaws.com:5432/d9ip89b6vojscq

change to

Forked From:           ec2-54-229-100-128.eu-west-1.compute.amazonaws.com:5432/d9ip89b6vojscq

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.