uffizzi-cli 0.5.0 → 0.6.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
  SHA256:
3
- metadata.gz: beaa38102ec282e48c643ba8f6a8c80a331d6ded1760681a004341e2b671b5cf
4
- data.tar.gz: c6517ea90506e72c11cb244f02f00760d5bb2afa1171f48fc9a997a8489165f0
3
+ metadata.gz: de1f8c92c08b2d323c6c379bd5521aa394db91d85ed02ebc73f8c8457bb083d9
4
+ data.tar.gz: 5c19dc240896c322b27d7dcf42499d6c5a67ce911ef3df625caf78fc71c259c5
5
5
  SHA512:
6
- metadata.gz: 2736a387fb65e9efe83fda0311f9f79bf4916bc828e9b6113bbf7e4e407256438e607af8f1f46dc6df1fa43423ba4728f6432396b60e06c24e16270024382f7a
7
- data.tar.gz: 53b0f5951c72ebfba472e147e4397d311380b051baf41d3ca2c7e20f894a3ea417406f4ac8fbc3063902a79c7e11f1e39d5246aee0505377b01583d733056914
6
+ metadata.gz: b653f34930cd546941d9646f7b5e2fccb854a784ed375e7da0b51f2a0cd9d9642b2463598ed6092e2d86be2de6ba804c9ae4c474290e5bdcee12123ad04fcd96
7
+ data.tar.gz: 7f4c915af4bebe54b1ae2e96b2661d08374ce4d71a9fed04388b815bf3c6c6e02039bed214d8e6da678dc427d6753ac17869473a172df5c81bc5f2dca9c0c7c3
data/README.md CHANGED
@@ -4,22 +4,20 @@ A command-line interace (CLI) for [Uffizzi App](https://github.com/UffizziCloud/
4
4
 
5
5
  ## Uffizzi Overview
6
6
 
7
- Uffizzi is the Full-stack Previews Engine that makes it easy for your team to preview code changes before merging—whether frontend, backend or microserivce. Define your full-stack apps with a familiar syntax based on Docker Compose, and Uffizzi will create on-demand test environments when you open pull requests or build new images. Preview URLs are updated when there’s a new commit, so your team can catch issues early, iterate quickly, and accelerate your release cycles.
7
+ Uffizzi is an open-source engine for creating lightweight, ephemeral test environments for APIs and full-stack applications. Uffizzi enables teams to preview new features before merging and to mitigate the risk of introducing regressions into a codebase. Each preview gets a shareable URL that's updated when you push new commits or image tags, so teams can provide continual feedback during the development/QA process. Previews can be configured to expire or be destroyed when a pull request is closed, so environments exist only as long as they are needed. Uffizzi also helps deconflict shared development environments since previews are deployed as isolated namespaces—there is no risk of clobbering another developer's preview.
8
8
 
9
- ## Getting started with Uffizzi
9
+ While Uffizzi depends on Kubernetes, it does not require end-users to interface with Kubernetes directly. Instead, Uffizzi leverages Docker Compose as its configuration file format, so developers do not need modify Kubernetes manifests or even know about Kubernetes.
10
10
 
11
- The fastest and easiest way to get started with Uffizzi is via the fully hosted version available at https://uffizzi.com, which includes free plans for small teams and qualifying open-source projects.
12
-
13
- Alternatively, you can self-host Uffizzi via the open-source repositories available here on GitHub. The remainder of this README is intended for users interested in self-hosting Uffizzi or for those who are just curious about how Uffizzi works.
11
+ Uffizzi is designed to integrate with any CI/CD system.
14
12
 
15
13
  ## Uffizzi Architecture
14
+ <img src="https://github.com/UffizziCloud/uffizzi_app/blob/main/docs/images/uffizzi-architecture.png" description="Uffizzi Architecture" width="320"/>
16
15
 
17
16
  Uffizzi consists of the following components:
18
17
 
19
18
  - [Uffizzi App](https://github.com/UffizziCloud/uffizzi_app) - The primary REST API for creating and managing Previews
20
19
  - [Uffizzi Controller](https://github.com/UffizziCloud/uffizzi_controller) - A smart proxy service that handles requests from Uffizzi App to the Kubernetes API
21
20
  - Uffizzi CLI (this repository) - A command-line interface for Uffizzi App
22
- - [Uffizzi Dashboard](https://app.uffizzi.com) - A graphical user interface for Uffizzi App, available as a paid service at https://uffizzi.com
23
21
 
24
22
  To host Uffizzi yourself, you will also need the following external dependencies:
25
23
 
@@ -29,197 +27,145 @@ To host Uffizzi yourself, you will also need the following external dependencies
29
27
 
30
28
  ## Installation
31
29
 
32
- Add this line to your application's `Gemfile`:
33
-
34
- ```ruby
35
- gem 'uffizzi-cli'
36
- ```
37
-
38
- And then execute:
39
-
40
- $ bundle install
41
-
42
- Or install it yourself as:
43
-
44
- $ gem install uffizzi-cli
30
+ The Uffizzi CLI can be used interactively or as part of an automated workflow (e.g. GitHub Actions). Both options use the `uffizzi/cli` container image available on Docker Hub.
45
31
 
46
- ### Docker image
32
+ ### Interactive mode
47
33
 
48
- We also provide an image on Docker Hub:
49
-
50
- ```bash
51
- docker run -it --rm uffizzi/cli project list
34
+ Run the CLI as a Docker container in interactive mode:
35
+ ```
36
+ docker run --interactive --rm --tty --entrypoint=sh uffizzi/cli
52
37
  ```
53
38
 
54
39
  If you specify the following environment variables, the Docker image's
55
40
  entrypoint script can log you into Uffizzi before executing your command.
56
41
 
57
42
  - `UFFIZZI_USER`
58
- - `UFFIZZI_HOSTNAME`
43
+ - `UFFIZZI_SERVER`
59
44
  - `UFFIZZI_PASSWORD`
60
45
  - `UFFIZZI_PROJECT` (optional)
61
46
 
62
- ## Development
63
-
64
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
65
-
66
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
67
-
68
- Run rubocop:
69
- `bundle exec rubocop -A`
70
-
71
- ## Testing
47
+ ### Automated mode
72
48
 
73
- Run tests:
74
- `bundle exec rake test`
75
-
76
- Run tests from a file:
77
- `bundle exec rake test TEST=test/uffizzi/cli/preview_test.rb`
78
-
79
- Run single test
80
- `bundle exec rake test TEST=test/uffizzi/cli/preview_test.rb TESTOPTS="--name=test_name"`
81
-
82
- ## Commands
83
-
84
- ### login
49
+ If you want to use Uffizzi as part of an automated workflow, you can pass the Uffizzi commands to the Docker run command. For example:
85
50
 
86
51
  ```
87
- $ uffizzi login --user your@email.com --hostname localhost:8080
52
+ docker run -it --rm uffizzi/cli project list
88
53
  ```
89
54
 
90
- Logging you into the app which you set in the hostname option.
91
-
92
- ### login options
55
+ ## Sample commands and examples
93
56
 
94
- | Option | Aliase | Description |
95
- | ------------ | ------ | ------------------------- |
96
- | `--user` | `-u` | Your email for logging in |
97
- | `--hostname` | | Adress of your app |
57
+ ### help
98
58
 
99
- If hostname uses basic authentication you can specify options for it by setting `basic_auth_user` and `basic_auth_password` via `config set` command.
59
+ The `help` subcommand can be used to see more information about a particular command.
100
60
 
101
- ### project
61
+ Examples:
102
62
 
103
63
  ```
104
- $ uffizzi project
64
+ uffizzi help
105
65
  ```
106
66
 
107
- Use this command to configure your projects. This command has 2 subcommands `list` and `compose`.
108
-
109
67
  ```
110
- $ uffizzi project list
68
+ uffizzi preview help
111
69
  ```
112
70
 
113
- Shows all your projects' slugs
114
-
115
- If you have only one project it will be added to your config file automatically, if there's more than one project you need to set up your project manually with the command `uffizzi config set YOUR_PROJECT_SLUG`
116
-
117
- ### compose
118
-
119
71
  ```
120
- $ uffizzi project compose
72
+ uffizzi project compose help
121
73
  ```
122
74
 
123
- That's the subcommand for project command. Use it to configure your compose file. This command has 3 subcommands `set`, `describe` and `unset`.
75
+ ### login
124
76
 
125
77
  ```
126
- $ uffizzi project compose set -f path_to_your_compose_file.yml
78
+ uffizzi login --server=localhost:8080 --username=your@email.com
127
79
  ```
128
80
 
129
- Creates a new or updates existed compose file in uffizzi app for project specified in config file
81
+ Log in to the app with the specified server.
130
82
 
131
- ```
132
- $ uffizzi project compose describe
133
- ```
83
+ #### login options
134
84
 
135
- Shows the content of compose file related to project specified in config file if it's valid or validation errors if it's not
85
+ | Option | Aliase | Description |
86
+ | ------------ | ------ | ------------------------- |
87
+ | `--username` | `-u` | Your email for logging in |
88
+ | `--server` | | The URL of the Uffizzi installation |
136
89
 
137
- ```
138
- $ uffizzi project compose unset
139
- ```
90
+ If server uses basic authentication you can specify options for it by setting `basic_auth_user` and `basic_auth_password` via `config set` command.
140
91
 
141
- Removes compose file related to project specified in config file
92
+ ### config
142
93
 
143
- You need to set project before use any of these commands via `uffizzi config set project YOUR_PROJECT_SLUG` command
94
+ Use this command to configure your cli app.
144
95
 
145
- ### compose options
96
+ ```
97
+ $ uffizzi config
98
+ ```
146
99
 
147
- | Option | Aliase | Description |
148
- | -------- | ------ | ------------------------- |
149
- | `--file` | `-f` | Path to your compose file |
100
+ Launching interactive setup guide that sets the values for `server`, `username` and `project`
150
101
 
151
- ### config
102
+ ### config subcommands
152
103
 
153
- Use this command to configure your cli app. This command has 4 subcommands `list`, `get`, `set`, and `delete`.
104
+ This command has 4 subcommands `list`, `get`, `set`, and `delete`.
154
105
 
155
106
  ```
156
- $ uffizzi config list
107
+ uffizzi config list
157
108
  ```
158
109
 
159
110
  Shows all options and their values from the config file.
160
111
 
161
112
  ```
162
- $ uffizzi config get OPTION
113
+ uffizzi config get-value OPTION
163
114
  ```
164
115
 
165
116
  Shows the value of the specified option.
166
117
 
167
118
  ```
168
- $ uffizzi config set OPTION VALUE
119
+ uffizzi config set OPTION VALUE
169
120
  ```
170
121
 
171
122
  Sets specified value for specified option. If a specified option already exists and has value it will be overwritten.
172
123
 
173
124
  ```
174
- $ uffizzi config delete OPTION
125
+ uffizzi config unset OPTION
175
126
  ```
176
127
 
177
- Deletes specified option.
128
+ Unsets specified option.
178
129
 
179
- ### disconnect ###
130
+ ### project
180
131
 
181
132
  ```
182
- $ uffizzi disconnect CREDENTIAL_TYPE
133
+ uffizzi project
183
134
  ```
184
135
 
185
- Deletes credential of specified type
136
+ Use this command to configure your projects. This command has 2 subcommands `list` and `compose`.
186
137
 
187
- Supported credential types - `docker-hub`, `acr`, `ecr`, `gcr`
138
+ ```
139
+ uffizzi project list
140
+ ```
188
141
 
189
- ## Generate manual
142
+ Shows all your projects' slugs
190
143
 
191
- In order to generate a manual, create a `.ronn` file having a name pattern like `uffizzi-{command-name}` (for example `uffizzi-project-compose`) in the `man` directory and run `bundle exec ronn man/{filename}.ronn`
144
+ If you have only one project it will be added to your config file automatically, if there's more than one project you need to set up your project manually with the command `uffizzi config set YOUR_PROJECT_SLUG`
192
145
 
193
- ## Git workflow for the app:
146
+ ### preview
194
147
 
195
- 1. Clone the repository and checkout to `develop` branch
148
+ Create and manage previews
196
149
 
197
- 2. Pull repository to ensure you have the latest changes
198
150
  ```
199
- git pull --rebase develop
151
+ uffizzi preview create docker-compose.uffizzi.yml
200
152
  ```
153
+ Create a preview from a compose file.
201
154
 
202
- 3. Start new branch from `develop`
203
155
  ```
204
- git checkout -b feature/short_issue_description (e.g. feature/add_domain_settings)
156
+ uffizzi preview delete deployment-21
205
157
  ```
158
+ Delete a preview with preview ID `deployment-21`.
159
+
160
+ ### disconnect
206
161
 
207
- 4. Make changes you need for the feature, commit them to the repo
208
162
  ```
209
- git add .
210
- git commit -m 'short commit description' (e.g. git commit -m 'added domain settings')
211
- git push origin BRANCH_NAME
163
+ uffizzi disconnect CREDENTIAL_TYPE
212
164
  ```
213
165
 
214
- 4. You already can create PR with develop branch as a target. Once the feature is ready let us know in the channel - we will review
166
+ Deletes credential of specified type
215
167
 
216
- 5. Merge your feature to `qa` branch and push. Ensure your pipeline is successful
217
- ```
218
- git checkout qa
219
- git pull --rebase qa
220
- git merge --no-ff BRANCH_NAME
221
- git push origin qa
222
- ```
168
+ Supported credential types - `docker-hub`, `acr`, `ecr`, `gcr`
223
169
 
224
170
  ## Contributing
225
171
 
data/config/uffizzi.rb CHANGED
@@ -12,7 +12,7 @@ module Uffizzi
12
12
  end
13
13
 
14
14
  configure do |config|
15
- config.hostname = 'http://web:7000'
15
+ config.server = 'http://web:7000'
16
16
  config.credential_types = {
17
17
  dockerhub: 'UffizziCore::Credential::DockerHub',
18
18
  azure: 'UffizziCore::Credential::Azure',
@@ -20,5 +20,6 @@ module Uffizzi
20
20
  amazon: 'UffizziCore::Credential::Amazon',
21
21
  github_container_registry: 'UffizziCore::Credential::GithubContainerRegistry',
22
22
  }
23
+ config.default_server = 'app.uffizzi.com'
23
24
  end
24
25
  end
@@ -5,14 +5,13 @@ module Uffizzi
5
5
  class << self
6
6
  def signed_in?
7
7
  ConfigFile.exists? &&
8
- ConfigFile.option_exists?(:account_id) &&
9
- ConfigFile.option_exists?(:cookie) &&
10
- ConfigFile.option_exists?(:hostname)
8
+ ConfigFile.option_has_value?(:account_id) &&
9
+ ConfigFile.option_has_value?(:cookie) &&
10
+ ConfigFile.option_has_value?(:server)
11
11
  end
12
12
 
13
- def project_set?
14
- ConfigFile.exists? &&
15
- ConfigFile.option_exists?(:project)
13
+ def project_set?(options)
14
+ !options[:project].nil? || (ConfigFile.exists? && ConfigFile.option_has_value?(:project))
16
15
  end
17
16
  end
18
17
  end
@@ -6,7 +6,7 @@ module Cli
6
6
  class Common
7
7
  class << self
8
8
  def show_manual(command_name)
9
- manual_doc_path = "man/#{command_name}"
9
+ manual_doc_path = File.join(Uffizzi.root, "man/#{command_name}")
10
10
 
11
11
  Open3.pipeline("man #{manual_doc_path}")
12
12
  end
@@ -7,13 +7,19 @@ module Uffizzi
7
7
  class CLI::Config < Thor
8
8
  include ApiClient
9
9
 
10
+ class << self
11
+ def help(_shell, _subcommand)
12
+ Cli::Common.show_manual(:config)
13
+ end
14
+ end
15
+
10
16
  desc 'list', 'list'
11
17
  def list
12
18
  run('list')
13
19
  end
14
20
 
15
21
  desc 'get [PROPERTY]', 'get'
16
- def get(property)
22
+ def get_value(property)
17
23
  run('get', property)
18
24
  end
19
25
 
@@ -22,11 +28,20 @@ module Uffizzi
22
28
  run('set', property, value)
23
29
  end
24
30
 
25
- desc 'delete [PROPERTY]', 'delete'
26
- def delete(property)
27
- run('delete', property)
31
+ desc 'unset [PROPERTY]', 'unset'
32
+ def unset(property)
33
+ run('unset', property)
34
+ end
35
+
36
+ desc 'setup', 'setup'
37
+ def setup
38
+ run('setup')
28
39
  end
29
40
 
41
+ map('get-value' => :get_value)
42
+
43
+ default_task :setup
44
+
30
45
  private
31
46
 
32
47
  def run(command, property = nil, value = nil)
@@ -37,11 +52,26 @@ module Uffizzi
37
52
  handle_get_command(property)
38
53
  when 'set'
39
54
  handle_set_command(property, value)
40
- when 'delete'
41
- handle_delete_command(property)
55
+ when 'unset'
56
+ handle_unset_command(property)
57
+ when 'setup'
58
+ handle_setup_command
42
59
  end
43
60
  end
44
61
 
62
+ def handle_setup_command
63
+ Uffizzi.ui.say("Configure the default properties that will be used to authenticate with your \
64
+ \nUffizzi API service and manage previews.\n")
65
+ server = Uffizzi.ui.ask('Server: ', default: Uffizzi.configuration.default_server.to_s)
66
+ username = Uffizzi.ui.ask('Username: ')
67
+ project = Uffizzi.ui.ask('Project: ')
68
+ ConfigFile.delete
69
+ ConfigFile.write_option(:server, server)
70
+ ConfigFile.write_option(:username, username)
71
+ ConfigFile.write_option(:project, project)
72
+ Uffizzi.ui.say('To login, run: uffizzi login')
73
+ end
74
+
45
75
  def handle_list_command
46
76
  ConfigFile.list
47
77
  end
@@ -55,10 +85,12 @@ module Uffizzi
55
85
 
56
86
  def handle_set_command(property, value)
57
87
  ConfigFile.write_option(property.to_sym, value)
88
+ Uffizzi.ui.say("Updated property [#{property}]")
58
89
  end
59
90
 
60
- def handle_delete_command(property)
61
- ConfigFile.delete_option(property.to_sym)
91
+ def handle_unset_command(property)
92
+ ConfigFile.unset_option(property.to_sym)
93
+ Uffizzi.ui.say("Unset property [#{property}]")
62
94
  end
63
95
  end
64
96
  end
@@ -35,8 +35,8 @@ module Uffizzi
35
35
  type: Uffizzi.configuration.credential_types[:dockerhub],
36
36
  }
37
37
 
38
- hostname = ConfigFile.read_option(:hostname)
39
- response = create_credential(hostname, params)
38
+ server = ConfigFile.read_option(:server)
39
+ response = create_credential(server, params)
40
40
 
41
41
  if ResponseHelper.created?(response)
42
42
  print_success_message('DockerHub')
@@ -57,8 +57,8 @@ module Uffizzi
57
57
  type: Uffizzi.configuration.credential_types[:azure],
58
58
  }
59
59
 
60
- hostname = ConfigFile.read_option(:hostname)
61
- response = create_credential(hostname, params)
60
+ server = ConfigFile.read_option(:server)
61
+ response = create_credential(server, params)
62
62
 
63
63
  if ResponseHelper.created?(response)
64
64
  print_success_message('ACR')
@@ -79,8 +79,8 @@ module Uffizzi
79
79
  type: Uffizzi.configuration.credential_types[:amazon],
80
80
  }
81
81
 
82
- hostname = ConfigFile.read_option(:hostname)
83
- response = create_credential(hostname, params)
82
+ server = ConfigFile.read_option(:server)
83
+ response = create_credential(server, params)
84
84
 
85
85
  if ResponseHelper.created?(response)
86
86
  print_success_message('ECR')
@@ -103,8 +103,8 @@ module Uffizzi
103
103
  type: Uffizzi.configuration.credential_types[:google],
104
104
  }
105
105
 
106
- hostname = ConfigFile.read_option(:hostname)
107
- response = create_credential(hostname, params)
106
+ server = ConfigFile.read_option(:server)
107
+ response = create_credential(server, params)
108
108
 
109
109
  if ResponseHelper.created?(response)
110
110
  print_success_message('GCR')
@@ -22,7 +22,7 @@ module Uffizzi
22
22
  raise Uffizzi::Error.new('Unsupported credential type.')
23
23
  end
24
24
 
25
- response = delete_credential(ConfigFile.read_option(:hostname), connection_type)
25
+ response = delete_credential(ConfigFile.read_option(:server), connection_type)
26
26
 
27
27
  if ResponseHelper.no_content?(response)
28
28
  Uffizzi.ui.say("Successfully disconnected #{connection_name(credential_type)} connection")
@@ -13,13 +13,15 @@ module Uffizzi
13
13
  end
14
14
 
15
15
  def run
16
- password = ENV['UFFIZZI_PASSWORD'] || IO::console.getpass('Enter Password: ')
17
-
18
- params = prepare_request_params(password)
19
- response = create_session(@options[:hostname], params)
16
+ Uffizzi.ui.say('Login to Uffizzi to your previews.')
17
+ server = set_server
18
+ username = set_username
19
+ password = set_password
20
+ params = prepare_request_params(username, password)
21
+ response = create_session(server, params)
20
22
 
21
23
  if ResponseHelper.created?(response)
22
- handle_succeed_response(response)
24
+ handle_succeed_response(response, server, username)
23
25
  else
24
26
  ResponseHelper.handle_failed_response(response)
25
27
  end
@@ -27,20 +29,37 @@ module Uffizzi
27
29
 
28
30
  private
29
31
 
30
- def prepare_request_params(password)
32
+ def set_server
33
+ config_server = ConfigFile.exists? && ConfigFile.option_has_value?(:server) ? ConfigFile.read_option(:server) : nil
34
+ @options[:server] || config_server || Uffizzi.ui.ask('Server: ')
35
+ end
36
+
37
+ def set_username
38
+ config_username = ConfigFile.exists? && ConfigFile.option_has_value?(:username) ? ConfigFile.read_option(:username) : nil
39
+ @options[:username] || config_username || Uffizzi.ui.ask('Username: ')
40
+ end
41
+
42
+ def set_password
43
+ ENV['UFFIZZI_PASSWORD'] || Uffizzi.ui.ask('Password: ', echo: false)
44
+ end
45
+
46
+ def prepare_request_params(username, password)
31
47
  {
32
48
  user: {
33
- email: @options[:user],
34
- password: password.strip,
49
+ email: username,
50
+ password: password,
35
51
  },
36
52
  }
37
53
  end
38
54
 
39
- def handle_succeed_response(response)
55
+ def handle_succeed_response(response, server, username)
40
56
  account = response[:body][:user][:accounts].first
41
57
  return Uffizzi.ui.say('No account related to this email') unless account_valid?(account)
42
58
 
43
- ConfigFile.create(account[:id], response[:headers], @options[:hostname])
59
+ ConfigFile.write_option(:server, server)
60
+ ConfigFile.write_option(:username, username)
61
+ ConfigFile.write_option(:cookie, response[:headers])
62
+ ConfigFile.write_option(:account_id, account[:id])
44
63
  end
45
64
 
46
65
  def account_valid?(account)
@@ -14,8 +14,8 @@ module Uffizzi
14
14
  def run
15
15
  return Uffizzi.ui.say('You are not logged in') unless Uffizzi::AuthHelper.signed_in?
16
16
 
17
- hostname = ConfigFile.read_option(:hostname)
18
- destroy_session(hostname)
17
+ server = ConfigFile.read_option(:server)
18
+ destroy_session(server)
19
19
 
20
20
  ConfigFile.delete
21
21
  Uffizzi.ui.say('You have been successfully logged out')
@@ -12,7 +12,7 @@ module Uffizzi
12
12
  desc 'logs [LOGS_TYPE] [DEPLOYMENT_ID] [CONTAINER_NAME]', 'logs'
13
13
  def logs(logs_type, deployment_name, container_name = args)
14
14
  return Uffizzi.ui.say('You are not logged in.') unless Uffizzi::AuthHelper.signed_in?
15
- return Uffizzi.ui.say('This command needs project to be set in config file') unless Uffizzi::AuthHelper.project_set?
15
+ return Uffizzi.ui.say('This command needs project to be set in config file') unless Uffizzi::AuthHelper.project_set?(options)
16
16
 
17
17
  deployment_id = PreviewService.read_deployment_id(deployment_name)
18
18
  response = service_logs_response(logs_type, deployment_id, container_name)
@@ -28,12 +28,12 @@ module Uffizzi
28
28
  desc 'logs [DEPLOYMENT_ID]', 'list'
29
29
  def list(deployment_name)
30
30
  return Uffizzi.ui.say('You are not logged in.') unless Uffizzi::AuthHelper.signed_in?
31
- return Uffizzi.ui.say('This command needs project to be set in config file') unless Uffizzi::AuthHelper.project_set?
31
+ return Uffizzi.ui.say('This command needs project to be set in config file') unless Uffizzi::AuthHelper.project_set?(options)
32
32
 
33
33
  project_slug = ConfigFile.read_option(:project)
34
- hostname = ConfigFile.read_option(:hostname)
34
+ server = ConfigFile.read_option(:server)
35
35
  deployment_id = PreviewService.read_deployment_id(deployment_name)
36
- response = fetch_deployment_services(hostname, project_slug, deployment_id)
36
+ response = fetch_deployment_services(server, project_slug, deployment_id)
37
37
 
38
38
  if ResponseHelper.ok?(response)
39
39
  handle_succeed_list_response(response, deployment_name)
@@ -46,11 +46,11 @@ module Uffizzi
46
46
 
47
47
  def service_logs_response(logs_type, deployment_id, container_name)
48
48
  project_slug = ConfigFile.read_option(:project)
49
- hostname = ConfigFile.read_option(:hostname)
49
+ server = ConfigFile.read_option(:server)
50
50
 
51
51
  case logs_type
52
52
  when 'container'
53
- fetch_deployment_service_logs(hostname, project_slug, deployment_id, container_name)
53
+ fetch_deployment_service_logs(server, project_slug, deployment_id, container_name)
54
54
  else
55
55
  raise Uffizzi::Error.new('Unknown log type')
56
56
  end