dpl 2.0.0.alpha.14 → 2.0.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +37 -37
- data/NOTES.md +0 -119
- data/README.md +56 -5
- data/dpl-chef_supermarket-1.10.14.gem +0 -0
- data/lib/dpl/helper/interpolate.rb +24 -1
- data/lib/dpl/provider.rb +10 -0
- data/lib/dpl/provider/dsl.rb +25 -0
- data/lib/dpl/providers.rb +1 -0
- data/lib/dpl/providers/anynines.rb +2 -0
- data/lib/dpl/providers/azure_web_apps.rb +2 -0
- data/lib/dpl/providers/bintray.rb +2 -0
- data/lib/dpl/providers/bluemixcloudfoundry.rb +3 -1
- data/lib/dpl/providers/boxfuse.rb +2 -0
- data/lib/dpl/providers/cargo.rb +3 -1
- data/lib/dpl/providers/cloud66.rb +2 -0
- data/lib/dpl/providers/cloudfiles.rb +2 -0
- data/lib/dpl/providers/cloudformation.rb +1 -0
- data/lib/dpl/providers/cloudfoundry.rb +2 -0
- data/lib/dpl/providers/codedeploy.rb +7 -3
- data/lib/dpl/providers/convox.rb +2 -0
- data/lib/dpl/providers/datica.rb +2 -0
- data/lib/dpl/providers/elasticbeanstalk.rb +2 -0
- data/lib/dpl/providers/engineyard.rb +2 -0
- data/lib/dpl/providers/firebase.rb +2 -0
- data/lib/dpl/providers/flynn.rb +33 -0
- data/lib/dpl/providers/gae.rb +2 -0
- data/lib/dpl/providers/gcs.rb +2 -0
- data/lib/dpl/providers/gleis.rb +2 -0
- data/lib/dpl/providers/hackage.rb +2 -0
- data/lib/dpl/providers/hephy.rb +2 -0
- data/lib/dpl/providers/heroku.rb +2 -0
- data/lib/dpl/providers/heroku/api.rb +1 -1
- data/lib/dpl/providers/heroku/git.rb +1 -1
- data/lib/dpl/providers/lambda.rb +4 -2
- data/lib/dpl/providers/launchpad.rb +2 -0
- data/lib/dpl/providers/netlify.rb +2 -0
- data/lib/dpl/providers/npm.rb +2 -0
- data/lib/dpl/providers/openshift.rb +2 -0
- data/lib/dpl/providers/opsworks.rb +2 -0
- data/lib/dpl/providers/packagecloud.rb +2 -0
- data/lib/dpl/providers/pages.rb +2 -0
- data/lib/dpl/providers/pages/api.rb +1 -1
- data/lib/dpl/providers/pages/git.rb +5 -5
- data/lib/dpl/providers/puppetforge.rb +2 -0
- data/lib/dpl/providers/pypi.rb +2 -0
- data/lib/dpl/providers/releases.rb +2 -0
- data/lib/dpl/providers/rubygems.rb +2 -0
- data/lib/dpl/providers/s3.rb +2 -0
- data/lib/dpl/providers/scalingo.rb +2 -0
- data/lib/dpl/providers/script.rb +2 -0
- data/lib/dpl/providers/snap.rb +3 -1
- data/lib/dpl/providers/surge.rb +2 -0
- data/lib/dpl/providers/testfairy.rb +2 -0
- data/lib/dpl/providers/transifex.rb +2 -0
- data/lib/dpl/version.rb +1 -1
- data/status.json +13 -8
- metadata +5 -4
Binary file
|
@@ -52,6 +52,14 @@ module Dpl
|
|
52
52
|
Interpolator.new(str, self, args || {}, opts).apply
|
53
53
|
end
|
54
54
|
|
55
|
+
# Interpolation variables as declared by the provider.
|
56
|
+
#
|
57
|
+
# By default this contains string option names, but additional
|
58
|
+
# methods can be added using Provider::Dsl#vars.
|
59
|
+
def vars
|
60
|
+
self.class.vars
|
61
|
+
end
|
62
|
+
|
55
63
|
# Obfuscates the given string.
|
56
64
|
#
|
57
65
|
# Replaces all but the first N characters with asterisks, and paddes
|
@@ -71,6 +79,7 @@ module Dpl
|
|
71
79
|
PATTERN = /%\{(\$?[\w]+)\}/
|
72
80
|
ENV_VAR = /^\$[A-Z_]+$/
|
73
81
|
UPCASE = /^[A-Z_]+$/
|
82
|
+
UNKNOWN = '[unknown variable: %s]'
|
74
83
|
|
75
84
|
def apply
|
76
85
|
str = interpolate(self.str.to_s)
|
@@ -102,7 +111,9 @@ module Dpl
|
|
102
111
|
end
|
103
112
|
|
104
113
|
def lookup(key)
|
105
|
-
if
|
114
|
+
if vars? && !var?(key)
|
115
|
+
UNKNOWN % key
|
116
|
+
elsif mod = modifier(key)
|
106
117
|
key = key.to_s.sub("#{mod}d_", '')
|
107
118
|
obj.send(mod, lookup(key))
|
108
119
|
elsif key.to_s =~ ENV_VAR
|
@@ -121,6 +132,18 @@ module Dpl
|
|
121
132
|
def modifier(key)
|
122
133
|
MODIFIER.detect { |mod| key.to_s.start_with?("#{mod}d_") }
|
123
134
|
end
|
135
|
+
|
136
|
+
def var?(key)
|
137
|
+
vars.include?(key)
|
138
|
+
end
|
139
|
+
|
140
|
+
def vars
|
141
|
+
opts[:vars]
|
142
|
+
end
|
143
|
+
|
144
|
+
def vars?
|
145
|
+
!!vars
|
146
|
+
end
|
124
147
|
end
|
125
148
|
end
|
126
149
|
end
|
data/lib/dpl/provider.rb
CHANGED
@@ -152,6 +152,16 @@ module Dpl
|
|
152
152
|
opt '--fold', 'Wrap log output in folds', internal: true
|
153
153
|
opt '--edge', internal: true
|
154
154
|
|
155
|
+
vars *%i(
|
156
|
+
git_author_email
|
157
|
+
git_author_name
|
158
|
+
git_branch
|
159
|
+
git_commit_author
|
160
|
+
git_commit_msg
|
161
|
+
git_sha
|
162
|
+
git_tag
|
163
|
+
)
|
164
|
+
|
155
165
|
msgs before_install: 'Installing deployment dependencies',
|
156
166
|
before_setup: 'Setting the build environment up for the deployment',
|
157
167
|
setup_git_ssh: 'Setting up git-ssh',
|
data/lib/dpl/provider/dsl.rb
CHANGED
@@ -2,6 +2,15 @@ require 'dpl/helper/squiggle'
|
|
2
2
|
require 'dpl/helper/wrap'
|
3
3
|
require 'dpl/provider/status'
|
4
4
|
|
5
|
+
# TODO figure out how to allow adding domain specific behavior like this to Cl
|
6
|
+
class Cl::Opt
|
7
|
+
OPTS << :interpolate
|
8
|
+
|
9
|
+
def interpolate?
|
10
|
+
opts[:interpolate]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
5
14
|
module Dpl
|
6
15
|
class Provider < Cl::Cmd
|
7
16
|
# DSL available on the provider's class body.
|
@@ -36,6 +45,22 @@ module Dpl
|
|
36
45
|
status ? @status = Status.new(self, status, msg) : @status
|
37
46
|
end
|
38
47
|
|
48
|
+
# Declare additional variables available for interpolation.
|
49
|
+
#
|
50
|
+
# Interpolating strings, when these exposed to the user, should safelist
|
51
|
+
# which variables are available. Options declared on a provider are
|
52
|
+
# always available, except if they are flags, arrays, internal, or
|
53
|
+
# secrets. This method can be used to allow additional variables, e.g.
|
54
|
+
# from the git context.
|
55
|
+
def vars(*vars)
|
56
|
+
return self.vars.concat(vars) if vars.any?
|
57
|
+
return @vars if instance_variable_defined?(:@vars)
|
58
|
+
vars = superclass.respond_to?(:vars) ? superclass.vars : []
|
59
|
+
reject = %i(flag array internal interpolate secret)
|
60
|
+
opts = reject.inject(self.opts) { |opts, attr| opts.reject(&:"#{attr}?") }
|
61
|
+
@vars = vars.dup.concat(opts.map(&:name)).uniq.sort - [:strategy]
|
62
|
+
end
|
63
|
+
|
39
64
|
# @!method env
|
40
65
|
# Declare an environment variable prefix to accept env vars as options
|
41
66
|
#
|
data/lib/dpl/providers.rb
CHANGED
@@ -15,6 +15,7 @@ require 'dpl/providers/convox'
|
|
15
15
|
require 'dpl/providers/elasticbeanstalk'
|
16
16
|
require 'dpl/providers/engineyard'
|
17
17
|
require 'dpl/providers/firebase'
|
18
|
+
require 'dpl/providers/flynn'
|
18
19
|
require 'dpl/providers/gae'
|
19
20
|
require 'dpl/providers/gcs'
|
20
21
|
require 'dpl/providers/gleis'
|
data/lib/dpl/providers/cargo.rb
CHANGED
@@ -3,7 +3,9 @@ module Dpl
|
|
3
3
|
# split this up to CodeDeploy::Github and CodeDeploy::S3 using the
|
4
4
|
# revision_type, in order to make opts more strict
|
5
5
|
class Codedeploy < Provider
|
6
|
-
|
6
|
+
register :codedeploy
|
7
|
+
|
8
|
+
status :beta
|
7
9
|
|
8
10
|
full_name 'AWS Code Deploy'
|
9
11
|
|
@@ -30,7 +32,7 @@ module Dpl
|
|
30
32
|
opt '--wait_until_deployed', 'Wait until the deployment has finished'
|
31
33
|
opt '--bundle_type TYPE', 'Bundle type of the revision'
|
32
34
|
opt '--key KEY', 'S3 bucket key of the revision'
|
33
|
-
opt '--description DESCR', 'Description of the revision'
|
35
|
+
opt '--description DESCR', 'Description of the revision', interpolate: true
|
34
36
|
opt '--endpoint ENDPOINT', 'S3 endpoint url'
|
35
37
|
|
36
38
|
msgs login: 'Using Access Key: %{access_key_id}',
|
@@ -44,6 +46,8 @@ module Dpl
|
|
44
46
|
unknown_revision_type: 'Unknown revision type %p',
|
45
47
|
unknown_bundle_type: 'Unknown bundle type'
|
46
48
|
|
49
|
+
vars :build_number
|
50
|
+
|
47
51
|
def login
|
48
52
|
info :login
|
49
53
|
end
|
@@ -152,7 +156,7 @@ module Dpl
|
|
152
156
|
end
|
153
157
|
|
154
158
|
def description
|
155
|
-
super ||
|
159
|
+
interpolate(super || msg(:description), vars: vars)
|
156
160
|
end
|
157
161
|
|
158
162
|
def build_number
|
data/lib/dpl/providers/convox.rb
CHANGED
data/lib/dpl/providers/datica.rb
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
module Dpl
|
2
|
+
module Providers
|
3
|
+
class Flynn < Provider
|
4
|
+
register :flynn
|
5
|
+
|
6
|
+
status :dev
|
7
|
+
|
8
|
+
full_name 'Flynn'
|
9
|
+
|
10
|
+
description sq(<<-str)
|
11
|
+
Flynn provider for Dpl
|
12
|
+
str
|
13
|
+
|
14
|
+
opt '--git URL', 'Flynn Git remote URL', required: true
|
15
|
+
|
16
|
+
needs :git, :git_http_user_agent
|
17
|
+
|
18
|
+
cmds fetch: 'git fetch origin $TRAVIS_BRANCH --unshallow',
|
19
|
+
push: 'git push %{remote} HEAD:refs/heads/master -f'
|
20
|
+
|
21
|
+
def deploy
|
22
|
+
shell :fetch, assert: false
|
23
|
+
shell :push
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def remote
|
29
|
+
git
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/dpl/providers/gae.rb
CHANGED
data/lib/dpl/providers/gcs.rb
CHANGED
data/lib/dpl/providers/gleis.rb
CHANGED
data/lib/dpl/providers/hephy.rb
CHANGED
data/lib/dpl/providers/heroku.rb
CHANGED
data/lib/dpl/providers/lambda.rb
CHANGED
@@ -3,6 +3,8 @@ require 'dpl/helper/zip'
|
|
3
3
|
module Dpl
|
4
4
|
module Providers
|
5
5
|
class Lambda < Provider
|
6
|
+
register :lambda
|
7
|
+
|
6
8
|
status :stable
|
7
9
|
|
8
10
|
full_name 'AWS Lambda'
|
@@ -24,7 +26,7 @@ module Dpl
|
|
24
26
|
opt '--role ROLE', 'ARN of the IAM role to assign to the Lambda function', note: 'required when creating a new function'
|
25
27
|
opt '--handler_name NAME', 'Function the Lambda calls to begin execution.', note: 'required when creating a new function'
|
26
28
|
opt '--module_name NAME', 'Name of the module that exports the handler', default: 'index', requires: :handler_name
|
27
|
-
opt '--description DESCR', 'Description of the Lambda being created or updated'
|
29
|
+
opt '--description DESCR', 'Description of the Lambda being created or updated', interpolate: true
|
28
30
|
opt '--timeout SECS', 'Function execution time (in seconds) at which Lambda should terminate the function', default: 3
|
29
31
|
opt '--memory_size MB', 'Amount of memory in MB to allocate to this Lambda', default: 128
|
30
32
|
opt '--subnet_ids IDS', 'List of subnet IDs to be added to the function', type: :array, note: 'Needs the ec2:DescribeSubnets and ec2:DescribeVpcs permission for the user of the access/secret key to work'
|
@@ -157,7 +159,7 @@ module Dpl
|
|
157
159
|
end
|
158
160
|
|
159
161
|
def description
|
160
|
-
super ||
|
162
|
+
interpolate(super || msg(:description), vars: vars)
|
161
163
|
end
|
162
164
|
|
163
165
|
def client
|