Skip to content

Commit

Permalink
Drop redis-cli command
Browse files Browse the repository at this point in the history
Heroku now offers their own `redis:cli` subcommand, making this
unnecessary.

This change will require a major release as we're removing the feature
entirely.
  • Loading branch information
geoffharcourt committed Aug 1, 2021
1 parent b94557a commit 81893f7
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 44 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ Tail a log:
staging tail
pr_app 1234 tail

Use [redis-cli][2] with your `REDIS_URL` add-on:

production redis-cli
staging redis-cli
pr_app 1234 redis-cli

The scripts also pass through, so you can do anything with them that you can do
with `heroku ______ --remote staging` or `heroku ______ --remote production`:

Expand Down
10 changes: 0 additions & 10 deletions lib/parity/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,6 @@ def tail
)
end

def redis_cli
Kernel.system("redis-cli", "-u", raw_redis_url)
end

def raw_redis_url
@redis_to_go_url ||= Open3.
capture3(command_for_remote("config:get REDIS_URL"))[0].
strip
end

def heroku_app_name
HerokuAppName.new(environment).to_s
end
Expand Down
28 changes: 0 additions & 28 deletions spec/parity/environment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,22 +224,6 @@
expect(Kernel).to have_received(:exec).with(*open)
end

it "opens a Redis session connected to the environment's Redis service" do
allow(Open3).to receive(:capture3).and_return(open3_redis_url_fetch_result)

Parity::Environment.new("production", ["redis_cli"]).run

expect(Kernel).to have_received(:system).with(
"redis-cli",
"-u",
open3_redis_url_fetch_result[0].strip,
)
expect(Open3).
to have_received(:capture3).
with(fetch_redis_url("REDIS_URL")).
once
end

it "returns true if deploy was successful without migrations" do
result = Parity::Environment.new("production", ["deploy"]).run

Expand Down Expand Up @@ -327,18 +311,6 @@ def open
["heroku", "open", "--remote", "production"]
end

def fetch_redis_url(env_variable)
"heroku config:get #{env_variable} --remote production"
end

def open3_redis_url_fetch_result
[
"redis://redistogo:[email protected]:90210/\n",
"",
""
]
end

def psql_count
[
"heroku", "pg:psql",
Expand Down

0 comments on commit 81893f7

Please sign in to comment.