Skip to content

Commit

Permalink
msi: migrate to FLUENT_PACKAGE_TOPDIR
Browse files Browse the repository at this point in the history
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
  • Loading branch information
kenhys authored and daipom committed Jul 10, 2023
1 parent 90550e3 commit 779e0d0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
7 changes: 2 additions & 5 deletions fluent-package/msi/assets/fluentd.bat
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
@echo off
if "%~nx0" == "td-agent.bat" (
set FLUENT_PACKAGE_TOPDIR=%~dp0..\
set TD_AGENT_TOPDIR=%~dp0..\..\td-agent
) else (
set FLUENT_PACKAGE_TOPDIR=%~dp0
set TD_AGENT_TOPDIR=%~dp0..\td-agent
)

@rem Convert path separator from backslash to forwardslash
setlocal enabledelayedexpansion
set FLUENT_PACKAGE_TOPDIR="FLUENT_PACKAGE_TOPDIR=!FLUENT_PACKAGE_TOPDIR:\=/!"
set TD_AGENT_TOPDIR="TD_AGENT_TOPDIR=!TD_AGENT_TOPDIR:\=/!"
endlocal

set PATH=%FLUENT_PACKAGE_TOPDIR%bin;%PATH%
set PATH=%FLUENT_PACKAGE_TOPDIR%;%PATH%
set FLUENT_CONF=%TD_AGENT_TOPDIR%/etc/td-agent/td-agent.conf
set FLUENT_PLUGIN=%TD_AGENT_TOPDIR%/etc/td-agent/plugin
set FLUENT_CONF=%FLUENT_PACKAGE_TOPDIR%/etc/fluent/fluentd.conf
set FLUENT_PLUGIN=%FLUENT_PACKAGE_TOPDIR%/etc/fluent/plugin
set FLUENT_PACKAGE_VERSION=%FLUENT_PACKAGE_TOPDIR%/bin/fluent-package-version.rb
for %%p in (%*) do (
if "%%p"=="--version" (
Expand Down
2 changes: 1 addition & 1 deletion fluent-package/msi/source.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
Permanent="no"
Part="all"
System="yes"
Name="TD_AGENT_TOPDIR"
Name="FLUENT_PACKAGE_TOPDIR"
Value="[FLUENTPROJECTLOCATION]"/>
</Component>
</DirectoryRef>
Expand Down
4 changes: 2 additions & 2 deletions fluent-package/templates/opt/fluent/share/td-agent.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<buffer>
@type file
<% if windows? %>
path "#{ENV['TD_AGENT_TOPDIR']}/var/log/<%= compat_package_dir %>/buffer/td"
path "#{ENV['FLUENT_PACKAGE_TOPDIR']}/var/log/<%= compat_package_dir %>/buffer/td"
<% else %>
path /var/log/<%= package_dir %>/buffer/td
<% end %>
Expand All @@ -34,7 +34,7 @@
<secondary>
@type file
<% if windows? %>
path "#{ENV['TD_AGENT_TOPDIR']}/var/log/<%= compat_package_dir %>/failed_records"
path "#{ENV['FLUENT_PACKAGE_TOPDIR']}/var/log/<%= compat_package_dir %>/failed_records"
<% else %>
path /var/log/<%= package_dir %>/failed_records
<% end %>
Expand Down

0 comments on commit 779e0d0

Please sign in to comment.