mirror of
https://github.com/inspec/inspec
synced 2024-11-22 04:33:09 +00:00
Merge pull request #7117 from inspec/sb/allow-telemetry-url-override
Allow dev/CI to override the telemetry URL to a staging service
This commit is contained in:
commit
e984269b41
3 changed files with 6 additions and 5 deletions
|
@ -36,6 +36,8 @@ vault version
|
|||
echo "--- fetching License serverl url and keys from vault"
|
||||
# Note: Currently, the value for the local license server is a static IP address. Please update this to a DNS name when available.
|
||||
$Env:CHEF_LICENSE_SERVER=vault kv get -field ci secret/inspec/licensing/server
|
||||
# Note: Currently, this returns blank response
|
||||
$Env:CHEF_TELEMETRY_URL=vault kv get -field ci secret/inspec/telemetry/server
|
||||
|
||||
echo "--- verifying if environment variables are set"
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@ unzip -o $VAULT_HOME/vault.zip -d $VAULT_HOME
|
|||
echo "--- fetching License serverl url and keys from vault"
|
||||
# Note: Currently, the value for the local license server is a static IP address. Please update this to a DNS name when available.
|
||||
export CHEF_LICENSE_SERVER=$($VAULT_HOME/vault kv get -field ci secret/inspec/licensing/server)
|
||||
# Note: Currently, this returns blank response
|
||||
export CHEF_TELEMETRY_URL=$($VAULT_HOME/vault kv get -field ci secret/inspec/telemetry/server)
|
||||
|
||||
if [ -n "${CI_ENABLE_COVERAGE:-}" ]; then
|
||||
echo "--- fetching Sonar token from vault"
|
||||
|
|
|
@ -6,11 +6,8 @@ module Inspec
|
|||
class Telemetry
|
||||
class HTTP < Base
|
||||
TELEMETRY_JOBS_PATH = "v1/job"
|
||||
TELEMETRY_URL = if ChefLicensing::Config.license_server_url&.match?("acceptance")
|
||||
ENV["CHEF_TELEMETRY_URL"]
|
||||
else
|
||||
"https://services.chef.io/telemetry/"
|
||||
end
|
||||
# Allow dev/CI to override the telemetry URL to a staging service
|
||||
TELEMETRY_URL = ENV["CHEF_TELEMETRY_URL"] || "https://services.chef.io/telemetry/"
|
||||
def run_ending(opts)
|
||||
payload = super
|
||||
response = connection.post(TELEMETRY_JOBS_PATH) do |req|
|
||||
|
|
Loading…
Reference in a new issue