forked from open-telemetry/opentelemetry-ruby
-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
272089d
commit 59f0e40
Showing
2 changed files
with
42 additions
and
28 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
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,38 @@ | ||
#!/bin/sh | ||
|
||
GEM_NAME="$1" | ||
|
||
case $GEM_NAME in | ||
*metrics-sdk) | ||
echo "metrics-sdk" | ||
GEM_PATH="metrics_sdk/" | ||
;; | ||
*metrics-api) | ||
echo "metrics-api" | ||
GEM_PATH="metrics_api/" | ||
;; | ||
*exporter-otlp) | ||
echo "exporter-otlp" | ||
GEM_PATH="exporter/otlp/" | ||
;; | ||
*) | ||
echo "Unknown file type" | ||
GEM_PATH='nowhere' | ||
;; | ||
esac | ||
|
||
cd "$GEM_PATH" || exit 1 | ||
|
||
bundle install | ||
|
||
# get gem version using bash | ||
file_to_find="version.rb" | ||
found_file=$(find "." -type f -name "$file_to_find") | ||
gem_version=$(grep -E "VERSION\s*=\s*'[^']+'" "$found_file" | awk -F "'" '{print $2}') | ||
|
||
# build and push gem | ||
gem build "opentelemetry-$GEM_NAME.gemspec" | ||
# gem push --key github --host https://rubygems.pkg.github.com/solarwinds "opentelemetry-instrumentation-$GEM_NAME-$gem_version.gem" | ||
|
||
# finished | ||
echo "Finished" |