#--- Note: this file is designed to run locally to ready the deploy branch for hugspace | |
#--- Entry: this script is assumed to run from the /app root folder | |
#--- Usage: ./scripts/huggingface/util_local_deploy_toHugSpace.sh | |
#--- Prereqs: | |
# - deploy_dockerLocal branch image and container has been tested and tagged | |
# - deploy_dockerHub branch has been merged from deploy_dockerLocal, tagged and pushed an image to kidcoconut73/img_stm_omdenasaudi_hcc:<version> | |
# - deploy_hugspace branch has been merged from deploy_dockerLocal, readyToDeployScript run, and pushed to hugspace | |
<<blockComment | |
- if all code is within a dockerHub image, all we need to push to huggingFace is the Dockerfile and the README.md | |
blockComment | |
#--- initialize/configuration | |
echo "WARN: this script should only be run from deploy_hugspace" | |
#--- merge | |
echo "TRACE: Merge from deploy_dockerLocal ..." | |
git merge deploy_dockerLocal | |
#--- ready the Dockerfile.hug as the active Dockerfile | |
echo "TRACE: update Dockerfile for hugspace ..." | |
cp Dockerfile.hug Dockerfile | |
#--- cleanup all extraneous code | |
echo "TRACE: cleanup all extraneous code ..." | |
git rm -r bin data lib routes scripts/docker scripts/dockerHub scripts/models scripts/streamlitFastApi templ uix | |
git rm .dockerignore .gitattributes app.py config.toml Dockerfile.hug Dockerfile.local main.py packages.txt requirements.txt | |
#--- manually check from this point | |
# - git status | |
# - git rm any remaining unneeded files | |
# - git commit -a -m "ready for deploy to hugspace v0.1.5" | |
# - git tag 0.1.5_hugspace | |
# - git push --force hugspace deploy_hugspace:main |