capistrano-golang 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4704029b1239ee96dc830abe03bafe0e78a4cce5
4
- data.tar.gz: dcd1e39dac7bda303b992cd65e5fa4f53b8a3603
3
+ metadata.gz: f445ce8f9c6d5aac0f4fb59cc7ce416af516fd58
4
+ data.tar.gz: 2d664b9a16d323c29d085d770602e78a83b83147
5
5
  SHA512:
6
- metadata.gz: e1f6ad88f91bf16a3698fa06fe2943832c53a1eca2a9766e25a02ead3c6c8141c709aa831aff9676956a76aa04577b731b932c663c24bcd01ee67ed684edcd3b
7
- data.tar.gz: 7937f09942ac3d8ec9dca2026e6c9541694f42487e950b35b4785df96f1a40e056634c305ae26de37c3a9be7f1e2a22fd8955277614d5c5fb4f5304dd9b57e34
6
+ metadata.gz: 7a71dfd420ece4c2ed46ccd4e2e361c0e87ba7c2f8bf5ec0a6b38e2c99a76e95b1cd603c4c437ac3a5ef7817334974ff238421ff1d1249497fa4862b35343580
7
+ data.tar.gz: 5aa46cb3da313057e38e7e58d0995f8d5ac149b89e8115cedf8a9c2a49834307954c2f54a66ad0c4f910c61f562254f92db2213e140cce60ae18b1474350ce5f
@@ -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.1.0'
7
+ gem.version = '0.2.0'
8
8
  gem.authors = ["Dimitrij Denissenko"]
9
9
  gem.email = ["dimitrij@blacksquaremedia.com"]
10
10
  gem.description = %q{Go deployment tasks for Capistrano}
@@ -8,26 +8,24 @@ namespace :go do
8
8
  end
9
9
 
10
10
  task :hook do
11
- target = File.join(fetch(:go_root), fetch(:go_version))
12
-
11
+ goroot = fetch(:go_root)
13
12
  on roles(fetch(:go_roles)) do
14
- SSHKit.config.command_map.prefix[:go].unshift "GOROOT=#{target} PATH=#{target}/bin:$PATH"
13
+ SSHKit.config.command_map.prefix[:go].unshift "GOROOT=#{goroot} PATH=#{goroot}/bin:$PATH"
15
14
  end
16
15
  end
17
16
 
18
17
  task :check do
19
- target = File.join(fetch(:go_root), fetch(:go_version))
20
-
18
+ goroot = fetch(:go_root)
21
19
  on roles(fetch(:go_roles)) do
22
- if not test "[ -d #{target}/src ]"
20
+ if not test "[ -d #{goroot}/src ]"
23
21
  info "Downloading #{fetch :go_version}"
24
- execute :mkdir, "-p", target
25
- execute :curl, "-L #{fetch :go_source}/#{fetch :go_version}.tar.gz | tar xvz --strip-components=1 -C #{target}"
22
+ execute :mkdir, "-p", goroot
23
+ execute :curl, "-sSL #{fetch :go_source} | tar xvz --strip-components=1 -C #{goroot}"
26
24
  end
27
25
 
28
- if not test "[ -f #{target}/bin/go ]"
29
- info "Installing #{fetch(:go_version)}"
30
- execute %(cd #{target}/src && ./make.bash)
26
+ if not test "[ -f #{goroot}/bin/go ]"
27
+ info "Installing #{fetch :go_version}"
28
+ execute %(cd #{goroot}/src && ./make.bash --no-clean 2>&1)
31
29
  end
32
30
  end
33
31
  end
@@ -42,8 +40,12 @@ after 'deploy:check', 'go:check'
42
40
  namespace :load do
43
41
  task :defaults do
44
42
  set :go_version, "go1.4.1"
45
- set :go_root, "~/.gos"
46
- set :go_roles, :all
47
- set :go_source, "https://github.com/golang/go/archive"
43
+ set :go_roles, :all
44
+
45
+ set :go_install_path, "~/.gos"
46
+ set :go_archive, "https://golang.org/dl/VERSION.src.tar.gz"
47
+
48
+ set :go_root, -> { File.join(fetch(:go_install_path), fetch(:go_version)) }
49
+ set :go_source, -> { fetch(:go_archive).sub("VERSION", fetch(:go_version)) }
48
50
  end
49
51
  end
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.1.0
4
+ version: 0.2.0
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-02-10 00:00:00.000000000 Z
11
+ date: 2015-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano