0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Capistrano3-pipenv を書いた

Last updated at Posted at 2019-04-05

一言で

ruby アプリケーションに対する、 capistrano/bundler 相当の python 版、 capistrano3/pipenv を書いた。

詳細

Gemfile
group :development do
  gem 'capistrano3-pipenv', require: false
end

して、

Capfile
require 'capistrano3/pipenv'
# pyenv を利用する場合
require 'capistrano3/pyenv'

すると、 pyenv exec pipenv install --deploy がデプロイの中で呼ばれるようになる。

設定項目と、そのデフォルト値は以下

config/deploy.rb
# capistrano3/pipenv

set :pipenv_roles, :all
set :pipenv_servers, -> { release_roles(fetch(:pipenv_roles)) }
set :pipenv_flags, []
set :pipenv_env_variables, {}
set :pipenv_clean_options, '--all'

# capistrano3/pyenv
set :pyenv_path, -> {
  pyenv_path = fetch(:pyenv_custom_path)
  pyenv_path ||
    if fetch(:pyenv_type, :user) == :system
      '/usr/local/pyenv'
    else
      '$HOME/.pyenv'
    end
}
set :pyenv_roles, fetch(:pyenv_roles, :all)
set :pyenv_python_dir, -> { "#{fetch(:pyenv_path)}/versions/#{fetch(:pyenv_python)}" }
set :pyenv_map_bins, %w{pipenv}
0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?