Skip to content

Commit

Permalink
Use git archive instead of zip
Browse files Browse the repository at this point in the history
  • Loading branch information
AnesBenmerzoug committed Jun 4, 2024
1 parent 82348ef commit 7328caa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 34 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ config_local.yaml
temp
html
*.zip
notebooks/_build
_build
apidocs

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
18 changes: 0 additions & 18 deletions .zipignore

This file was deleted.

4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

title: Machine Learning Control Training
author: appliedAI TransferLab
copyright: '2023'
exclude_patterns: [".github", ".venv", "**.ipynb_checkpoints", "_config.yml", "_toc.yml"]
copyright: "2023"
exclude_patterns: [".github", ".venv", "**__pycache__", "**.ipynb_checkpoints", "_config.yml", "_toc.yml"]
# Auto-exclude files not in the toc
only_build_toc_files: true

Expand Down
18 changes: 5 additions & 13 deletions build_scripts/prepare_zip_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,17 @@ BUILD_DIR=$(dirname "$0")

echo "Validating build prerequisites..."

if grep "PARTICIPANT_BUCKET_READ_SECRET" config.yml ; then
echo "You must replace the secret in config.yml with the actual secret, not
a reference to an environment variable. Use the value of the env var there instead, just be careful not to commit it!"
exit 255
fi
echo "Done"

check_notebooks_for_non_executed_load

echo "Building exercise notebooks with jupyter-book..."
jupyter-book build notebooks
bash build_scripts/build_docs.sh
echo "Done"

echo "Done. Building the zip package..."

echo "Adding source files to thesan_output.zip"
zip -r thesan_output.zip ./* [email protected]
cd notebooks/_build
echo "Adding documentation in html to thesan_output.zip"
zip -ur ../../thesan_output.zip html
echo "Adding source files to training_ml_control_content.zip"
git archive --output=./training_ml_control_content.zip --format=zip HEAD
echo "Adding documentation in html to training_ml_control_content.zip"
zip -ur training_ml_control_content.zip _build/html
echo "Done"
)

0 comments on commit 7328caa

Please sign in to comment.