jets 5.0.0 → 5.0.1

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: 54e94ceb6d67976943a212a5ccceb71bb3e7bd6c6928775c0e7b824be127e42d
4
- data.tar.gz: cab6dba2a8108c047daec4706e15d226e0e7f4eb46e9b6f2617465ea186b451e
3
+ metadata.gz: a4a384d3b0e4d6523695e38deddbb180904b542b7e03cc095ead1844f02a3571
4
+ data.tar.gz: b01933003b19b5ae79c4e6e82427e930a1c82197ebf7efb125d150ea405ef3f5
5
5
  SHA512:
6
- metadata.gz: c050d7738b47e826403bc383baa0b2db251246b3d3dc359135e8e1039f8404448021477b38fbfab57f2be1cd09f7ffe8aa925cff70e313a96e61735f46f4fee2
7
- data.tar.gz: 152c89e1b3e9d124f63687181f48c13ef09e3140062665a6b11baf9a99e830869cd7c8df46a2e1e8e59c58bc08bbb76d6430d235fd296ed176bcf0628890531a
6
+ metadata.gz: 0b40b236e756e6a93649082776f7ea948250619703a51cd98425cc7876085933975011120547bedc098c3a5fe0000aecfe545adb01b8d9c1de76cb4f4e3a36ae
7
+ data.tar.gz: 4cc1b4cdc76eb7fd9d4397b2194300a4974c3d3afe94e954c2073a300ccfcc612f16fee657e86214c0c5c96fb983d1003c88db7e2e04d176516fbc9518f5c37a
data/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/).
5
5
 
6
+ ## [5.0.1] - 2023-12-11
7
+ - [#680](https://github.com/rubyonjets/jets/pull/680) fix apigw gateway replacement warning prompt
8
+ - [#682](https://github.com/rubyonjets/jets/pull/682) Replace puts with Jets.logger.info in jobs
9
+ - [#683](https://github.com/rubyonjets/jets/pull/683) Fix broken links in README and CONTRIBUTING
10
+ - [#684](https://github.com/rubyonjets/jets/pull/684) improve cli usage invalid command and options handling
11
+ - [#685](https://github.com/rubyonjets/jets/pull/685) rollback usage cleanup
12
+ - [#686](https://github.com/rubyonjets/jets/pull/686) remove need for sprockets-jets dependency
13
+ - [#687](https://github.com/rubyonjets/jets/pull/687) jets releases:info command
14
+ - default logging.event to false for generated production
15
+
6
16
  ## [5.0.0] - 2023-12-05
7
17
  Single Lambda Function for Controllers
8
18
  * For controllers, a single Lambda function is deployed going forward.
@@ -330,7 +340,7 @@ Breaking Changes:
330
340
  - #424 md5 fix subtle bug when code doesnt get uploaded from newly generated shims
331
341
  - #425 add hosted zone id support
332
342
  - #426 use headers origin for actual host in case of cloudfront in front
333
- - #428 fixes to JETS_BUILD_NO_INTERNET env var option
343
+ - #428 fixes to JETS_NO_INTERNET env var option
334
344
  - #429 fix simple function tmp_loader
335
345
 
336
346
  ## [2.3.11]
data/CONTRIBUTING.md CHANGED
@@ -1 +1 @@
1
- http://rubyonjets.com/docs/contributing/
1
+ https://rubyonjets.com/docs/more/contributing/
data/README.md CHANGED
@@ -153,18 +153,18 @@ For more documentation, check out the official docs: [Ruby on Jets](http://rubyo
153
153
  * [Local Jets Server](http://rubyonjets.com/docs/local-server/)
154
154
  * [REPL Console](http://rubyonjets.com/docs/repl-console/)
155
155
  * [Project Structure](http://rubyonjets.com/docs/structure/)
156
- * [App Configuration](http://rubyonjets.com/docs/app-config/)
157
- * [Database Support](http://rubyonjets.com/docs/database-support/)
158
- * [Polymorphic Support](http://rubyonjets.com/docs/polymorphic-support/)
156
+ * [App Configuration](http://rubyonjets.com/docs/config/)
157
+ * [Database Support](http://rubyonjets.com/docs/database/)
158
+ * [Polymorphic Support](http://rubyonjets.com/docs/polymorphic/)
159
159
  * [Rails Support](http://rubyonjets.com/docs/rails-support/)
160
160
  * [Tutorials](http://rubyonjets.com/docs/tutorials/)
161
161
  * [Prewarming](http://rubyonjets.com/docs/prewarming/)
162
- * [Custom Resources](http://rubyonjets.com/docs/associated-resources/)
163
- * [Shared Resources](http://rubyonjets.com/docs/shared-resources/)
162
+ * [Custom Resources](http://rubyonjets.com/docs/custom/)
163
+ * [Shared Resources](http://rubyonjets.com/docs/custom/shared-resources/)
164
164
  * [Installation](http://rubyonjets.com/docs/install/)
165
165
  * [CLI Reference](http://rubyonjets.com/reference/)
166
- * [Contributing](http://rubyonjets.com/docs/contributing/)
167
- * [Support Jets](http://rubyonjets.com/support-jets/)
166
+ * [Contributing](http://rubyonjets.com/docs/more/contributing/)
167
+ * [Support Jets](http://rubyonjets.com/donate/)
168
168
  * [Example Projects](https://github.com/tongueroo/jets-examples)
169
169
 
170
170
  ## Learning Content
data/jets.gemspec CHANGED
@@ -54,7 +54,8 @@ Gem::Specification.new do |spec|
54
54
  spec.add_dependency "dsl_evaluator", ">= 0.3.0" # for DslEvaluator.print_code
55
55
  spec.add_dependency "gems"
56
56
  spec.add_dependency "hashie"
57
- spec.add_dependency "jets-api"
57
+ spec.add_dependency "jets-api", ">= 0.1.4"
58
+ spec.add_dependency "jets-git"
58
59
  spec.add_dependency "jets-html-sanitizer"
59
60
  spec.add_dependency "kramdown"
60
61
  spec.add_dependency "memoist"
@@ -4,7 +4,7 @@ module Jets::AwsServices
4
4
  @@stack_exists_cache = [] # helps with CloudFormation rate limit
5
5
  def stack_exists?(stack_name)
6
6
  return false if Jets.env.test?
7
- return true if ENV['JETS_BUILD_NO_INTERNET']
7
+ return true if ENV['JETS_NO_INTERNET']
8
8
  return true if @@stack_exists_cache.include?(stack_name)
9
9
 
10
10
  exist = nil
@@ -76,7 +76,7 @@ module Jets::Builders
76
76
  end
77
77
 
78
78
  def exist_on_s3?(filename)
79
- return false if ENV['JETS_BUILD_NO_INTERNET']
79
+ return false if ENV['JETS_NO_INTERNET']
80
80
  s3_key = "jets/code/#{filename}"
81
81
  begin
82
82
  Jets.logger.debug "Checking s3://#{s3_bucket}/#{s3_key}"
@@ -131,6 +131,7 @@ module Jets::Builders
131
131
  # We do not want to grab this as part of the live request because it is slow.
132
132
  def store_s3_base_url
133
133
  return if Jets.config.mode == "job"
134
+ return unless gemfile_include?("sprockets-jets")
134
135
  write_s3_base_url("#{stage_area}/code/config/s3_base_url.txt")
135
136
  end
136
137
 
@@ -192,9 +193,7 @@ module Jets::Builders
192
193
  puts "Skip compiling assets".color(:yellow) # useful for debugging
193
194
  return true
194
195
  end
195
- return true if Jets.config.mode == "job"
196
- return true unless Jets.config.respond_to?(:assets)
197
- Jets.config.assets.enable_webpack
196
+ Jets.config.mode == "job"
198
197
  end
199
198
 
200
199
  # Different url for these. Examples:
@@ -13,33 +13,73 @@ module Jets::Cfn
13
13
 
14
14
  def create
15
15
  Jets.boot # needed since Jets is lazy loaded
16
- return if Jets.config.pro.disable
17
- return unless Jets::Api.token
18
- stack = find_stack(@stack_name)
19
- return unless stack
16
+ return if disabled?
17
+ @stack = find_stack(@stack_name)
18
+ record_deployment if @stack
19
+ end
20
20
 
21
- record_deployment(stack)
21
+ def delete
22
+ Jets.boot # needed since Jets is lazy loaded
23
+ return if disabled?
24
+ @stack = find_stack(@stack_name)
25
+ delete_deployment if @stack
22
26
  end
23
27
 
24
- def record_deployment(stack)
25
- deploy_user = ENV['JETS_DEPLOY_USER'] || ENV['USER']
26
- resp = Jets::Api::Release.create(
27
- stack_arn: stack.stack_id,
28
- stack_status: stack.stack_status,
29
- message: message,
30
- deploy_user: deploy_user,
31
- )
32
- check_for_error_message!(resp)
28
+ def delete_deployment
29
+ resp = Jets::Api::Stack.retrieve("current")
30
+ return if resp["error"] == "not_found"
31
+ return unless resp["id"]
32
+ resp = Jets::Api::Stack.delete(resp["id"])
33
+ puts resp["message"] # IE: Stack demo-dev deleted
34
+ resp
35
+ rescue Jets::Api::RequestError => e
36
+ puts "WARNING: Unable to delete release and stack. #{e.class}: #{e.message}"
37
+ end
38
+
39
+ def record_deployment
40
+ params = stack_params.merge(git_info.params)
41
+ params["message"] = create_message
42
+ resp = Jets::Api::Release.create(params)
43
+ # Instead of check_for_error_message!(resp) we want to customize it a bit
44
+ if resp && resp["error"]
45
+ $stderr.puts "WARN: There was an error creating the release."
46
+ $stderr.puts "WARN: #{resp["error"]}"
47
+ exit 1
48
+ end
33
49
  puts "Release version: #{resp["version"]}" if resp["version"]
34
50
  resp
35
51
  rescue Jets::Api::RequestError => e
36
52
  puts "WARNING: Unable to create release. #{e.class}: #{e.message}"
37
53
  end
38
54
 
39
- def message
40
- return @options[:message][0..255] if @options[:message]
41
- # else default message
42
- @rollback_version ? "Rollback to #{@rollback_version}" : "Deploy"
55
+ def stack_params
56
+ {
57
+ stack_arn: @stack.stack_id,
58
+ stack_status: @stack.stack_status,
59
+ message: create_message,
60
+ deploy_user: deploy_user,
61
+ }
62
+ end
63
+
64
+ def deploy_user
65
+ ENV['JETS_DEPLOY_USER'] || git_info.user.first_name || ENV['USER']
66
+ end
67
+
68
+ def git_info
69
+ Jets::Git::Info.new(@options)
70
+ end
71
+ memoize :git_info
72
+
73
+ def create_message
74
+ if @options[:message]
75
+ @options[:message][0..255]
76
+ else
77
+ @rollback_version ? "Rollback to #{@rollback_version}" : "Deploy"
78
+ end
79
+ end
80
+
81
+ def disabled?
82
+ Jets.config.pro.disable || !Jets::Api.token
43
83
  end
44
84
  end
45
85
  end
@@ -4,7 +4,7 @@ class Jets::Cfn::Resource::ApiGateway::RestApi
4
4
  include Jets::AwsServices
5
5
 
6
6
  def get
7
- return default if ENV['JETS_BUILD_NO_INTERNET']
7
+ return default if ENV['JETS_NO_INTERNET']
8
8
  return default unless stack_exists?(parent_stack_name) && api_gateway_exists?
9
9
 
10
10
  if changed?
@@ -17,7 +17,7 @@ class Jets::Cfn::Resource::ApiGateway::RestApi
17
17
 
18
18
  def auto_replace_prompt
19
19
  return if ENV['JETS_API_AUTO_REPLACE']
20
- return unless ARGV[0] == "deploy"
20
+ return unless Jets::Command.original_cli_command == "deploy"
21
21
  case Jets.config.api.auto_replace
22
22
  when nil
23
23
  puts message.routes_changed
@@ -47,13 +47,13 @@ module Jets::Cfn::Resource::S3
47
47
  @@name = nil
48
48
  def name
49
49
  return @@name if @@name
50
- return "fake-bucket" if ENV['JETS_BUILD_NO_INTERNET'] || ENV['JETS_TEMPLATES']
50
+ return "fake-bucket" if ENV['JETS_NO_INTERNET'] || ENV['JETS_TEMPLATES']
51
51
 
52
52
  resp = nil
53
53
  begin
54
54
  resp = cfn.describe_stacks(stack_name: Jets::Names.parent_stack_name)
55
55
  rescue Aws::CloudFormation::Errors::ValidationError => e
56
- if e.message.include?('does not exist') && ARGV[0] == 'build' # jets build
56
+ if e.message.include?('does not exist') && Jets::Command.original_cli_command == 'build' # jets build
57
57
  return "no-bucket-yet" # for jets build without s3 bucket yet
58
58
  else
59
59
  raise
@@ -18,6 +18,7 @@ module Jets
18
18
  $stderr.puts "ERROR: #{resp["error"]}"
19
19
  exit 1
20
20
  end
21
+ resp
21
22
  end
22
23
 
23
24
  def paging_params
@@ -99,6 +99,11 @@ module Jets
99
99
  end
100
100
 
101
101
  dispatch(command, args.dup, nil, config)
102
+ rescue Thor::InvocationError => e
103
+ puts e.message.color(:red) # message already has ERROR prefix
104
+ self.full_namespace = full_namespace # store for help. clean:log => log
105
+ dispatch("help", [], nil, config)
106
+ exit 1
102
107
  end
103
108
 
104
109
  def printing_commands
@@ -1,6 +1 @@
1
- Check if pre-built Lambda gems are available from the gems source. You can configure the gem in config/application.rb:
2
-
3
- # Sources for check for pre-compiled Lambda gems. Checks the list in order.
4
- Jets.application.configure do
5
- config.gems.source = "https://api.serverlessgems.com/api/v1"
6
- end
1
+ Check if precompiled gems are available from Jets Pro.
@@ -7,7 +7,7 @@ This defaults to the controller Lambda function in the `one_lambda_for_all_contr
7
7
 
8
8
  If you want to follow the logs use the `-f` flag.
9
9
 
10
- ❯ jets logs
10
+ ❯ jets logs -f
11
11
  Tailing logs for /aws/lambda/demo-dev-controller
12
12
 
13
13
  If you want to see the production logs:
@@ -5,33 +5,15 @@
5
5
  +---------+-----------------+--------------+---------+
6
6
  | Version | Status | Released At | Message |
7
7
  +---------+-----------------+--------------+---------+
8
- | 27 | UPDATE_COMPLETE | 10 hours ago | Deploy |
9
- | 26 | UPDATE_COMPLETE | 11 hours ago | Deploy |
10
- | 25 | UPDATE_COMPLETE | 11 hours ago | Deploy |
11
- | 24 | UPDATE_COMPLETE | 11 hours ago | Deploy |
12
- | 23 | DELETE_COMPLETE | 14 hours ago | Deleted |
13
- | 22 | UPDATE_COMPLETE | 14 hours ago | Deploy |
14
- | 21 | UPDATE_COMPLETE | 14 hours ago | Deploy |
15
- | 20 | UPDATE_COMPLETE | 14 hours ago | Deploy |
16
- | 19 | DELETE_COMPLETE | 14 hours ago | Deleted |
17
- | 18 | UPDATE_COMPLETE | 14 hours ago | Deploy |
18
- | 17 | UPDATE_COMPLETE | 17 hours ago | Deploy |
19
- | 16 | UPDATE_COMPLETE | 18 hours ago | Deploy |
20
- | 15 | UPDATE_COMPLETE | 18 hours ago | Deploy |
21
- | 14 | DELETE_COMPLETE | 18 hours ago | Deleted |
22
- | 13 | UPDATE_COMPLETE | 19 hours ago | Deploy |
23
- | 12 | UPDATE_COMPLETE | 19 hours ago | Deploy |
24
- | 11 | UPDATE_COMPLETE | 19 hours ago | Deploy |
25
- | 10 | DELETE_COMPLETE | 19 hours ago | Deleted |
26
- | 9 | UPDATE_COMPLETE | 21 hours ago | Deploy |
27
- | 8 | UPDATE_COMPLETE | 21 hours ago | Deploy |
28
- | 7 | DELETE_COMPLETE | 21 hours ago | Deleted |
29
- | 6 | UPDATE_COMPLETE | 21 hours ago | Deploy |
30
- | 5 | DELETE_COMPLETE | 22 hours ago | Deleted |
31
- | 4 | UPDATE_COMPLETE | 22 hours ago | Deploy |
32
- | 3 | UPDATE_COMPLETE | 22 hours ago | Deploy |
8
+ | 3 | UPDATE_COMPLETE | 10 hours ago | Deploy |
9
+ | 2 | UPDATE_COMPLETE | 18 hours ago | Deploy |
10
+ | 1 | UPDATE_COMPLETE | 22 hours ago | Deploy |
33
11
  +---------+-----------------+--------------+---------+
34
12
 
35
13
  The shown releases are paginated. If you need to see more releases you can use the `--page` option.
36
14
 
37
15
  $ jets releases --page 2
16
+
17
+ ## Other Commands
18
+
19
+ releases:info View detailed information for a release
@@ -0,0 +1,38 @@
1
+ module Jets::Command
2
+ module RakeDecorate
3
+ # Decorate this method because this does not get called until runtime.
4
+ # It's "lazy loaded" so we can avoid the Rails const being defined in general.
5
+ def [](task_name, scopes=nil)
6
+ super # => Rake::TaskManager#[]
7
+ rescue RuntimeError => e
8
+ # We require dummy/rails since this time because all the rake tasks have been loaded
9
+ # and we need to load dummy/rails to get the database configurations. Normally,
10
+ # we do not want to require dummy/rails because it defines the Rails.
11
+ # However, a "command not found" error, more accurately,
12
+ # a "rake task not found" error, has already been encountered.
13
+ # Also:
14
+ # require "dummy/rails" to prevent another error.
15
+ # from lib/active_record/railties/databases.rake
16
+ #
17
+ # NoMethodError: undefined method `env' for Rails:Module (NoMethodError)
18
+ # database_configs = ActiveRecord::DatabaseConfigurations.new(databases).configs_for(env_name: Rails.env)
19
+ #
20
+ require "jets/overrides/dummy/rails"
21
+
22
+ # Original error message from rake is something like this
23
+ #
24
+ # Don't know how to build task 'foo:bar' (See the list of available tasks with `jets --tasks`)
25
+ #
26
+ # With an ugly backtrace.
27
+ # We override the error message to be more user friendly.
28
+ #
29
+ # All of that in order for
30
+ # jets foo:bar
31
+ # to show a pretty error message.
32
+ $stderr.puts "ERROR: Could not find command: #{task_name.inspect}".color(:red)
33
+ require "jets/commands/help/help_command"
34
+ Jets::Command::HelpCommand.new.help
35
+ exit 1
36
+ end
37
+ end
38
+ end
data/lib/jets/command.rb CHANGED
@@ -17,6 +17,8 @@ module Jets
17
17
 
18
18
  HELP_MAPPINGS = %w(-h -? --help)
19
19
 
20
+ cattr_accessor :original_cli_command
21
+
20
22
  class << self
21
23
  def hidden_commands # :nodoc:
22
24
  @hidden_commands ||= []
@@ -29,6 +31,7 @@ module Jets
29
31
  # Receives a namespace, arguments, and the behavior to invoke the command.
30
32
  def invoke(full_namespace, args = [], **config)
31
33
  namespace = full_namespace = full_namespace.to_s
34
+ Jets::Command.original_cli_command = full_namespace
32
35
 
33
36
  if char = namespace =~ /:(\w+)$/
34
37
  command_name, namespace = $1, namespace.slice(0, char)
@@ -47,6 +50,12 @@ module Jets
47
50
  if command && command.all_commands[command_name]
48
51
  command.perform(full_namespace, command_name, args, config)
49
52
  else
53
+ # Decorate the rake [] method in order to rescue the error and print out
54
+ # a user friendly message. This works to catch rake errors but
55
+ # unsure why cannot just rescue RuntimeError here.
56
+ # More details in the RakeDecorate module.
57
+ require "rake/application"
58
+ Rake::Application.send(:include, RakeDecorate)
50
59
  args = ["--describe", full_namespace] if HELP_MAPPINGS.include?(args[0])
51
60
  find_by_namespace("rake").perform(full_namespace, args, config)
52
61
  end
@@ -89,7 +98,6 @@ module Jets
89
98
  commands.each { |command| puts(" #{command}") }
90
99
  end
91
100
 
92
- private
93
101
  COMMANDS_IN_USAGE = %w(
94
102
  generate
95
103
  console
@@ -117,6 +125,7 @@ module Jets
117
125
  (visible_commands - COMMANDS_IN_USAGE - PRO_COMMANDS).sort
118
126
  end
119
127
 
128
+ private
120
129
  def command_type # :doc:
121
130
  @command_type ||= "command"
122
131
  end
@@ -33,14 +33,13 @@ module Jets::Command
33
33
  cfn.delete_stack(stack_name: parent_stack_name)
34
34
  puts "Deleting #{Jets.project_namespace.color(:green)}..."
35
35
 
36
+ stack = find_stack(parent_stack_name)
36
37
  if @options[:wait]
37
- stack = find_stack(parent_stack_name)
38
38
  wait_for_stack
39
- Jets::Cfn::Deployment.new(stack_name: stack.stack_id, message: "Deleted").create
40
39
  end
40
+ Jets::Cfn::Deployment.new(stack_name: stack.stack_id).delete
41
41
 
42
42
  delete_logs
43
-
44
43
  puts "Project #{Jets.project_namespace.color(:green)} deleted!"
45
44
  end
46
45
 
@@ -1,11 +1,27 @@
1
1
  module Jets::Command
2
2
  class ReleasesCommand < Base # :nodoc:
3
- desc "history", "List releases"
4
- long_desc Help.text(:history)
3
+ desc "releases", "List releases"
4
+ long_desc Help.text(:releases)
5
5
  paging_options(order: 'desc').call
6
+ option :sha, desc: "Show release git sha"
6
7
  def perform
7
8
  Release.new(options.merge(paging_params)).list
8
9
  end
10
+
11
+ desc "releases:info", "View detailed information for a release"
12
+ long_desc Help.text(:info)
13
+ def info(version=nil)
14
+ if version.nil?
15
+ puts "ERROR: Must provide a version".color(:red)
16
+ puts <<~EOL
17
+ Example:
18
+
19
+ jets releases:info 3
20
+ EOL
21
+ exit 1
22
+ end
23
+ Release.new(options.merge(version: version)).show
24
+ end
9
25
  end
10
26
 
11
27
  class Release
@@ -35,19 +51,26 @@ module Jets::Command
35
51
  show_items(data)
36
52
  end
37
53
  rescue Jets::Api::RequestError => e
38
- puts "ERROR: Unable to list history. #{e.class}: #{e.message}"
54
+ puts "ERROR: Unable to list releases. #{e.class}: #{e.message}"
39
55
  end
40
56
 
41
57
  def show_items(items)
42
58
  presenter = CliFormat::Presenter.new
43
- presenter.header = ["Version", "Status", "Released At", "Message"]
59
+ header = ["Version", "Status", "Released At", "Message"]
60
+ header << "Git Sha" if @options[:sha]
61
+ presenter.header = header
44
62
  items.each do |item|
45
63
  version = item["version"]
46
64
  status = item["stack_status"]
47
65
  released_at = item["pretty_created_at"] || item["created_at"]
48
66
  message = item["message"] || "Deployed"
67
+ message = message[0..50]
49
68
 
50
69
  row = [version, status, format_time(released_at), message]
70
+ if @options[:sha]
71
+ sha = item["git_sha"].to_s[0..7] if item["git_sha"]
72
+ row << sha
73
+ end
51
74
  presenter.rows << row
52
75
  end
53
76
  presenter.show
@@ -66,7 +89,37 @@ module Jets::Command
66
89
  resp = Jets::Api::Release.retrieve(version)
67
90
  check_for_error_message!(resp)
68
91
  rescue Jets::Api::RequestError => e
69
- puts "ERROR: Unable to get history. #{e.class}: #{e.message}"
92
+ puts "ERROR: Unable to get release. #{e.class}: #{e.message}"
93
+ end
94
+
95
+ def show
96
+ release = get(@options[:version])
97
+ release_at = release['pretty_created_at'] || release['created_at']
98
+
99
+ data = [
100
+ ["Version", release['version']],
101
+ ["Status", release['stack_status']],
102
+ ["Released At", format_time(release_at)],
103
+ ["Message", release['message']],
104
+ ["User", release['deploy_user']],
105
+ ["Git Branch", release['git_branch']],
106
+ ["Git Sha", release['git_sha']],
107
+ ["Git Message", release['git_message']],
108
+ ["Git Url", release['git_url']],
109
+ ["Git Dirty", release['git_dirty']],
110
+ ["Jets Env", release['jets_env']],
111
+ ["Jets Extra", release['jets_extra']],
112
+ ["Jets Version", release['jets_version']],
113
+ ["Ruby Version", release['ruby_version']],
114
+ ["Region", release['region']],
115
+ ]
116
+ column1_width = data.map { |row| row[1].nil? ? 0 : row[0].to_s.length }.max
117
+ column2_width = data.map { |row| row[1].nil? ? 0 : row[1].to_s.length }.max
118
+
119
+ puts Jets.project_namespace
120
+ data.each do |row|
121
+ puts "#{row[0].ljust(column1_width)} #{row[1]}" unless row[1].nil?
122
+ end
70
123
  end
71
124
  end
72
125
  end
@@ -4,7 +4,7 @@ module Jets::Command
4
4
  class RollbackCommand < Base # :nodoc:
5
5
  desc "rollback", "Rollback to a previous release"
6
6
  long_desc Help.text(:rollback)
7
- def perform(version=nil)
7
+ def perform(version)
8
8
  Rollback.new(options.merge(version: version)).run
9
9
  end
10
10
  end
@@ -15,14 +15,6 @@ module Jets::Command
15
15
  def initialize(options={})
16
16
  @options = options
17
17
  @version = options[:version]
18
- # Handle more gracefully than the way Jets does it currently
19
- if @version.nil?
20
- puts <<~EOL
21
- ERROR: version required
22
- Usage: jets rollback VERSION
23
- EOL
24
- exit 1
25
- end
26
18
  end
27
19
 
28
20
  def run
@@ -37,7 +37,7 @@ class Jets::Dotenv
37
37
  end
38
38
 
39
39
  def fetch_ssm_value(key, value)
40
- return "fake-ssm-value" if ENV['JETS_BUILD_NO_INTERNET']
40
+ return "fake-ssm-value" if ENV['JETS_NO_INTERNET']
41
41
 
42
42
  name = ssm_name(key, value)
43
43
  response = ssm.get_parameter(name: name, with_decryption: true)
@@ -0,0 +1,6 @@
1
+ # Additional files not to add to the zip file that jets creates for code deploy.
2
+ # .gitignore files are also not added.
3
+ # This adds additional files.
4
+ #
5
+ # Ignoring /public/files since should be served by s3 when using asset_path helper
6
+ /public/files
@@ -3,7 +3,7 @@ Jets.application.configure do
3
3
 
4
4
  config.cache_classes = false
5
5
  config.eager_load = false
6
- config.logging.event = false # dont show large event in local development logging
6
+ config.logging.event = false # can be useful for CloudWatch
7
7
 
8
8
  <%- unless options[:mode] == 'job' -%>
9
9
  # Show full error reports.
@@ -2,7 +2,7 @@ Jets.application.configure do
2
2
  config.cache_classes = true
3
3
  config.eager_load = true
4
4
  config.log_level = :info
5
- config.logging.event = true # useful for CloudWatch logs
5
+ config.logging.event = false # can be useful for CloudWatch
6
6
 
7
7
  <%- unless options[:mode] == 'job' -%>
8
8
  config.consider_all_requests_local = false
data/lib/jets/job/base.rb CHANGED
@@ -38,7 +38,7 @@ module Jets::Job
38
38
  call = Jets::Commands::Call::Caller.new(function_name, JSON.dump(event), invocation_type: "Event")
39
39
  call.run
40
40
  else
41
- puts "INFO: Not on AWS Lambda. In local mode perform_later executes the job with perform_now instead."
41
+ Jets.logger.info "INFO: Not on AWS Lambda. In local mode perform_later executes the job with perform_now instead."
42
42
  perform_now(meth, event, context)
43
43
  end
44
44
  end
@@ -1,7 +1,7 @@
1
1
  module Jets::Job::Dsl
2
2
  module DynamodbEvent
3
3
  def dynamodb_event(table_name_without_namespace, options={})
4
- return if ENV['JETS_BUILD_NO_INTERNET'] # Disable during build since jets build tries to init this
4
+ return if ENV['JETS_NO_INTERNET'] # Disable during build since jets build tries to init this
5
5
 
6
6
  table_name = add_dynamodb_table_namespace(table_name_without_namespace)
7
7
  stream_arn = full_dynamodb_stream_arn(table_name)
data/lib/jets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "5.0.0"
2
+ VERSION = "5.0.1"
3
3
  end
data/lib/jets.rb CHANGED
@@ -14,6 +14,7 @@ require "json"
14
14
  require "memoist"
15
15
  require "rainbow/ext/string"
16
16
  require "jets-api"
17
+ require "jets-git"
17
18
 
18
19
  require "jets/core_ext"
19
20
  require "jets/autoloaders"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-05 00:00:00.000000000 Z
11
+ date: 2023-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -376,6 +376,20 @@ dependencies:
376
376
  version: '0'
377
377
  - !ruby/object:Gem::Dependency
378
378
  name: jets-api
379
+ requirement: !ruby/object:Gem::Requirement
380
+ requirements:
381
+ - - ">="
382
+ - !ruby/object:Gem::Version
383
+ version: 0.1.4
384
+ type: :runtime
385
+ prerelease: false
386
+ version_requirements: !ruby/object:Gem::Requirement
387
+ requirements:
388
+ - - ">="
389
+ - !ruby/object:Gem::Version
390
+ version: 0.1.4
391
+ - !ruby/object:Gem::Dependency
392
+ name: jets-git
379
393
  requirement: !ruby/object:Gem::Requirement
380
394
  requirements:
381
395
  - - ">="
@@ -859,6 +873,7 @@ files:
859
873
  - lib/jets/command/help/upgrade.md
860
874
  - lib/jets/command/help/url.md
861
875
  - lib/jets/command/helpers/editor.rb
876
+ - lib/jets/command/rake_decorate.rb
862
877
  - lib/jets/commands.rb
863
878
  - lib/jets/commands/application/application_command.rb
864
879
  - lib/jets/commands/build/build_command.rb
@@ -964,6 +979,7 @@ files:
964
979
  - lib/jets/generators/overrides/app/helpers.rb
965
980
  - lib/jets/generators/overrides/app/templates/.env
966
981
  - lib/jets/generators/overrides/app/templates/.gitignore.tt
982
+ - lib/jets/generators/overrides/app/templates/.jetsignore
967
983
  - lib/jets/generators/overrides/app/templates/.rspec
968
984
  - lib/jets/generators/overrides/app/templates/Gemfile.tt
969
985
  - lib/jets/generators/overrides/app/templates/README.md