dpl-engine_yard 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/dpl-engine_yard.gemspec +3 -0
- data/lib/dpl/provider/engine_yard.rb +89 -0
- data/notes/engine_yard.md +1 -0
- data/spec/provider/engine_yard_spec.rb +0 -0
- metadata +174 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 741d4a26de4c7a05f9a66ba6c6aec865a32aa78f
|
4
|
+
data.tar.gz: c630155ce3e6db230a6adbd85c1271d781cc4a06
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 862b189172581a940eee9920bdc2a9df1240a72d221090f22c1081920d8ad344da9bba73a22c086502a8d3bf70ced09e68dd733260b79bf27ca38869f8c52623
|
7
|
+
data.tar.gz: be3df1fd7e5aa51889cb5c2e11429302dab4e795887c1771785d8b52c42b181e4aafe928bf6810ae37ed67bbafc493a86f90ee34a8c234517ead1a7037136cf7
|
@@ -0,0 +1,89 @@
|
|
1
|
+
require 'time'
|
2
|
+
require 'engineyard-cloud-client'
|
3
|
+
|
4
|
+
module DPL
|
5
|
+
class Provider
|
6
|
+
class EngineYard < Provider
|
7
|
+
def token
|
8
|
+
options[:api_key] ||= if options[:email] and options[:password]
|
9
|
+
EY::CloudClient.authenticate(options[:email], options[:password])
|
10
|
+
else
|
11
|
+
option(:api_key) # will raise
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def api
|
16
|
+
@api ||= EY::CloudClient.new(:token => token)
|
17
|
+
end
|
18
|
+
|
19
|
+
def check_auth
|
20
|
+
log "authenticated as %s" % api.current_user.email
|
21
|
+
end
|
22
|
+
|
23
|
+
def check_app
|
24
|
+
remotes = `git remote -v`.scan(/\t[^\s]+\s/).map { |c| c.strip }.uniq
|
25
|
+
@current_sha = `git rev-parse HEAD`.chomp
|
26
|
+
resolver = api.resolve_app_environments(
|
27
|
+
:app_name => options[:app],
|
28
|
+
:account_name => options[:account],
|
29
|
+
:environment_name => options[:environment],
|
30
|
+
:remotes => remotes)
|
31
|
+
resolver.one_match { @app_env = resolver.matches.first }
|
32
|
+
resolver.no_matches { error resolver.errors.join("\n").inspect }
|
33
|
+
resolver.many_matches do |matches|
|
34
|
+
message = "Multiple matches possible, please be more specific:\n\n"
|
35
|
+
matches.each do |appenv|
|
36
|
+
message << "environment: '#{appenv.environment.name}' account: '#{appenv.environment.account.name}'\n"
|
37
|
+
end
|
38
|
+
error message
|
39
|
+
end
|
40
|
+
@app_env
|
41
|
+
end
|
42
|
+
|
43
|
+
def needs_key?
|
44
|
+
false
|
45
|
+
end
|
46
|
+
|
47
|
+
def cleanup
|
48
|
+
end
|
49
|
+
|
50
|
+
def uncleanup
|
51
|
+
end
|
52
|
+
|
53
|
+
def push_app
|
54
|
+
deploy_opts = {:ref => @current_sha}
|
55
|
+
if command = options[:migrate]
|
56
|
+
if command === true || command === "true"
|
57
|
+
error("\"true\" doesn't look like a migration command, try --migrate=\"rake db:migrate\"")
|
58
|
+
end
|
59
|
+
deploy_opts[:migrate] = true
|
60
|
+
deploy_opts[:migration_command] = command
|
61
|
+
end
|
62
|
+
print "deploying "
|
63
|
+
deployment = EY::CloudClient::Deployment.deploy(api, @app_env, deploy_opts)
|
64
|
+
result = poll_for_result(deployment)
|
65
|
+
unless result.successful
|
66
|
+
error "Deployment failed (see logs on Engine Yard)"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def poll_for_result(deployment)
|
71
|
+
until deployment.finished?
|
72
|
+
sleep 5
|
73
|
+
#TODO: configurable timeout?
|
74
|
+
print "."
|
75
|
+
deployment = EY::CloudClient::Deployment.get(api, deployment.app_environment, deployment.id)
|
76
|
+
end
|
77
|
+
puts "DONE: https://cloud.engineyard.com/apps/#{deployment.app.id}/environments/#{deployment.environment.id}/deployments/#{deployment.id}/pretty"
|
78
|
+
deployment
|
79
|
+
end
|
80
|
+
|
81
|
+
def deploy
|
82
|
+
super
|
83
|
+
rescue EY::CloudClient::Error => e
|
84
|
+
error(e.message)
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
EY has a a special deploy app. Get in touch with Kevin Holler if we don't hear back from them.
|
File without changes
|
metadata
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dpl-engine_yard
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.9.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Konstantin Haase
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-03-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: dpl
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.9.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.9.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: engineyard-cloud-client
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
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: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec-its
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: json_pure
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: tins
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: coveralls
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: highline
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
description: deploy tool abstraction for clients
|
140
|
+
email: konstantin.mailinglists@googlemail.com
|
141
|
+
executables: []
|
142
|
+
extensions: []
|
143
|
+
extra_rdoc_files: []
|
144
|
+
files:
|
145
|
+
- dpl-engine_yard.gemspec
|
146
|
+
- lib/dpl/provider/engine_yard.rb
|
147
|
+
- notes/engine_yard.md
|
148
|
+
- spec/provider/engine_yard_spec.rb
|
149
|
+
homepage: https://github.com/travis-ci/dpl
|
150
|
+
licenses:
|
151
|
+
- MIT
|
152
|
+
metadata: {}
|
153
|
+
post_install_message:
|
154
|
+
rdoc_options: []
|
155
|
+
require_paths:
|
156
|
+
- lib
|
157
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '2.2'
|
162
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
requirements: []
|
168
|
+
rubyforge_project:
|
169
|
+
rubygems_version: 2.6.13
|
170
|
+
signing_key:
|
171
|
+
specification_version: 4
|
172
|
+
summary: deploy tool
|
173
|
+
test_files:
|
174
|
+
- spec/provider/engine_yard_spec.rb
|