Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support mina deploy #576

Open
risen opened this issue Dec 20, 2019 · 2 comments
Open

Support mina deploy #576

risen opened this issue Dec 20, 2019 · 2 comments

Comments

@risen
Copy link

risen commented Dec 20, 2019

We're using mina instead of capistrano to deploy. It'd be nice to have out of the box support for AppSignal deploy markers.

Right now we're using something like this:

namespace :appsignal do
  task :deploy do
    in_path "#{fetch(:current_path)}" do
      command %{#{fetch(:bundle_prefix)} appsignal notify_of_deploy --revision=`cat #{fetch(:current_path)}/.mina_git_revision` --user=#{ENV['USER'] || ENV['USERNAME']} --environment=#{fetch(:rails_env)}}
    end
  end
end

… which uses the deprecated (?) CLI command.

Or this:

default: &defaults
  push_api_key: "api_key"
  name: "app_name"
  revision: <%= File.read(Rails.root.join('.mina_git_revision')).strip if Rails.root.join('.mina_git_revision').exist? %>

… which works too but doesn't include the username in the deploy.

There's not :current_revision variable in mina, so it's a bit clumsy to use a remote (server-side) revision to execute local ruby code for the deploy notification. Proper support would be nice.

Thanks!

@tombruijn
Copy link
Member

Hi @risen,

Thanks for the request! We've been meaning to add support for the user name to the revision option.

For mina support, and better capistrano support so they don't use the deprecated option, we will have to look into the best way to read the revision from the app. I currently wouldn't know of a better way than to write a file on deploy and read it on boot.

@nickhammond
Copy link

I stumbled across this issue when trying to get Mina and AppSignal working together, there is a third party gem(mina-appsignal) that utilizes curl to create a deploy marker. I created a PR to update the mina dependency so you can still use it with the latest Mina as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants