Skip to content
Snippets Groups Projects

Add auto_deploy command to display environment status

Merged Robert Speicher requested to merge rs-auto-deploy-status into master
All threads resolved!
1 file
+ 5
4
Compare changes
  • Side-by-side
  • Inline
  • 16e9053c
    This renames `DEFAULT_ENDPOINT` to `DEFAULT_HOST`, since we were
    providing the `/api/v4` endpoint for non-gitlab.com hosts.
    
    Now we expose the resulting `host` setting through a reader, which will
    be used in a future command.
@@ -4,15 +4,16 @@ module Chatops
module Gitlab
# HTTP client for the GitLab API.
class Client
DEFAULT_ENDPOINT = 'https://gitlab.com/api/v4'
DEFAULT_HOST = 'gitlab.com'
attr_reader :internal_client
attr_reader :internal_client, :host
# token - The API token to use for authentication.
# host - The hostname to use.
def initialize(token:, host: nil)
endpoint = host ? "https://#{host}/api/v4" : DEFAULT_ENDPOINT
def initialize(token:, host: DEFAULT_HOST)
endpoint = "https://#{host}/api/v4"
@host = host
@internal_client = ::Gitlab::Client
.new(endpoint: endpoint, private_token: token)
end
Loading