app_builder 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 149fe7ac668f0ea948e2af2e8b9aae387ac6ef1cac4592bf1177ff4e0f2ecf61
4
- data.tar.gz: 67988388e57e2ec2497b4af7afbdde4461286ba380393f8c670cacd534839c4f
3
+ metadata.gz: c3a9a7a2e2b527a50937de68b43d92875efd6d3ebed6b825d6ab85b2ac1b77fc
4
+ data.tar.gz: 50209788fbf7a82ecf0750156595830884972c319398a4415a64ec1dfa042641
5
5
  SHA512:
6
- metadata.gz: 3f235767dd93845ffd8c14ea5de871bc40c6015e283fad6853f823fd4c9039dde72e8c5db52995f33bbea08c3726ca7d2a468d7ddb65f8f0b3c0a5851cb26976
7
- data.tar.gz: 43f9111c90199bdbabbf2d7bd3862ed58f254be6864bc1052e12e4e6680bbb22627836c4d1852d9402f7afc253c8e467684d1dbbbeb1769b5e7fba4a78833c27
6
+ metadata.gz: 9e2f8f7182e97a7d05c7415ceb8cf85a4b4548f5e091dc3411aa873a1b922d8968b14f2a0c96288eb6473be6eb9fad00f50e75b424f7133e124b33a89d471e62
7
+ data.tar.gz: 8795cfc3472e6eb06f81167c0eb718d1811b059c39e702a98c6834d57a2f58b9bd6c1d362ab3b72a04e968cc32e8c0067cf3680154bd54e796100356c21b6797
@@ -1,14 +1,15 @@
1
1
  module AppBuilder
2
2
  class Config
3
3
  CHANGEABLE_PARAMETERS = [
4
- :build_id, # default: timestamp
5
- :project_name, # default: repository name
6
- :remote_repository, # default: remote origin
7
- :branch, # default: TARGET_BRANCH or master
8
- :revision, # default: commit hash
9
- :upload_type, # :s3 or :http or :https (default: :s3)
10
- :upload_id, # bucket name or remote host (default: none)
11
- :logger, # default: AppBuilder::Logger
4
+ :build_id, # default: timestamp
5
+ :project_name, # default: repository name
6
+ :remote_repository, # default: remote origin
7
+ :branch, # default: TARGET_BRANCH or master
8
+ :revision, # default: commit hash
9
+ :upload_type, # :s3 or :http or :https (default: :s3)
10
+ :upload_id, # bucket name or remote host (default: none)
11
+ :remote_app_home_base, # default: /var/www
12
+ :logger, # default: AppBuilder::Logger
12
13
 
13
14
  # hooks
14
15
  :before_archive,
@@ -47,6 +48,7 @@ module AppBuilder
47
48
  :remote_src_file,
48
49
  :remote_manifest_file,
49
50
  :src_url,
51
+ :manifest_url,
50
52
  :remote_app_home,
51
53
  ].concat(CHANGEABLE_PARAMETERS).freeze
52
54
 
@@ -109,11 +111,19 @@ module AppBuilder
109
111
  end
110
112
 
111
113
  def src_url
112
- "#{upload_type.to_s}://#{File.join(upload_id, remote_src_path, build_name)}"
114
+ uploaded_url(remote_src_file)
115
+ end
116
+
117
+ def manifest_url
118
+ uploaded_url(remote_manifest_file)
113
119
  end
114
120
 
115
121
  def remote_app_home
116
- File.join("/var/www", project_name)
122
+ File.join(remote_app_home_base, project_name)
123
+ end
124
+
125
+ def uploaded_url(path)
126
+ "#{upload_type.to_s}://#{File.join(upload_id, path)}"
117
127
  end
118
128
 
119
129
  def reset
@@ -127,6 +137,7 @@ module AppBuilder
127
137
  @remote_manifest_path = "manifests"
128
138
  @resource_user = ENV.fetch("USER", nil)
129
139
  @resource_ssh_options = {}
140
+ @remote_app_home_base = "/var/www"
130
141
  @logger = Logger.new(STDOUT)
131
142
  @upload_type = :s3
132
143
 
@@ -32,7 +32,7 @@ module AppBuilder
32
32
  end
33
33
 
34
34
  def upload_to_s3(local, remote)
35
- log(:info, "Upload #{local} to #{src_url}")
35
+ log(:info, "Upload #{local} to #{config.uploaded_url(remote)}")
36
36
  s3_client.put_object(
37
37
  bucket: upload_id,
38
38
  key: remote,
@@ -1,3 +1,3 @@
1
1
  module AppBuilder
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - i2bskn