-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
513 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
uffizzi-cli (0.3.8) | ||
uffizzi-cli (0.4.0) | ||
thor | ||
tty-spinner | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'uffizzi' | ||
|
||
module Uffizzi | ||
class CLI::Disconnect | ||
include ApiClient | ||
|
||
def run(credential_type) | ||
connection_type = case credential_type | ||
when 'docker-hub' | ||
Uffizzi.configuration.credential_types[:dockerhub] | ||
when 'acr' | ||
Uffizzi.configuration.credential_types[:azure] | ||
when 'ecr' | ||
Uffizzi.configuration.credential_types[:amazon] | ||
when 'gcr' | ||
Uffizzi.configuration.credential_types[:google] | ||
else | ||
raise Uffizzi::Error.new('Unsupported credential type.') | ||
end | ||
|
||
response = delete_credential(ConfigFile.read_option(:hostname), connection_type) | ||
|
||
if ResponseHelper.no_content?(response) | ||
Uffizzi.ui.say("Successfully disconnected #{connection_name(credential_type)} connection") | ||
else | ||
ResponseHelper.handle_failed_response(response) | ||
end | ||
end | ||
|
||
private | ||
|
||
def connection_name(credential_type) | ||
{ | ||
'docker-hub' => 'DockerHub', | ||
'acr' => 'ACR', | ||
'ecr' => 'ECR', | ||
'gcr' => 'GCR', | ||
}[credential_type] | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Uffizzi | ||
class Error < Thor::Error; end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Uffizzi | ||
VERSION = '0.3.8' | ||
VERSION = '0.4.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
.\" generated with Ronn-NG/v0.9.1 | ||
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1 | ||
.TH "PREVIEW" "" "March 2022" "" | ||
.SH "NAME" | ||
\fBpreview\fR \- manage previews | ||
.SH "NAME" | ||
.nf | ||
uffizzi preview service logs \- show the logs for a container service | ||
of a preview | ||
.fi | ||
.SH "SYNOPSIS" | ||
.nf | ||
uffizzi preview service logs LOG_TYPE [PREVIEW_ID] [SERVICE] [UFFIZZI_WIDE_FLAG \|\.\|\.\|\.] | ||
.fi | ||
.SH "DESCRIPTION" | ||
.nf | ||
Shows the logs for a given container service of a given preview\. | ||
|
||
This command can fail for the following reasons: | ||
\- There is no preview with the given PREVIEW_ID | ||
\- There is no service with the name SERVICE | ||
|
||
For more information on service logs, see: | ||
https://docs\.uffizzi\.com/cli | ||
.fi | ||
.SH "LOG_TYPE" | ||
.nf | ||
LOG_TYPE is one of the following: | ||
|
||
build | ||
The build logs of a service\. | ||
|
||
container | ||
The container logs of a service\. | ||
.fi | ||
.SH "POSITIONAL ARGUMENTS" | ||
.nf | ||
[PREVIEW_ID] | ||
The ID of the preview that includes the service you want to | ||
show logs for\. | ||
|
||
[SERVICE] | ||
The name of the service you want to show logs for\. | ||
.fi | ||
.SH "UFFIZZI WIDE FLAGS" | ||
.nf | ||
These flags are available to all commands: \-\-project\. Run $ uffizzi | ||
help for details\. | ||
.fi | ||
.SH "EXAMPLES" | ||
.nf | ||
The following command shows build logs for the service web\-app of the | ||
preview with ID deployment\-14: | ||
|
||
$ uffizzi preview service logs build deployment\-14 web\-app | ||
|
||
The following command shows container logs for the service postgres\-db of | ||
the preview with ID deployment\-14: | ||
|
||
$ uffizzi preview service logs container deployment\-14 postgres\-db | ||
.fi | ||
|
Oops, something went wrong.