capistrano_fig 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +47 -0
- data/Rakefile +14 -0
- data/lib/capistrano-fig.rb +0 -0
- data/lib/capistrano/fig.rb +1 -0
- data/lib/capistrano/tasks/fig.rake +98 -0
- metadata +105 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 03ddda741afaee698f497738aa2ca53ea61dc8a5
|
4
|
+
data.tar.gz: 61b5071db3cb95a3d66252dcdca09c2b61bec9c0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fb27b87155f68c635e8d4bb0ae16455a1c9bad58b5493ea6ed1b2a45bc87fa496420972deb3f80d8106c77ac920b8beaba45129db228dff8bc95fac809792d78
|
7
|
+
data.tar.gz: 9e3eea7977e921bb090ae840996ad73f965dda719e25e73cafa5c26f121ba9c8900ffb1ebd5e68351f2888c9af5aeb4a12e0787c294e90435c235895b60efee6
|
data/README.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# capistrano-fig
|
2
|
+
|
3
|
+
Manage fig on servers using Capistrano.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Gem install:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
gem install capistrano-fig
|
11
|
+
```
|
12
|
+
|
13
|
+
Or add it to your bundle:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'capistrano-fig', '0.0.1', git: 'github.com/dieb/capistrano-fig.git', require: false
|
17
|
+
```
|
18
|
+
|
19
|
+
## Setup
|
20
|
+
|
21
|
+
Append the following to your Capfile:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require 'capistrano/fig'
|
25
|
+
```
|
26
|
+
|
27
|
+
Now you can run commands like
|
28
|
+
|
29
|
+
```bash
|
30
|
+
$ cap production fig:ps
|
31
|
+
```
|
32
|
+
|
33
|
+
against Docker hosts specified on the production deploy spec.
|
34
|
+
|
35
|
+
|
36
|
+
## Available commands
|
37
|
+
|
38
|
+
- fig:kill[container]
|
39
|
+
- fig:logs
|
40
|
+
- fig:port[service,private_port]
|
41
|
+
- fig:ps
|
42
|
+
- fig:pull
|
43
|
+
- fig:start[service]
|
44
|
+
- fig:stop[service]
|
45
|
+
- fig:restart[service]
|
46
|
+
- fig:up
|
47
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'bundler/setup'
|
5
|
+
rescue LoadError
|
6
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
7
|
+
end
|
8
|
+
|
9
|
+
require 'bundler/gem_tasks'
|
10
|
+
|
11
|
+
require 'rspec/core'
|
12
|
+
require 'rspec/core/rake_task'
|
13
|
+
|
14
|
+
task default: :spec
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path('../tasks/fig.rake', __FILE__)
|
@@ -0,0 +1,98 @@
|
|
1
|
+
namespace :fig do
|
2
|
+
desc 'Build or rebuild services.'
|
3
|
+
task :build do
|
4
|
+
on roles(:all) do
|
5
|
+
within "#{fetch(:deploy_to)}" do
|
6
|
+
service = ARGV.last == 'fig:build' ? '' : ARGV.last
|
7
|
+
execute :sudo, :fig, 'build', service
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
desc 'Kill containers'
|
13
|
+
task :kill, :container do |task, args|
|
14
|
+
on roles(:all) do
|
15
|
+
within "#{fetch(:deploy_to)}" do
|
16
|
+
execute :sudo, :fig, 'kill', args[:container]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
desc 'View output from containers.'
|
22
|
+
task :logs do
|
23
|
+
on roles(:all) do
|
24
|
+
within "#{fetch(:deploy_to)}" do
|
25
|
+
execute :sudo, :fig, 'logs'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
desc 'Print the public port for a port binding.'
|
31
|
+
task :port, :service, :private_port do |task, args|
|
32
|
+
on roles(:all) do
|
33
|
+
within "#{fetch(:deploy_to)}" do
|
34
|
+
execute :sudo, :fig, 'port', args[:service], args[:private_port]
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
desc 'List containers'
|
40
|
+
task :ps do
|
41
|
+
on roles(:all) do
|
42
|
+
within "#{fetch(:deploy_to)}" do
|
43
|
+
execute :sudo, :fig, 'ps'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
desc 'Pulls images for services.'
|
49
|
+
task :pull do
|
50
|
+
on roles(:all) do
|
51
|
+
within "#{fetch(:deploy_to)}" do
|
52
|
+
execute :sudo, :fig, 'pull', fetch(:allow_insecure_ssl) ? '--allow-insecure-ssl' : ''
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
desc 'Start services.'
|
58
|
+
task :start, :service do |task, args|
|
59
|
+
on roles(:all) do
|
60
|
+
within "#{fetch(:deploy_to)}" do
|
61
|
+
execute :sudo, :fig, 'start', args[:service]
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
desc 'Stop services.'
|
67
|
+
task :stop, :service do |task, args|
|
68
|
+
on roles(:all) do
|
69
|
+
within "#{fetch(:deploy_to)}" do
|
70
|
+
execute :sudo, :fig, 'stop', args[:service]
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
desc 'Restart services.'
|
76
|
+
task :restart, :service do |task, args|
|
77
|
+
on roles(:all) do
|
78
|
+
within "#{fetch(:deploy_to)}" do
|
79
|
+
execute :sudo, :fig, 'restart', args[:service]
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
desc 'Create and start containers.'
|
85
|
+
task :up do
|
86
|
+
on roles(:all) do
|
87
|
+
within "#{fetch(:deploy_to)}" do
|
88
|
+
execute :sudo, :fig, 'up'
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
namespace :load do
|
95
|
+
task :defaults do
|
96
|
+
set(:deploy_to, '~')
|
97
|
+
end
|
98
|
+
end
|
metadata
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano_fig
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andre Dieb Martins
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec-core
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: capistrano
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sshkit
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.2'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.2'
|
69
|
+
description: Manage fig on servers using Capistrano
|
70
|
+
email:
|
71
|
+
- andre.dieb@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- README.md
|
77
|
+
- Rakefile
|
78
|
+
- lib/capistrano-fig.rb
|
79
|
+
- lib/capistrano/fig.rb
|
80
|
+
- lib/capistrano/tasks/fig.rake
|
81
|
+
homepage: https://github.com/dieb/capistrano-fig
|
82
|
+
licenses:
|
83
|
+
- MIT
|
84
|
+
metadata: {}
|
85
|
+
post_install_message:
|
86
|
+
rdoc_options: []
|
87
|
+
require_paths:
|
88
|
+
- lib
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
requirements: []
|
100
|
+
rubyforge_project:
|
101
|
+
rubygems_version: 2.4.3
|
102
|
+
signing_key:
|
103
|
+
specification_version: 4
|
104
|
+
summary: Manage fig on servers using Capistrano
|
105
|
+
test_files: []
|