jack-eb 1.1.2 → 1.2.0

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
  SHA1:
3
- metadata.gz: 6ece219aa57cc04f347291e94974577e996ca6a0
4
- data.tar.gz: d17816bfe9436d2b0f60f34657350b24e36e6ca0
3
+ metadata.gz: 0b32fb136e9666d9c320b57a6e82dbd6265a88ca
4
+ data.tar.gz: c44513aa9ec470ae7345e6642a49f558c45554dc
5
5
  SHA512:
6
- metadata.gz: de1afe023f535683a3fd2a5263e220c8c2634663748f7ee536f82d3b3be86c7c042c10facfe280623e50961c098ea9792fa39fab904672526550bf60ba224948
7
- data.tar.gz: 7f549a7d2e9d0b8b639edce5bf228aabe710ea7a46ce4d258ffb543147b4650f2ac1d8d3e836a8cec9f1c3f1e647f25b3fb1314ad9497ea87a067e908a51b372
6
+ metadata.gz: 944f181ed9841d73ea420881a1ee995a9a0ac00a3db561591919abae4fedc163dbce4e48938071a8ab4ba2015258d141255dba12c11244a3ea6820b51d5658d7
7
+ data.tar.gz: adbf44aee62358dc8e9251fdc5d6da43744254c0a3c9ac6aacd8fc62820edf58b3a5d1eda27265434a57d72b45a7a5da9ab5d5b30093e65cb7da967f1ca51424
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [1.2.0]
7
+ - add jack deploy command
8
+ - rename commands to config get and config apply
9
+
6
10
  ## [1.1.2]
7
11
  - remove debugging from version checker
8
12
 
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  Jack is a wrapper tool around the [aws eb cli3](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3.html) tool use for managing AWS Elastic Beanstalk, EB, environments. It allows you to create environments using the saved template configuration file generated by `eb config save`. Jack moves the config file to the jack/cfg folder of your project and manages the the config files from there.
9
9
 
10
- Jack provides a `jack config upload` command to update the EB environment. Before uploading the new configuration to EB jack first downloads the current configuration and then does a diff on the changes that are about to be applied. This gives a very helpful preview of exactly what you are intending to change. This particularly helpful when changes are made through the EB GUI and are out of sync with what is stored in the `jack/cfg` files. The demo video is available [here](https://www.youtube.com/watch?v=t7EcAOf8h1o).
10
+ Jack provides a `jack config apply` command to update the EB environment. Before uploading the new configuration to EB jack first downloads the current configuration and then does a diff on the changes that are about to be applied. This gives a very helpful preview of exactly what you are intending to change. This particularly helpful when changes are made through the EB GUI and are out of sync with what is stored in the `jack/cfg` files. The demo video is available [here](https://www.youtube.com/watch?v=t7EcAOf8h1o).
11
11
 
12
12
  This blog post also provides a good introduction and shows some useful examples of what you can do with the jack tool: [Jack and the Elastic Beanstalk — Tool to Manage AWS Elastic Beanstalk Environments](https://medium.com/@tongueroo/jack-and-the-elastic-beanstalk-easily-manage-aws-environments-3ab496f08ad2#.o7w3x0yd9).
13
13
 
@@ -16,7 +16,7 @@ For things that this tool does not cover like deploying code, it is recommended
16
16
  ## Use Cases
17
17
 
18
18
  * Downloading EB config to codified the EB infrastructure that has been built.
19
- * Allowing safe uploading of new configs since the preview feature allows you to inspect the changes before actually uploading the configuration.
19
+ * Allowing safe applying of new configs since the preview feature allows you to inspect the changes before actually applying the configuration.
20
20
  * Moving EB enviroments from one EB application to another EB application. EB provides a way to clone environments within an application but not to another entire application. This is useful if you want to "rename" the EB application.
21
21
 
22
22
  ## Installation
@@ -109,7 +109,7 @@ $ jack create hi-web-stag-1
109
109
  The big benefit of using jack though is the ability to create EB environments based on previously saved configuration files. So now you can download the configuration file from the newly created hi-web-stag-1 environment and version control them.
110
110
 
111
111
  ```bash
112
- $ jack config download hi-web-stag-1
112
+ $ jack config get hi-web-stag-1
113
113
  ```
114
114
 
115
115
  This above saves the configuration file at `jack/cfg/hi-web-stag-1.cfg.yml`. Here is an [example](https://gist.github.com/tongueroo/5791a4575a71cb664d48e4e8b29791b3) of what the config file.
@@ -117,7 +117,7 @@ This above saves the configuration file at `jack/cfg/hi-web-stag-1.cfg.yml`. He
117
117
  If you would like to save the config file under a different path, you can use the `-c` option.
118
118
 
119
119
  ```bash
120
- $ jack config download hi-web-stag-1 -c my-config
120
+ $ jack config get hi-web-stag-1 -c my-config
121
121
  ```
122
122
 
123
123
  This saves the config file to `jack/cfg/my-config.cfg.yml` looks like.
@@ -137,31 +137,31 @@ Here's an [example](https://gist.github.com/tongueroo/086e3c11c4d00d5c39b6). The
137
137
 
138
138
  Configuration templates hold all the options and settings that we can set for an EB environment. Elastic Beanstalk surfaces a portion of settings available from the underlying AWS Resources. These settings include ELB behavior, VPC, LaunchConfiguration, Autoscaling settings, hard drive size, environment variables, etc. Here is an [example](https://gist.github.com/tongueroo/5791a4575a71cb664d48e4e8b29791b3).
139
139
 
140
- #### Download Config
140
+ #### Get Elastic Beanstalk Configuration
141
141
 
142
- To download a template configuration.
142
+ To download the Elastic Beanstalk configuration:
143
143
 
144
144
  ```
145
- $ jack config download hi-web-prod-1
145
+ $ jack config get hi-web-prod-1
146
146
 
147
- $ jack config download hi-web-prod-1 --app customappname
147
+ $ jack config get hi-web-prod-1 --app customappname
148
148
  ```
149
149
 
150
- This will save the config to jack/cfg/hi-web-prod-1.cfg.yml.
150
+ This will save the config to `jack/cfg/hi-web-prod-1.cfg.yml`.
151
151
 
152
- #### Upload Config
152
+ #### Apply Elastic Beanstalk Configuration
153
153
 
154
- To upload a template configuration.
154
+ To apply a template configuration.
155
155
 
156
156
  ```
157
- $ jack config upload hi-web-prod-1
157
+ $ jack config apply hi-web-prod-1
158
158
 
159
- $ jack config upload hi-web-prod-1 --app customappname
159
+ $ jack config apply hi-web-prod-1 --app customappname
160
160
  ```
161
161
 
162
162
  This will save the config to `jack/cfg/hi-web-prod-1.cfg.yml`.
163
163
 
164
- You will notice that the `eb config upload` command prompts you with the diff and asks for confirmation before uploading. You can bypass the prompt with the `--sure` option.
164
+ You will notice that the `eb config apply` command prompts you with the diff and asks for confirmation before applying. You can bypass the prompt with the `--sure` option.
165
165
 
166
166
  #### Diff Config - Comparing your local config to the live environment config
167
167
 
@@ -171,7 +171,7 @@ You can use the diff command directly to compare your local config to what confi
171
171
  $ jack config diff hi-web-prod-1
172
172
  ```
173
173
 
174
- A note about the configs. They are formatted so that the keys are sorted. This has been done so the diffs are actually useful. It is also recommended you install colordiff so you can see the diff output colorized. You can also specify your own diff viewer via the JACK_DIFF environment variable.
174
+ A note about the configs. They are formatted so that the keys are sorted. This has been done so the diffs are actually useful. It is also recommended you install colordiff so you can see the diff output colorized. You can also specify your own diff viewer via the `JACK_DIFF` environment variable.
175
175
 
176
176
  To use a your own diff viewer, add this to your `~/.profile`:
177
177
 
@@ -185,8 +185,8 @@ You can get help information from the CLI. Examples:
185
185
 
186
186
  <pre>
187
187
  $ jack help
188
- $ jack help create
189
- $ jack config help download
190
- $ jack config help upload
191
- $ jack config help sort
188
+ $ jack create help
189
+ $ jack config get help
190
+ $ jack config apply help
191
+ $ jack config sort help
192
192
  </pre>
@@ -9,6 +9,7 @@ module Jack
9
9
  autoload :Help, 'jack/help'
10
10
  autoload :CLI, 'jack/cli'
11
11
  autoload :Create, 'jack/create'
12
+ autoload :Deploy, 'jack/deploy'
12
13
  autoload :Terminate, 'jack/terminate'
13
14
  autoload :Settings, 'jack/settings'
14
15
  autoload :EbConfig, 'jack/eb_config'
@@ -5,23 +5,23 @@ Jack::VersionChecker.new.run unless ENV['TEST']
5
5
 
6
6
  module Jack
7
7
  class Config < Command
8
- desc "upload ENV_NAME", "upload and apply jack config changes to EB environment"
9
- long_desc Help.upload
8
+ desc "apply ENV_NAME", "apply jack config changes to EB environment"
9
+ long_desc Help.apply
10
10
  option :sure, aliases: :f, type: :boolean, desc: "skip prompt"
11
- def upload(env_name)
12
- Upload.new(options.merge(env_name: env_name)).run
11
+ def apply(env_name)
12
+ Apply.new(options.merge(env_name: env_name)).run
13
13
  end
14
14
 
15
- desc "download ENV_NAME", "downloads environment config to jack/cfg folder"
16
- long_desc Help.download
17
- option :dirty, type: :boolean, desc: "leave the remote eb config and download config behind"
18
- def download(env_name)
19
- Download.new(options.merge(env_name: env_name)).run
15
+ desc "get ENV_NAME", "downloads environment config to jack/cfg folder"
16
+ long_desc Help.get
17
+ option :dirty, type: :boolean, desc: "leave the remote eb config and downloaded config behind"
18
+ def get(env_name)
19
+ Get.new(options.merge(env_name: env_name)).run
20
20
  end
21
21
 
22
22
  desc "diff ENV_NAME", "diff jack config vs environment config"
23
23
  long_desc Help.diff
24
- option :dirty, type: :boolean, desc: "leave the remote eb config and download config behind"
24
+ option :dirty, type: :boolean, desc: "leave the remote eb config and downloaded config behind"
25
25
  def diff(env_name)
26
26
  Diff.new(options.merge(env_name: env_name)).run
27
27
  end
@@ -48,6 +48,13 @@ module Jack
48
48
  Create.new(options.merge(env_name: env_name)).run
49
49
  end
50
50
 
51
+ desc "deploy ENV_NAME", "deploy to EB environment"
52
+ long_desc Help.deploy
53
+ option :eb_options, type: :string, desc: "Passthrough options to underlying called eb command"
54
+ def deploy(env_name)
55
+ Deploy.new(options.merge(env_name: env_name)).run
56
+ end
57
+
51
58
  desc "terminate ENV_NAME", "deletes EB environment"
52
59
  long_desc Help.terminate
53
60
  def terminate(env_name)
@@ -6,10 +6,10 @@ module Jack
6
6
  autoload :Help, 'jack/config/help'
7
7
  autoload :Base, 'jack/config/base'
8
8
  autoload :Diff, 'jack/config/diff'
9
- autoload :Download, 'jack/config/download'
9
+ autoload :Get, 'jack/config/get'
10
10
  autoload :Sort, 'jack/config/sort'
11
11
  autoload :Transmit, 'jack/config/transmit'
12
- autoload :Upload, 'jack/config/upload'
12
+ autoload :Apply, 'jack/config/apply'
13
13
  autoload :YamlFormatter, 'jack/config/yaml_formatter'
14
14
  end
15
15
  end
@@ -2,7 +2,7 @@ require 'fileutils'
2
2
 
3
3
  module Jack
4
4
  class Config < Command
5
- class Upload < Transmit
5
+ class Apply < Transmit
6
6
  include Util
7
7
 
8
8
  attr_reader :upload_path, :upload_name
@@ -37,8 +37,8 @@ module Jack
37
37
  If the difference is not what you expected, you should say no.
38
38
  If you want to download the config from the environment and get #{@local_config_path}
39
39
  back in sync, you can use this command:
40
- $ jack config download #{@env_name}
41
- $ jack config download -h # for more info
40
+ $ jack config get #{@env_name}
41
+ $ jack config get -h # for more info
42
42
  EOL
43
43
  message
44
44
  end
@@ -6,7 +6,7 @@ module Jack
6
6
  @options = options
7
7
  @root = options[:root] || '.'
8
8
  @env_name = options[:env_name]
9
- @download = Jack::Config::Download.new(options)
9
+ @download = Jack::Config::Get.new(options)
10
10
  end
11
11
 
12
12
  def run
@@ -3,7 +3,7 @@ require 'yaml'
3
3
 
4
4
  module Jack
5
5
  class Config < Command
6
- class Download < Transmit
6
+ class Get < Transmit
7
7
  include Util
8
8
 
9
9
  attr_reader :current_path, :current_name
@@ -1,20 +1,20 @@
1
1
  class Jack::Config::Help
2
2
  class << self
3
- def upload
3
+ def apply
4
4
  <<-EOL
5
- Uploads the specified template configuration in jack/cfg and applies it to the environment immediately.
5
+ Apply the specified template configuration in jack/cfg to the Elastic Beanstalk environment.
6
6
 
7
7
  #{convention}
8
8
 
9
9
  Example:
10
10
 
11
- $ jack config upload hi-web-stag-1
11
+ $ jack config apply hi-web-stag-1
12
12
 
13
- $ jack config upload myapp -c myconfig hi-web-stag-1
13
+ $ jack config apply myapp -c myconfig hi-web-stag-1
14
14
  EOL
15
15
  end
16
16
 
17
- def download
17
+ def get
18
18
  <<-EOL
19
19
  Downloads the environment's config to jack/cfg/[CONFIG_NAME].cfg.yml
20
20
 
@@ -22,9 +22,9 @@ Downloads the environment's config to jack/cfg/[CONFIG_NAME].cfg.yml
22
22
 
23
23
  Example:
24
24
 
25
- $ jack config download hi-web-stag-1
25
+ $ jack config get hi-web-stag-1
26
26
 
27
- $ jack config download myapp -c myconfig hi-web-stag-1
27
+ $ jack config get myapp -c myconfig hi-web-stag-1
28
28
  EOL
29
29
  end
30
30
 
@@ -42,7 +42,7 @@ module Jack
42
42
  end
43
43
 
44
44
  def upload_cfg
45
- @upload = Config::Upload.new(@options)
45
+ @upload = Config::Apply.new(@options)
46
46
  if @upload.local_cfg_exist?
47
47
  @upload.upload
48
48
  cfg = "--cfg #{@upload.upload_name} "
@@ -0,0 +1,59 @@
1
+ module Jack
2
+ class Deploy
3
+ include Util
4
+
5
+ def initialize(options={})
6
+ @options = options
7
+ @root = options[:root] || '.'
8
+ @env_name = options[:env_name]
9
+ @app_name = options[:app] || app_name_convention(@env_name)
10
+ end
11
+
12
+ def run
13
+ unless @options[:noop] || environment_exists?
14
+ UI.say("ERROR: Environment #{@env_name} does not appear to exist. Are you sure it exists?")
15
+ exit 1 unless ENV['TEST']
16
+ end
17
+
18
+ deploy
19
+ end
20
+
21
+ def environment_exists?
22
+ return true if @options[:noop]
23
+ r = eb.describe_environments(application_name: @app_name)
24
+ r.environments.collect(&:environment_name).include?(@env_name)
25
+ end
26
+
27
+ def deploy
28
+ # eb_options are passed through to the underlying eb deploy command
29
+ #
30
+ # optional arguments:
31
+ # -h, --help show this help message and exit
32
+ # --debug toggle debug output
33
+ # --quiet suppress all output
34
+ # -v, --verbose toggle verbose output
35
+ # --profile PROFILE use a specific profile from your credential file
36
+ # -r REGION, --region REGION
37
+ # use a specific region
38
+ # --no-verify-ssl do not verify AWS SSL certificates
39
+ # --modules [MODULES [MODULES ...]]
40
+ # modules to deploy
41
+ # -g ENV_GROUP_SUFFIX, --env-group-suffix ENV_GROUP_SUFFIX
42
+ # group suffix
43
+ # --version VERSION existing version label to deploy
44
+ # -l LABEL, --label LABEL
45
+ # label name which version will be given
46
+ # -m MESSAGE, --message MESSAGE
47
+ # description for version
48
+ # -nh, --nohang return immediately, do not wait for deploy to be
49
+ # completed
50
+ # --staged deploy files staged in git rather than the HEAD commit
51
+ # --timeout TIMEOUT timeout period in minutes
52
+ # --source SOURCE source of code to deploy directly; example
53
+ # source_location/repo/branch
54
+ # -p, --process enable preprocessing of the application version
55
+ command = "#{eb_bin} deploy#{eb_base_flags} #{@env_name} #{@options[:eb_options]}"
56
+ sh(command)
57
+ end
58
+ end
59
+ end
@@ -17,6 +17,16 @@ $ jack create -a myapp -c myconfig hi-web-stag-1
17
17
  EOL
18
18
  end
19
19
 
20
+ def deploy
21
+ <<-EOL
22
+ Deploy code to the Elastic Beanstalk environment.
23
+
24
+ Example:
25
+
26
+ $ jack deploy hi-web-stag-1
27
+ EOL
28
+ end
29
+
20
30
  def terminate
21
31
  <<-EOL
22
32
  Deletes Elastic Beanstalk environment.
@@ -31,11 +41,11 @@ EOL
31
41
  # Leaving here in case we figure out a way to override this Thor behavior.
32
42
  def config
33
43
  <<-EOL
34
- Manage the environment's config. Can use this to download the environment's config to jack/cfg folder or upload config in jack/cfg folder and apply it to the environment.
44
+ Manage the environment's config. Can use this to download the environment's config to jack/cfg folder or upload and apply config in jack/cfg folder to the environment.
35
45
 
36
46
  Example:
37
47
 
38
- $ jack config download hi-web-stag-1
48
+ $ jack config get hi-web-stag-1
39
49
 
40
50
  For more info:
41
51
 
@@ -15,7 +15,7 @@ module Jack::Util
15
15
 
16
16
  def sh(command, options={})
17
17
  Jack::UI.say "=> #{command.colorize(:green)}"
18
- return command if options[:noop]
18
+ return command if @options[:noop]
19
19
 
20
20
  if options[:backtick]
21
21
  out = `#{command}`
@@ -1,3 +1,3 @@
1
1
  module Jack
2
- VERSION = "1.1.2"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -17,13 +17,13 @@ describe Jack::CLI do
17
17
  end
18
18
 
19
19
  it "should upload and apply config to environment" do
20
- out = execute("bin/jack config upload #{@args}")
20
+ out = execute("bin/jack config apply #{@args}")
21
21
  # puts out
22
22
  expect(out).to include('eb config save')
23
23
  end
24
24
 
25
25
  it "should download config from environment" do
26
- out = execute("bin/jack config download #{@args}")
26
+ out = execute("bin/jack config get #{@args}")
27
27
  # puts out
28
28
  expect(out).to include("Config downloaded")
29
29
  end
@@ -40,7 +40,13 @@ describe Jack::CLI do
40
40
  expect(out).to include("Reformatted the local config")
41
41
  end
42
42
 
43
- it "should terminate enviornment" do
43
+ it "should deploy environment" do
44
+ out = execute("bin/jack deploy #{@args}")
45
+ # puts out
46
+ expect(out).to include("eb deploy")
47
+ end
48
+
49
+ it "should terminate environment" do
44
50
  out = execute("bin/jack terminate #{@args}")
45
51
  # puts out
46
52
  expect(out).to include("Whew that was close")
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+
3
+ describe Jack::Config::Apply do
4
+ before(:all) do
5
+ Jack::UI.mute = true
6
+ end
7
+
8
+ let(:apply) { Jack::Config::Apply.new(test_options.merge(mute: true)) }
9
+
10
+ describe "jack config" do
11
+ it "apply code paths" do
12
+ exist = apply.local_cfg_exist?
13
+ expect(exist).to be true # checking fixture
14
+ # mock methods way down deep to test code paths, test reads weird though
15
+ expect(apply).to receive(:eb_config_put)
16
+ apply.upload
17
+ end
18
+
19
+ it "upload flow" do
20
+ allow(apply).to receive(:compare).and_return(true)
21
+
22
+ expect(apply).to receive(:compare)
23
+ expect(apply).to receive(:upload)
24
+ expect(apply).to receive(:update_env)
25
+ apply.run
26
+ end
27
+ end
28
+ end
@@ -5,14 +5,14 @@ describe Jack::Config do
5
5
  Jack::UI.mute = true
6
6
  end
7
7
 
8
- let(:download) { Jack::Config::Download.new(test_options) }
8
+ let(:get) { Jack::Config::Get.new(test_options) }
9
9
 
10
- describe "download" do
11
- it "download" do
10
+ describe "jack config" do
11
+ it "get" do
12
12
  # mock methods way down deep to test code paths, test reads weird though
13
- expect(download).to receive(:eb_config_save)
14
- expect(download).to receive(:do_copy_to_local_cfg)
15
- download.download
13
+ expect(get).to receive(:eb_config_save)
14
+ expect(get).to receive(:do_copy_to_local_cfg)
15
+ get.download
16
16
  end
17
17
 
18
18
  # it "should add jack/cfg/*.yml to gitignore" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jack-eb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
@@ -131,15 +131,16 @@ files:
131
131
  - lib/jack/cli.rb
132
132
  - lib/jack/command.rb
133
133
  - lib/jack/config.rb
134
+ - lib/jack/config/apply.rb
134
135
  - lib/jack/config/diff.rb
135
- - lib/jack/config/download.rb
136
+ - lib/jack/config/get.rb
136
137
  - lib/jack/config/help.rb
137
138
  - lib/jack/config/sort.rb
138
139
  - lib/jack/config/transmit.rb
139
- - lib/jack/config/upload.rb
140
140
  - lib/jack/config/yaml_formatter.rb
141
141
  - lib/jack/create.rb
142
142
  - lib/jack/default/settings.yml
143
+ - lib/jack/deploy.rb
143
144
  - lib/jack/eb_config.rb
144
145
  - lib/jack/eb_config/base.rb
145
146
  - lib/jack/eb_config/create.rb
@@ -154,11 +155,11 @@ files:
154
155
  - lib/jack/version_checker.rb
155
156
  - spec/fixtures/project/jack/cfg/hi-web-stag-1.cfg.yml
156
157
  - spec/lib/cli_spec.rb
158
+ - spec/lib/config/apply_spec.rb
157
159
  - spec/lib/config/diff_spec.rb
158
- - spec/lib/config/download_spec.rb
160
+ - spec/lib/config/get_spec.rb
159
161
  - spec/lib/config/sort_spec.rb
160
162
  - spec/lib/config/transmit_spec.rb
161
- - spec/lib/config/upload_spec.rb
162
163
  - spec/lib/config/yaml_formatter_spec.rb
163
164
  - spec/lib/config_spec.rb
164
165
  - spec/lib/create_spec.rb
@@ -196,11 +197,11 @@ summary: Wrapper tool to manage AWS Elastic Beanstalk environments
196
197
  test_files:
197
198
  - spec/fixtures/project/jack/cfg/hi-web-stag-1.cfg.yml
198
199
  - spec/lib/cli_spec.rb
200
+ - spec/lib/config/apply_spec.rb
199
201
  - spec/lib/config/diff_spec.rb
200
- - spec/lib/config/download_spec.rb
202
+ - spec/lib/config/get_spec.rb
201
203
  - spec/lib/config/sort_spec.rb
202
204
  - spec/lib/config/transmit_spec.rb
203
- - spec/lib/config/upload_spec.rb
204
205
  - spec/lib/config/yaml_formatter_spec.rb
205
206
  - spec/lib/config_spec.rb
206
207
  - spec/lib/create_spec.rb
@@ -1,28 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Jack::Config::Upload do
4
- before(:all) do
5
- Jack::UI.mute = true
6
- end
7
-
8
- let(:upload) { Jack::Config::Upload.new(test_options.merge(mute: true)) }
9
-
10
- describe "upload" do
11
- it "upload code paths" do
12
- exist = upload.local_cfg_exist?
13
- expect(exist).to be true # checking fixture
14
- # mock methods way down deep to test code paths, test reads weird though
15
- expect(upload).to receive(:eb_config_put)
16
- upload.upload
17
- end
18
-
19
- it "upload flow" do
20
- allow(upload).to receive(:compare).and_return(true)
21
-
22
- expect(upload).to receive(:compare)
23
- expect(upload).to receive(:upload)
24
- expect(upload).to receive(:update_env)
25
- upload.run
26
- end
27
- end
28
- end