capistrano-golang 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4704029b1239ee96dc830abe03bafe0e78a4cce5
4
+ data.tar.gz: dcd1e39dac7bda303b992cd65e5fa4f53b8a3603
5
+ SHA512:
6
+ metadata.gz: e1f6ad88f91bf16a3698fa06fe2943832c53a1eca2a9766e25a02ead3c6c8141c709aa831aff9676956a76aa04577b731b932c663c24bcd01ee67ed684edcd3b
7
+ data.tar.gz: 7937f09942ac3d8ec9dca2026e6c9541694f42487e950b35b4785df96f1a40e056634c305ae26de37c3a9be7f1e2a22fd8955277614d5c5fb4f5304dd9b57e34
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ Gemfile.lock
2
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-gvm.gemspec
4
+ gemspec
data/README.md ADDED
File without changes
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = "capistrano-golang"
7
+ gem.version = '0.1.0'
8
+ gem.authors = ["Dimitrij Denissenko"]
9
+ gem.email = ["dimitrij@blacksquaremedia.com"]
10
+ gem.description = %q{Go deployment tasks for Capistrano}
11
+ gem.summary = %q{Capistrano with Go(lang)}
12
+ gem.homepage = "https://github.com/bsm/capistrano-golang"
13
+ gem.licenses = ["MIT"]
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
17
+ gem.require_paths = ["lib"]
18
+
19
+ gem.add_dependency 'capistrano', '~> 3.0'
20
+ end
@@ -0,0 +1 @@
1
+ require 'capistrano/golang'
@@ -0,0 +1 @@
1
+ load File.expand_path("../tasks/golang.rake", __FILE__)
@@ -0,0 +1,49 @@
1
+ namespace :go do
2
+
3
+ desc "Prints the Go version on the target host"
4
+ task :status do
5
+ on roles(fetch(:go_roles)) do
6
+ info capture(:go, "version")
7
+ end
8
+ end
9
+
10
+ task :hook do
11
+ target = File.join(fetch(:go_root), fetch(:go_version))
12
+
13
+ on roles(fetch(:go_roles)) do
14
+ SSHKit.config.command_map.prefix[:go].unshift "GOROOT=#{target} PATH=#{target}/bin:$PATH"
15
+ end
16
+ end
17
+
18
+ task :check do
19
+ target = File.join(fetch(:go_root), fetch(:go_version))
20
+
21
+ on roles(fetch(:go_roles)) do
22
+ if not test "[ -d #{target}/src ]"
23
+ 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}"
26
+ end
27
+
28
+ if not test "[ -f #{target}/bin/go ]"
29
+ info "Installing #{fetch(:go_version)}"
30
+ execute %(cd #{target}/src && ./make.bash)
31
+ end
32
+ end
33
+ end
34
+
35
+ end
36
+
37
+ Capistrano::DSL.stages.each do |stage|
38
+ after stage, 'go:hook'
39
+ end
40
+ after 'deploy:check', 'go:check'
41
+
42
+ namespace :load do
43
+ task :defaults do
44
+ 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"
48
+ end
49
+ end
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-golang
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Dimitrij Denissenko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-10 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.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ description: Go deployment tasks for Capistrano
28
+ email:
29
+ - dimitrij@blacksquaremedia.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - Gemfile
36
+ - README.md
37
+ - Rakefile
38
+ - capistrano-golang.gemspec
39
+ - lib/capistrano-golang.rb
40
+ - lib/capistrano/golang.rb
41
+ - lib/capistrano/tasks/golang.rake
42
+ homepage: https://github.com/bsm/capistrano-golang
43
+ licenses:
44
+ - MIT
45
+ metadata: {}
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubyforge_project:
62
+ rubygems_version: 2.4.5
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: Capistrano with Go(lang)
66
+ test_files: []