Sha256: 07134fa1511aa056bc201a03980a8dc1a5d4285508fbf661260de1be71664e1f

Contents?: true

Size: 1.23 KB

Versions: 1

Compression:

Stored size: 1.23 KB

Contents

# -*- mode: ruby; -*-

namespace :pipenv do
  desc <<-DESC
        Install the current Pipenv environment.

        You can override any of these defaults by setting the variables shown below.

          set :pipenv_roles, :all

          set :pipenv_servers, -> { release_roles(fetch(:pipenv_roles)) }
          set :pipenv_flags, []
          set :pipenv_env_variables, {}
          set :pipenv_clean_options, '--all'
    DESC
  task :install do
    on fetch(:pipenv_servers) do
      within release_path do
        with fetch(:pipenv_env_variables) do
          options = []
          options << fetch(:pipenv_flags) unless fetch(:pipenv_flags).empty?
          execute :pipenv, :sync, *options
        end
      end
    end
  end

  desc "Remove unused pips installed by pipenv"
  task :clean do
    on fetch(:pipenv_servers) do
      within release_path do
        with fetch(:pipenv_env_variables) do
          execute :pipenv, :uninstall, fetch(:pipenv_clean_options)
        end
      end
    end
  end
end

namespace :load do
  task :defaults do
    set :pipenv_roles, :all
    set :pipenv_servers, -> { release_roles(fetch(:pipenv_roles)) }
    set :pipenv_flags, []
    set :pipenv_env_variables, {}
    set :pipenv_clean_options, "--all"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capistrano3-pipenv-0.2.0 lib/capistrano3/pipenv/tasks/pipenv.cap