-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deployment): Cleaner default script
- Loading branch information
1 parent
30b10b9
commit 885b476
Showing
1 changed file
with
14 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
#!/bin/bash | ||
|
||
ZIP_PATH="/tmp/libertai-agent.zip" | ||
CODE_PATH="/root/libertai-agent" | ||
DOCKERFILE_PATH="/tmp/libertai-agent.Dockerfile" | ||
|
||
# Setup | ||
apt install docker.io unzip -y | ||
|
||
# Cleaning previous agent | ||
rm -rf /root/libertai-agent | ||
rm -rf $CODE_PATH | ||
docker stop libertai-agent && docker rm $_ | ||
|
||
# Deploying the new agent | ||
unzip /tmp/libertai-agent.zip -d /root/libertai-agent | ||
wget https://raw.githubusercontent.com/Libertai/libertai-agents/refs/heads/reza/deployment-instances/deployment/$2.Dockerfile -O /tmp/libertai-agent.Dockerfile -q | ||
docker build /root/libertai-agent \ | ||
-f /tmp/libertai-agent.Dockerfile \ | ||
unzip $ZIP_PATH -d $CODE_PATH | ||
wget https://raw.githubusercontent.com/Libertai/libertai-agents/refs/heads/reza/deployment-instances/deployment/$2.Dockerfile -O $DOCKERFILE_PATH -q | ||
docker build $CODE_PATH \ | ||
-f $DOCKERFILE_PATH \ | ||
-t libertai-agent \ | ||
--build-arg PYTHON_VERSION=$1 | ||
docker run --name libertai-agent -p 8000:8000 -d libertai-agent | ||
|
||
# Cleanup | ||
rm -f $ZIP_PATH | ||
# rm -rf $CODE_PATH | ||
rm -f $DOCKERFILE_PATH |