capistrano3-pipenv 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/Gemfile +4 -0
- data/README.md +35 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/capistrano3-pipenv.gemspec +43 -0
- data/lib/capistrano3/pipenv.rb +11 -0
- data/lib/capistrano3/pipenv/hooks.rb +1 -0
- data/lib/capistrano3/pipenv/tasks.rb +1 -0
- data/lib/capistrano3/pipenv/tasks/hooks.cap +2 -0
- data/lib/capistrano3/pipenv/tasks/pipenv.cap +46 -0
- data/lib/capistrano3/pipenv/version.rb +5 -0
- data/lib/capistrano3/pyenv.rb +1 -0
- data/lib/capistrano3/pyenv/tasks/pyenv.cap +49 -0
- metadata +113 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 639d28e123f319791f0b5cc81650a162d6bda71adca6ea93b7637dd8ccc530c4
|
4
|
+
data.tar.gz: bb70763d6bcbda62f4ea59b607a0ccb65a4a7c0a7c2b192c8ff148d0204fa44e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5abd541d05ef46d094c63e28cbb9b9b4caab99ed40aa48ef4c43467f9d816c8cb9c641249a892352af0bbfa4989bdecfabe49691473271435db6355f0917790a
|
7
|
+
data.tar.gz: 43c7efdd16c1c3cea335a8a4f727b7c185999656c9a8bc2b78ca7d49fb6e37387da2f696b046c1f48bcaacd586ee442a412d9927ae19ec51832e283c360d3cad
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Capistrano3::Pipenv
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/capistrano3/pipenv`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'capistrano3-pipenv'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install capistrano3-pipenv
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
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](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/capistrano3-pipenv.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "capistrano3/pipenv"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "capistrano3/pipenv/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "capistrano3-pipenv"
|
8
|
+
spec.version = Capistrano3::Pipenv::VERSION
|
9
|
+
spec.authors = ["Yuki INOUE"]
|
10
|
+
spec.email = ["inoueyuworks@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Handle Pipfile nicely in capistrano3.}
|
13
|
+
# spec.description = %q{TODO: Write a longer description or delete this line.}
|
14
|
+
spec.homepage = "https://github.com/Yuki-Inoue/capistrano3-pipenv"
|
15
|
+
|
16
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
17
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
18
|
+
# if spec.respond_to?(:metadata)
|
19
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
20
|
+
#
|
21
|
+
# spec.metadata["homepage_uri"] = spec.homepage
|
22
|
+
# spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
|
23
|
+
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
24
|
+
# else
|
25
|
+
# raise "RubyGems 2.0 or newer is required to protect against " \
|
26
|
+
# "public gem pushes."
|
27
|
+
# end
|
28
|
+
|
29
|
+
# Specify which files should be added to the gem when it is released.
|
30
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
31
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
32
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
33
|
+
end
|
34
|
+
spec.bindir = "exe"
|
35
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
36
|
+
spec.require_paths = ["lib"]
|
37
|
+
|
38
|
+
spec.add_dependency "capistrano", ">= 3"
|
39
|
+
|
40
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
41
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
42
|
+
spec.add_development_dependency "bump"
|
43
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path('tasks/hooks.cap', __dir__)
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path('tasks/pipenv.cap', __dir__)
|
@@ -0,0 +1,46 @@
|
|
1
|
+
namespace :pipenv do
|
2
|
+
desc <<-DESC
|
3
|
+
Install the current Pipenv environment.
|
4
|
+
|
5
|
+
You can override any of these defaults by setting the variables shown below.
|
6
|
+
|
7
|
+
set :pipenv_roles, :all
|
8
|
+
|
9
|
+
set :pipenv_servers, -> { release_roles(fetch(:pipenv_roles)) }
|
10
|
+
set :pipenv_flags, '--deploy'
|
11
|
+
set :pipenv_env_variables, {}
|
12
|
+
set :pipenv_clean_options, '--all'
|
13
|
+
DESC
|
14
|
+
task :install do
|
15
|
+
on fetch(:pipenv_servers) do
|
16
|
+
within release_path do
|
17
|
+
with fetch(:pipenv_env_variables) do
|
18
|
+
options = []
|
19
|
+
options << "#{fetch(:pipenv_flags)}" if fetch(:pipenv_flags)
|
20
|
+
execute :pipenv, :install, *options
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
desc "Remove unused pips installed by pipenv"
|
27
|
+
task :clean do
|
28
|
+
on fetch(:pipenv_servers) do
|
29
|
+
within release_path do
|
30
|
+
with fetch(:pipenv_env_variables) do
|
31
|
+
execute :pipenv, :uninstall, fetch(:pipenv_clean_options)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
namespace :load do
|
39
|
+
task :defaults do
|
40
|
+
set :pipenv_roles, :all
|
41
|
+
set :pipenv_servers, -> { release_roles(fetch(:pipenv_roles)) }
|
42
|
+
set :pipenv_flags, '--deploy'
|
43
|
+
set :pipenv_env_variables, {}
|
44
|
+
set :pipenv_clean_options, "--all"
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path("pyenv/tasks/pyenv.cap", __dir__)
|
@@ -0,0 +1,49 @@
|
|
1
|
+
namespace :pyenv do
|
2
|
+
task :validate do
|
3
|
+
on release_roles(fetch(:pyenv_roles)) do |host|
|
4
|
+
pyenv_python = fetch(:pyenv_python)
|
5
|
+
if pyenv_python.nil?
|
6
|
+
info 'pyenv: pyenv_python is not set; python version will be defined by the remote hosts via pyenv'
|
7
|
+
end
|
8
|
+
|
9
|
+
# don't check the pyenv_python_dir if :pyenv_python is not set (it will always fail)
|
10
|
+
unless pyenv_python.nil? || (test "[ -d #{fetch(:pyenv_python_dir)} ]")
|
11
|
+
warn "pyenv: #{pyenv_python} is not installed or not found in #{fetch(:pyenv_python_dir)} on #{host}"
|
12
|
+
exit 1
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
task :map_bins do
|
18
|
+
SSHKit.config.default_env.merge!(pyenv_root: fetch(:pyenv_path), pyenv_version: fetch(:pyenv_python))
|
19
|
+
pyenv_prefix = fetch(:pyenv_prefix, proc { "#{fetch(:pyenv_path)}/bin/pyenv exec" })
|
20
|
+
SSHKit.config.command_map[:pyenv] = "#{fetch(:pyenv_path)}/bin/pyenv"
|
21
|
+
|
22
|
+
fetch(:pyenv_map_bins).uniq.each do |command|
|
23
|
+
SSHKit.config.command_map.prefix[command.to_sym].unshift(pyenv_prefix)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
Capistrano::DSL.stages.each do |stage|
|
29
|
+
after stage, 'pyenv:validate'
|
30
|
+
after stage, 'pyenv:map_bins'
|
31
|
+
end
|
32
|
+
|
33
|
+
namespace :load do
|
34
|
+
task :defaults do
|
35
|
+
set :pyenv_path, -> {
|
36
|
+
pyenv_path = fetch(:pyenv_custom_path)
|
37
|
+
pyenv_path ||
|
38
|
+
if fetch(:pyenv_type, :user) == :system
|
39
|
+
'/usr/local/pyenv'
|
40
|
+
else
|
41
|
+
'$HOME/.pyenv'
|
42
|
+
end
|
43
|
+
}
|
44
|
+
|
45
|
+
set :pyenv_roles, fetch(:pyenv_roles, :all)
|
46
|
+
set :pyenv_python_dir, -> { "#{fetch(:pyenv_path)}/versions/#{fetch(:pyenv_python)}" }
|
47
|
+
set :pyenv_map_bins, %w{pipenv}
|
48
|
+
end
|
49
|
+
end
|
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano3-pipenv
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Yuki INOUE
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-04-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: capistrano
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bump
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description:
|
70
|
+
email:
|
71
|
+
- inoueyuworks@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- Gemfile
|
78
|
+
- README.md
|
79
|
+
- Rakefile
|
80
|
+
- bin/console
|
81
|
+
- bin/setup
|
82
|
+
- capistrano3-pipenv.gemspec
|
83
|
+
- lib/capistrano3/pipenv.rb
|
84
|
+
- lib/capistrano3/pipenv/hooks.rb
|
85
|
+
- lib/capistrano3/pipenv/tasks.rb
|
86
|
+
- lib/capistrano3/pipenv/tasks/hooks.cap
|
87
|
+
- lib/capistrano3/pipenv/tasks/pipenv.cap
|
88
|
+
- lib/capistrano3/pipenv/version.rb
|
89
|
+
- lib/capistrano3/pyenv.rb
|
90
|
+
- lib/capistrano3/pyenv/tasks/pyenv.cap
|
91
|
+
homepage: https://github.com/Yuki-Inoue/capistrano3-pipenv
|
92
|
+
licenses: []
|
93
|
+
metadata: {}
|
94
|
+
post_install_message:
|
95
|
+
rdoc_options: []
|
96
|
+
require_paths:
|
97
|
+
- lib
|
98
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
requirements: []
|
109
|
+
rubygems_version: 3.0.3
|
110
|
+
signing_key:
|
111
|
+
specification_version: 4
|
112
|
+
summary: Handle Pipfile nicely in capistrano3.
|
113
|
+
test_files: []
|