mina-circle 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/mina-circle.rb +6 -0
- data/lib/mina-circle/helpers.rb +23 -0
- data/lib/mina-circle/tasks.rb +34 -0
- data/lib/mina-circle/version.rb +3 -0
- metadata +70 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b9c8ca20aafb5a47508240603e00aa3281522ebe
|
4
|
+
data.tar.gz: 8205c8898aa81cb1a3dcad223a96badbe1763d9e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 67b454ba59de6651aacf5842036aa280a3b51d88c7554e265abcd91e87e2e78b29e40b982f560a54f9888a95cc74103965d375d74e464a348f9d53dc6e820769
|
7
|
+
data.tar.gz: 2158b598ab00630453fdddc5577e5c40b464d2d601834c6b405b9149baeea292b9982cb3a0f4aa96910fa9109f4db1792e14205d10c0b194f42c70861def0cb0
|
data/lib/mina-circle.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
module MinaCircle
|
2
|
+
module Helpers
|
3
|
+
def parse_from_home_dir
|
4
|
+
File.exist?(config_file) ? YAML.load_file(config_file)['token'] : nil
|
5
|
+
end
|
6
|
+
|
7
|
+
def config_file
|
8
|
+
File.join(Dir.home, '.mina-circle.yml')
|
9
|
+
end
|
10
|
+
|
11
|
+
def latest_build_number
|
12
|
+
base_uri = 'https://circleci.com/api/v1/project'
|
13
|
+
base_path = "#{circle_user}/#{circle_project}/tree/master"
|
14
|
+
url = "#{base_uri}/#{base_path}?circle-token=#{circle_token}&limit=1&filter=completed"
|
15
|
+
JSON.parse(open(url).read).first['build_num'].to_s
|
16
|
+
end
|
17
|
+
|
18
|
+
def build_url
|
19
|
+
"https://circle-artifacts.com/gh/#{circle_user}/#{circle_project}/#{latest_build_number}/artifacts/0/home/ubuntu/#{circle_artifact}?circle-token=#{circle_token}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
extend MinaCircle::Helpers
|
2
|
+
# # Mina CircleCI Build Artifact Deployment
|
3
|
+
# Deploy builds from CircleCI's artifact library.
|
4
|
+
#
|
5
|
+
# require 'mina-circle'
|
6
|
+
#
|
7
|
+
# ## Settings
|
8
|
+
#
|
9
|
+
# ### circle_token
|
10
|
+
# API access token. By default this is taken from ~/.mina-circle.yml if it exists
|
11
|
+
#
|
12
|
+
# ### circle_user
|
13
|
+
# user name
|
14
|
+
#
|
15
|
+
# ### circle_project
|
16
|
+
# Name by which CircleCI knows your project
|
17
|
+
#
|
18
|
+
# ### circle_artifact
|
19
|
+
# Name CircleCI calls your build archive
|
20
|
+
#
|
21
|
+
# ### circle_explode_command
|
22
|
+
# Command with options for decompressing the artifact archive
|
23
|
+
|
24
|
+
set_default(:circle_token, parse_from_home_dir || fail('CircleCI token required'))
|
25
|
+
|
26
|
+
namespace :circleci do
|
27
|
+
|
28
|
+
desc 'Downloads and explodes the archive file containing the build'
|
29
|
+
task :deploy do
|
30
|
+
queue "curl -o #{circle_artifact} #{build_url}"
|
31
|
+
queue "#{circle_explode_command} #{circle_artifact}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mina-circle
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Patrick Simpson
|
8
|
+
- Michael Yockey
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2015-04-22 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: mina
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0.3'
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.3.0
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - "~>"
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0.3'
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.3.0
|
34
|
+
description: Deploy without dependancies using mina and CircleCI.
|
35
|
+
email:
|
36
|
+
- patrick@heysparkbox.com
|
37
|
+
- mike@heysparkbox.com
|
38
|
+
executables: []
|
39
|
+
extensions: []
|
40
|
+
extra_rdoc_files: []
|
41
|
+
files:
|
42
|
+
- lib/mina-circle.rb
|
43
|
+
- lib/mina-circle/helpers.rb
|
44
|
+
- lib/mina-circle/tasks.rb
|
45
|
+
- lib/mina-circle/version.rb
|
46
|
+
homepage: https://github.com/sparkbox/mina-circle
|
47
|
+
licenses:
|
48
|
+
- MIT
|
49
|
+
metadata: {}
|
50
|
+
post_install_message:
|
51
|
+
rdoc_options: []
|
52
|
+
require_paths:
|
53
|
+
- lib
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
requirements: []
|
65
|
+
rubyforge_project:
|
66
|
+
rubygems_version: 2.2.2
|
67
|
+
signing_key:
|
68
|
+
specification_version: 4
|
69
|
+
summary: Deploy your application from artifacts produced by CircleCI
|
70
|
+
test_files: []
|