2024-10-19 13:03:04 +01:00
|
|
|
import subprocess
|
2024-10-14 15:05:23 +01:00
|
|
|
from lib.create_target_dir import create_target_dir
|
|
|
|
|
from lib.transfer_files import transfer_files
|
2024-10-19 13:03:04 +01:00
|
|
|
from lib.transform_links import transform_links
|
|
|
|
|
from lib.generate_index_file import generate_index_file
|
|
|
|
|
|
|
|
|
|
SOURCE = "/home/thomas/repos/eolas"
|
|
|
|
|
TARGET = "/home/thomas/repos/eolas/neuron"
|
|
|
|
|
SLACK_NOTIFIER = "/home/thomas/repos/slack-notifier/src/index.js"
|
2024-10-13 19:00:48 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
2024-10-19 13:03:04 +01:00
|
|
|
try:
|
|
|
|
|
build_id = create_target_dir(TARGET, SOURCE)
|
|
|
|
|
transfer_files(f"{TARGET}/{build_id}", SOURCE)
|
|
|
|
|
transform_links(f"{TARGET}/{build_id}")
|
|
|
|
|
generate_index_file(f"{TARGET}/{build_id}", build_id, SOURCE)
|
|
|
|
|
subprocess.run(
|
|
|
|
|
[
|
|
|
|
|
"node",
|
|
|
|
|
SLACK_NOTIFIER,
|
|
|
|
|
"eolas",
|
|
|
|
|
f"✅ Neuron static site successfully generated locally for Eolas. Build: {build_id}",
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
subprocess.run(
|
|
|
|
|
[
|
|
|
|
|
"node",
|
|
|
|
|
SLACK_NOTIFIER,
|
|
|
|
|
"eolas",
|
|
|
|
|
f"⛔ Neuron static site generation failed for Eolas: {e}",
|
|
|
|
|
]
|
|
|
|
|
)
|
2024-10-13 19:00:48 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
main()
|