-
Notifications
You must be signed in to change notification settings - Fork 4
/
release.sh
33 lines (24 loc) · 946 Bytes
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Define the repository URL
REPO_URL="https://api.github.com/repos/oobabooga/text-generation-webui/releases/latest"
# Get the latest release tag from the GitHub repository
RELEASE_TAG=$(curl -s $REPO_URL | grep 'tag_name' | cut -d\" -f4)
# Define clone argument for Docker
if [ -z "$RELEASE_TAG" ]; then
echo "Failed to get the latest release tag. Exiting..."
exit 1
fi
echo $RELEASE_TAG
CLONE_ARG="--branch $RELEASE_TAG"
# Build the Docker image
docker build --build-arg CACHEBUST=$(date +%s) --build-arg clone_arg="$CLONE_ARG" -t noneabove1182/text-gen-ui-gpu .
# Check if Docker build was successful
if [ $? -ne 0 ]; then
echo "Docker build failed. Exiting..."
exit 1
fi
# Tag the Docker image
docker tag noneabove1182/text-gen-ui-gpu:latest noneabove1182/text-gen-ui-gpu:$RELEASE_TAG
# Push the Docker images
docker push noneabove1182/text-gen-ui-gpu:latest
docker push noneabove1182/text-gen-ui-gpu:$RELEASE_TAG