Skip to content

Commit

Permalink
feat(deployment): Cleaner default script
Browse files Browse the repository at this point in the history
  • Loading branch information
RezaRahemtola committed Dec 6, 2024
1 parent 7efd24b commit 08eeb98
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions deployment/deploy.sh
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

0 comments on commit 08eeb98

Please sign in to comment.