Skip to content

Commit e6601a8

Browse files
invoke docs prebuild script directly
1 parent 79f6012 commit e6601a8

File tree

4 files changed

+16
-27
lines changed

4 files changed

+16
-27
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.env
22
__pycache__
33
sentence-transformers
4-
.tmp/*
5-
!.tmp/prebuild.sh
4+
.tmp/
65
node_modules

app/.tmp/prebuild.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

app/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ RUN pip install --no-cache-dir -r requirements.txt
3636
# Copy the application source code into the container
3737
COPY . /app
3838

39-
# Make the prebuild.sh script executable
40-
RUN chmod +x .tmp/prebuild.sh
41-
4239
# Expose port 5050 for the Flask application
4340
EXPOSE 5050
4441

app/get_knowledge_base.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,21 @@ def setup_repositories():
3333
clone_repository(repo_url, os.path.join(tmp_dir, repo_name))
3434

3535
def run_prebuild_script():
36-
""" Run the 'prebuild.sh' script located in the .tmp directory. """
37-
os.chdir(".tmp")
38-
script_path = os.path.join("./", "prebuild.sh") # Ensure the path is correct
39-
os.chdir("..")
40-
if os.path.exists(script_path):
41-
print("Running prebuild.sh...")
42-
try:
43-
subprocess.run(["bash", script_path], check=True)
44-
except subprocess.CalledProcessError as e:
45-
print(f"Error running prebuild.sh: {e}")
46-
else:
47-
print("prebuild.sh not found.")
36+
""" Run the defang-docs repo prebuild script"""
37+
38+
subprocess.run(
39+
["npm", "-C", ".tmp/defang-docs", "install"],
40+
check=True,
41+
stdout=subprocess.PIPE,
42+
stderr=subprocess.PIPE
43+
)
44+
45+
subprocess.run(
46+
["npm", "-C", ".tmp/defang-docs", "run", "prebuild"],
47+
check=True,
48+
stdout=subprocess.PIPE,
49+
stderr=subprocess.PIPE
50+
)
4851

4952
def parse_markdown():
5053
""" Parse markdown files in the current directory into JSON """

0 commit comments

Comments
 (0)