Choose correct configuration when building for windows.

This commit is contained in:
Ross McDonald 2016-05-06 10:46:29 -05:00
parent 72fcacbbc7
commit 5348937c3d
1 changed files with 10 additions and 5 deletions

View File

@ -132,13 +132,16 @@ def create_package_fs(build_root):
os.makedirs(os.path.join(build_root, d)) os.makedirs(os.path.join(build_root, d))
os.chmod(os.path.join(build_root, d), 0o755) os.chmod(os.path.join(build_root, d), 0o755)
def package_scripts(build_root, windows=False): def package_scripts(build_root, config_only=False, windows=False):
"""Copy the necessary scripts and configuration files to the package """Copy the necessary scripts and configuration files to the package
filesystem. filesystem.
""" """
if config_only or windows:
logging.info("Copying configuration to build directory")
if windows: if windows:
logging.info("Copying configuration to build directory.")
shutil.copyfile(DEFAULT_WINDOWS_CONFIG, os.path.join(build_root, "telegraf.conf")) shutil.copyfile(DEFAULT_WINDOWS_CONFIG, os.path.join(build_root, "telegraf.conf"))
else:
shutil.copyfile(DEFAULT_CONFIG, os.path.join(build_root, "telegraf.conf"))
os.chmod(os.path.join(build_root, "telegraf.conf"), 0o644) os.chmod(os.path.join(build_root, "telegraf.conf"), 0o644)
else: else:
logging.info("Copying scripts and configuration to build directory") logging.info("Copying scripts and configuration to build directory")
@ -554,10 +557,12 @@ def package(build_output, pkg_name, version, nightly=False, iteration=1, static=
os.makedirs(build_root) os.makedirs(build_root)
# Copy packaging scripts to build directory # Copy packaging scripts to build directory
if platform == "windows" or static or "static_" in arch: if platform == "windows":
# For windows and static builds, just copy # For windows and static builds, just copy
# binaries to root of package (no other scripts or # binaries to root of package (no other scripts or
# directories) # directories)
package_scripts(build_root, config_only=True, windows=True)
elif static or "static_" in arch:
package_scripts(build_root, config_only=True) package_scripts(build_root, config_only=True)
else: else:
create_package_fs(build_root) create_package_fs(build_root)