capistrano-golang 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +48 -0
- data/capistrano-golang.gemspec +1 -1
- data/lib/capistrano/tasks/golang.rake +25 -11
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ee56e18315b8857cfac8ede4d31c571589e629f
|
4
|
+
data.tar.gz: 5017d3ef8c9057f3ed80cd9a3f76576ebeabff0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af033ca25d8e3e89b7b1a954848d59c100cfe3c28526d688a9a1e10f50bca9209cfd10ed649627078e906afc6a68251811026b25049050bb1292d73124499862
|
7
|
+
data.tar.gz: cd29ac4961fbd766b91a9471869c28d0150a688cb27c9d4d76a7105e2d0d2f565fe04f4a551ad2752f00454f09a420068101a7148d13b4fc1d8b38ae5836cb53
|
data/README.md
CHANGED
@@ -0,0 +1,48 @@
|
|
1
|
+
# capistrano-golang
|
2
|
+
|
3
|
+
Use capistrano to deploy Go projects
|
4
|
+
|
5
|
+
### Usage
|
6
|
+
|
7
|
+
1. Add the following line to your Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'capistrano-golang'
|
11
|
+
```
|
12
|
+
2. Add the following line to your Capfile:
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'capistrano/golang'
|
16
|
+
```
|
17
|
+
3. Configure in config/deploy.rb:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
set :go_version, "go1.4.2"
|
21
|
+
```
|
22
|
+
|
23
|
+
For all configuration options, please see the [defaults](https://github.com/bsm/capistrano-golang/blob/master/lib/capistrano/tasks/golang.rake#L52) section.
|
24
|
+
|
25
|
+
### Licence
|
26
|
+
|
27
|
+
```
|
28
|
+
Copyright (c) 2015 Black Square Media
|
29
|
+
|
30
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
31
|
+
a copy of this software and associated documentation files (the
|
32
|
+
"Software"), to deal in the Software without restriction, including
|
33
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
34
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
35
|
+
permit persons to whom the Software is furnished to do so, subject to
|
36
|
+
the following conditions:
|
37
|
+
|
38
|
+
The above copyright notice and this permission notice shall be
|
39
|
+
included in all copies or substantial portions of the Software.
|
40
|
+
|
41
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
42
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
43
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
44
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
45
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
46
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
47
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
48
|
+
```
|
data/capistrano-golang.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "capistrano-golang"
|
7
|
-
gem.version = '0.2.
|
7
|
+
gem.version = '0.2.1'
|
8
8
|
gem.authors = ["Dimitrij Denissenko"]
|
9
9
|
gem.email = ["dimitrij@blacksquaremedia.com"]
|
10
10
|
gem.description = %q{Go deployment tasks for Capistrano}
|
@@ -15,17 +15,28 @@ namespace :go do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
task :check do
|
18
|
-
goroot = fetch(:go_root)
|
19
18
|
on roles(fetch(:go_roles)) do
|
20
|
-
if
|
21
|
-
|
22
|
-
execute :mkdir, "-p", goroot
|
23
|
-
execute :curl, "-sSL #{fetch :go_source} | tar xvz --strip-components=1 -C #{goroot}"
|
19
|
+
if fetch(:go_version) != fetch(:go_bootstrap_version)
|
20
|
+
go_install(fetch(:go_bootstrap_version), fetch(:go_bootstrap_root), fetch(:go_bootstrap_source))
|
24
21
|
end
|
25
22
|
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
go_install(fetch(:go_version), fetch(:go_root), fetch(:go_source), goroot_bootstrap: fetch(:go_bootstrap_root))
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def go_install(version, goroot, source, env = {})
|
28
|
+
if not test "[ -d #{goroot}/src ]"
|
29
|
+
info "Downloading #{version}"
|
30
|
+
execute :mkdir, "-p", goroot
|
31
|
+
execute :curl, "-sSL #{source} | tar xvz --strip-components=1 -C #{goroot}"
|
32
|
+
end
|
33
|
+
|
34
|
+
if not test "[ -f #{goroot}/bin/go ]"
|
35
|
+
info "Installing #{version}"
|
36
|
+
within "#{goroot}/src" do
|
37
|
+
with env do
|
38
|
+
execute :"./make.bash", %(--no-clean 2>&1)
|
39
|
+
end
|
29
40
|
end
|
30
41
|
end
|
31
42
|
end
|
@@ -39,11 +50,14 @@ after 'deploy:check', 'go:check'
|
|
39
50
|
|
40
51
|
namespace :load do
|
41
52
|
task :defaults do
|
42
|
-
set :
|
53
|
+
set :go_install_path, "~/.gos"
|
54
|
+
set :go_version, "go1.5"
|
43
55
|
set :go_roles, :all
|
56
|
+
set :go_archive, "https://golang.org/dl/VERSION.src.tar.gz"
|
44
57
|
|
45
|
-
set :
|
46
|
-
set :
|
58
|
+
set :go_bootstrap_version, "go1.4.2"
|
59
|
+
set :go_bootstrap_root, -> { File.join(fetch(:go_install_path), fetch(:go_bootstrap_version)) }
|
60
|
+
set :go_bootstrap_source, -> { fetch(:go_archive).sub("VERSION", fetch(:go_bootstrap_version)) }
|
47
61
|
|
48
62
|
set :go_root, -> { File.join(fetch(:go_install_path), fetch(:go_version)) }
|
49
63
|
set :go_source, -> { fetch(:go_archive).sub("VERSION", fetch(:go_version)) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-golang
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitrij Denissenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -59,8 +59,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
59
|
version: '0'
|
60
60
|
requirements: []
|
61
61
|
rubyforge_project:
|
62
|
-
rubygems_version: 2.4.
|
62
|
+
rubygems_version: 2.4.7
|
63
63
|
signing_key:
|
64
64
|
specification_version: 4
|
65
65
|
summary: Capistrano with Go(lang)
|
66
66
|
test_files: []
|
67
|
+
has_rdoc:
|