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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +19 -19
- data/lib/jack.rb +1 -0
- data/lib/jack/cli.rb +17 -10
- data/lib/jack/config.rb +2 -2
- data/lib/jack/config/{upload.rb → apply.rb} +3 -3
- data/lib/jack/config/diff.rb +1 -1
- data/lib/jack/config/{download.rb → get.rb} +1 -1
- data/lib/jack/config/help.rb +7 -7
- data/lib/jack/create.rb +1 -1
- data/lib/jack/deploy.rb +59 -0
- data/lib/jack/help.rb +12 -2
- data/lib/jack/util.rb +1 -1
- data/lib/jack/version.rb +1 -1
- data/spec/lib/cli_spec.rb +9 -3
- data/spec/lib/config/apply_spec.rb +28 -0
- data/spec/lib/config/{download_spec.rb → get_spec.rb} +6 -6
- metadata +8 -7
- data/spec/lib/config/upload_spec.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b32fb136e9666d9c320b57a6e82dbd6265a88ca
|
4
|
+
data.tar.gz: c44513aa9ec470ae7345e6642a49f558c45554dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 944f181ed9841d73ea420881a1ee995a9a0ac00a3db561591919abae4fedc163dbce4e48938071a8ab4ba2015258d141255dba12c11244a3ea6820b51d5658d7
|
7
|
+
data.tar.gz: adbf44aee62358dc8e9251fdc5d6da43744254c0a3c9ac6aacd8fc62820edf58b3a5d1eda27265434a57d72b45a7a5da9ab5d5b30093e65cb7da967f1ca51424
|
data/CHANGELOG.md
CHANGED
@@ -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
|
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
|
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
|
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
|
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
|
-
####
|
140
|
+
#### Get Elastic Beanstalk Configuration
|
141
141
|
|
142
|
-
To download
|
142
|
+
To download the Elastic Beanstalk configuration:
|
143
143
|
|
144
144
|
```
|
145
|
-
$ jack config
|
145
|
+
$ jack config get hi-web-prod-1
|
146
146
|
|
147
|
-
$ jack config
|
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
|
-
####
|
152
|
+
#### Apply Elastic Beanstalk Configuration
|
153
153
|
|
154
|
-
To
|
154
|
+
To apply a template configuration.
|
155
155
|
|
156
156
|
```
|
157
|
-
$ jack config
|
157
|
+
$ jack config apply hi-web-prod-1
|
158
158
|
|
159
|
-
$ jack config
|
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
|
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
|
189
|
-
$ jack config help
|
190
|
-
$ jack config help
|
191
|
-
$ jack config help
|
188
|
+
$ jack create help
|
189
|
+
$ jack config get help
|
190
|
+
$ jack config apply help
|
191
|
+
$ jack config sort help
|
192
192
|
</pre>
|
data/lib/jack.rb
CHANGED
data/lib/jack/cli.rb
CHANGED
@@ -5,23 +5,23 @@ Jack::VersionChecker.new.run unless ENV['TEST']
|
|
5
5
|
|
6
6
|
module Jack
|
7
7
|
class Config < Command
|
8
|
-
desc "
|
9
|
-
long_desc Help.
|
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
|
12
|
-
|
11
|
+
def apply(env_name)
|
12
|
+
Apply.new(options.merge(env_name: env_name)).run
|
13
13
|
end
|
14
14
|
|
15
|
-
desc "
|
16
|
-
long_desc Help.
|
17
|
-
option :dirty, type: :boolean, desc: "leave the remote eb config and
|
18
|
-
def
|
19
|
-
|
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
|
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)
|
data/lib/jack/config.rb
CHANGED
@@ -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 :
|
9
|
+
autoload :Get, 'jack/config/get'
|
10
10
|
autoload :Sort, 'jack/config/sort'
|
11
11
|
autoload :Transmit, 'jack/config/transmit'
|
12
|
-
autoload :
|
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
|
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
|
41
|
-
$ jack config
|
40
|
+
$ jack config get #{@env_name}
|
41
|
+
$ jack config get -h # for more info
|
42
42
|
EOL
|
43
43
|
message
|
44
44
|
end
|
data/lib/jack/config/diff.rb
CHANGED
data/lib/jack/config/help.rb
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
class Jack::Config::Help
|
2
2
|
class << self
|
3
|
-
def
|
3
|
+
def apply
|
4
4
|
<<-EOL
|
5
|
-
|
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
|
11
|
+
$ jack config apply hi-web-stag-1
|
12
12
|
|
13
|
-
$ jack config
|
13
|
+
$ jack config apply myapp -c myconfig hi-web-stag-1
|
14
14
|
EOL
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
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
|
25
|
+
$ jack config get hi-web-stag-1
|
26
26
|
|
27
|
-
$ jack config
|
27
|
+
$ jack config get myapp -c myconfig hi-web-stag-1
|
28
28
|
EOL
|
29
29
|
end
|
30
30
|
|
data/lib/jack/create.rb
CHANGED
data/lib/jack/deploy.rb
ADDED
@@ -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
|
data/lib/jack/help.rb
CHANGED
@@ -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
|
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
|
48
|
+
$ jack config get hi-web-stag-1
|
39
49
|
|
40
50
|
For more info:
|
41
51
|
|
data/lib/jack/util.rb
CHANGED
data/lib/jack/version.rb
CHANGED
data/spec/lib/cli_spec.rb
CHANGED
@@ -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
|
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
|
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
|
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(:
|
8
|
+
let(:get) { Jack::Config::Get.new(test_options) }
|
9
9
|
|
10
|
-
describe "
|
11
|
-
it "
|
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(
|
14
|
-
expect(
|
15
|
-
|
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.
|
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/
|
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/
|
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/
|
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
|