#!/bin/bash
# Define the gem name and version
GEM_NAME="fluent-plugin-grafana-loki"
# Define the directory to store the gem
GEM_DIR="fluent-gem"
# Create the directory if it doesn't exist
mkdir -p "$GEM_DIR"
# Fetch the gem
cd $GEM_DIR
fluent-gem fetch $GEM_NAME
fluent-gem dependency $GEM_NAME --pipe | xargs -L1 fluent-gem fetch --platform ruby
cd ..
tgz_name=fluent-gem.$(date +%Y%m%d).tgz
tar cvfz $tgz_name fluent-gem
ln -s $tgz_name fluent-gem.tgz
rm -rf fluent-gem

