envirobly 0.4.1 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/envirobly/config.rb +5 -5
- data/lib/envirobly/deployment.rb +12 -15
- data/lib/envirobly/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4df26217f5f0c3dc57f4b1413d8d78e60f12532067ddd33036d3fff8910c69ed
|
4
|
+
data.tar.gz: 04bb82ea5693b170be38484890f2ecab17a6c080c8c443cf03f6231084a89082
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66ca715c8dd25acae13bef402d65a45602972e4f97bebeb52880de1b9df0e93b4a9c0b256fd619ae06af905c32d59c927e21945fec539295bd01b01ac8a7fbb5
|
7
|
+
data.tar.gz: 194dde3701339effc1d5da5673195efad226fe9253d6db9dfc987a0478a69493216cf687f9ddcff9c5a66e049564ff9864fb0a406cc104e946425d68725ee390
|
data/lib/envirobly/config.rb
CHANGED
@@ -6,14 +6,14 @@ class Envirobly::Config
|
|
6
6
|
DIR = ".envirobly"
|
7
7
|
PATH = "#{DIR}/project.yml"
|
8
8
|
|
9
|
-
attr_reader :parsing_error
|
9
|
+
attr_reader :parsing_error, :raw
|
10
10
|
|
11
11
|
def initialize(commit)
|
12
12
|
@commit = commit
|
13
13
|
@parsing_error = nil
|
14
|
-
@
|
14
|
+
@raw = config_content_at_commit
|
15
15
|
|
16
|
-
if @project
|
16
|
+
if @project = parse
|
17
17
|
transform_env_var_values!
|
18
18
|
append_image_tags!
|
19
19
|
end
|
@@ -38,8 +38,8 @@ class Envirobly::Config
|
|
38
38
|
end
|
39
39
|
|
40
40
|
private
|
41
|
-
def
|
42
|
-
YAML.load
|
41
|
+
def parse
|
42
|
+
YAML.load @raw, aliases: true
|
43
43
|
rescue Psych::Exception => exception
|
44
44
|
@parsing_error = exception.message
|
45
45
|
nil
|
data/lib/envirobly/deployment.rb
CHANGED
@@ -25,10 +25,12 @@ class Envirobly::Deployment
|
|
25
25
|
time: @commit.time,
|
26
26
|
message: @commit.message
|
27
27
|
},
|
28
|
-
config: config.to_h
|
28
|
+
config: config.to_h,
|
29
|
+
raw_config: config.raw
|
29
30
|
}
|
30
31
|
|
31
|
-
puts
|
32
|
+
puts "Deployment config:"
|
33
|
+
puts params.to_yaml
|
32
34
|
|
33
35
|
unless environment =~ URL_MATCHER
|
34
36
|
if project_url = config.dig("remote", "origin")
|
@@ -41,18 +43,20 @@ class Envirobly::Deployment
|
|
41
43
|
|
42
44
|
@api = Envirobly::Api.new
|
43
45
|
response = @api.create_deployment params
|
44
|
-
|
45
|
-
response = @api.get_deployment_with_delay_and_retry
|
46
|
+
deployment_url = response.object.fetch("url")
|
47
|
+
response = @api.get_deployment_with_delay_and_retry deployment_url
|
46
48
|
@credentials = Envirobly::Aws::Credentials.new response.object.fetch("credentials")
|
47
49
|
@bucket = response.object.fetch("bucket")
|
48
50
|
|
49
|
-
|
50
|
-
|
51
|
-
else
|
51
|
+
puts "Uploading build context, please wait..."
|
52
|
+
unless archive_commit_and_upload
|
52
53
|
$stderr.puts "Error exporting build context. Aborting."
|
53
54
|
exit 1
|
54
55
|
end
|
55
56
|
|
57
|
+
puts "Build context uploaded."
|
58
|
+
@api.put_as_json deployment_url
|
59
|
+
|
56
60
|
# TODO: Output URL to watch the deployment progress
|
57
61
|
end
|
58
62
|
|
@@ -63,13 +67,6 @@ class Envirobly::Deployment
|
|
63
67
|
|
64
68
|
def archive_commit_and_upload
|
65
69
|
`git archive --format=tar.gz #{@commit.ref} | #{@credentials.as_inline_env_vars} aws s3 cp - #{archive_uri}`
|
66
|
-
$?.success
|
67
|
-
params = {
|
68
|
-
deployment: {
|
69
|
-
build_context_available: result
|
70
|
-
}
|
71
|
-
}
|
72
|
-
@api.put_as_json @url, params: params
|
73
|
-
end
|
70
|
+
$?.success?
|
74
71
|
end
|
75
72
|
end
|
data/lib/envirobly/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: envirobly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Starsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|