Skip to content

Commit

Permalink
update: copy_config
Browse files Browse the repository at this point in the history
  • Loading branch information
sigee-min committed Aug 1, 2024
1 parent 6ec0c02 commit f59184e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions init_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,31 @@
def copy_configs():
src_directory = "/data/config-tmp/"
dest_directory = "/data/config/"
files = os.listed(src_directory)
files = os.listdir(src_directory)

for file in files:
src_path = os.path.join(src_directory, file)
dest_path = os.path.join(dest_directory, file)

# Check if the destination file exists and remove it
if os.path.exists(dest_path):
os.remove(dest_path)

# Move the file from src to dest
shutil.move(src_path, dest_path)

print(f"Copied configuration files from {src_directory} to {dest_directory}")

def install_plugins():
plugin_directory = "/data/plugins/"
plugin_urls = os.getenv("PLUGIN_URLS", "")

if not plugin_urls:
print("No PLUGIN_URLS environment variable set.")
return

# Ensure the plugins directory exists
os.makers(plugin_directory, exist_ok=True)
os.makedirs(plugin_directory, exist_ok=True)

# Download each plugin from the provided URLs
for url in plugin_urls.split(','):
Expand Down

0 comments on commit f59184e

Please sign in to comment.