Skip to content

Commit

Permalink
v0.5.1 - added custom zipkin_version fact
Browse files Browse the repository at this point in the history
  • Loading branch information
barnumbirr committed Nov 25, 2019
1 parent 06ddb5e commit 05ae18c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 20 additions & 0 deletions lib/facter/zipkin_version.rb
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
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "barnumbirr-zipkin",
"version": "0.5.0",
"version": "0.5.1",
"author": "barnumbirr",
"summary": "Install and manage OpenZipkin via Puppet",
"license": "Apache-2.0",
Expand Down

0 comments on commit 05ae18c

Please sign in to comment.