-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.5.1 - added custom zipkin_version fact
- Loading branch information
1 parent
06ddb5e
commit 05ae18c
Showing
3 changed files
with
28 additions
and
5 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 |
---|---|---|
|
@@ -3,16 +3,19 @@ name: Build and publish to Puppet Forge | |
on: | ||
push: | ||
tags: | ||
- v* | ||
- v.* | ||
- v[0-9]+.[0-9]+.[0-9]+ | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get latest tag | ||
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10}) | ||
- name: Clone repository | ||
uses: actions/checkout@v1 | ||
with: | ||
ref: ${{ env.RELEASE_VERSION }} | ||
- name: Build and publish module | ||
uses: barnumbirr/publish-forge-action@master | ||
uses: barnumbirr/action-forge-[email protected] | ||
env: | ||
FORGE_API_KEY: ${{ secrets.FORGE_API_KEY }} | ||
REPOSITORY_URL: https://forgeapi.puppet.com/v3/releases |
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,20 @@ | ||
Facter.add(:zipkin_version) do | ||
setcode do | ||
begin | ||
require 'uri' | ||
require 'json' | ||
require 'net/http' | ||
|
||
uri = URI.parse("http://localhost:9411/info") | ||
request = Net::HTTP::Get.new(uri) | ||
|
||
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http| | ||
http.request(request) | ||
end | ||
|
||
parsed_json = JSON.parse(response.body) | ||
parsed_json['zipkin']['version'] | ||
rescue | ||
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