Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
target
backend/.idea
.idea
.env

32 changes: 32 additions & 0 deletions pull-from-ghcr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# Run 'sudo systemctl start docker' before running the script

# Exit script immediately on error
set -e

# Load environment variables from .env file
if [ -f .env ]; then
export $(grep -v '^#' .env | xargs)
else
echo "Error: .env file not found."
exit 1
fi

# Ensure the GHCR_PAT variable is set
if [ -z "$GHCR_PAT" ]; then
echo "Error: GHCR_PAT is not set. Check your .env file."
exit 1
fi

# Variables
GHCR_USERNAME="GerardChabaBristol"
IMAGE_NAME="ghcr.io/spe-uob/2024-ailearningtool:latest"

echo "Logging into GHCR..."
echo "$GHCR_PAT" | docker login ghcr.io -u "$GHCR_USERNAME" --password-stdin

echo "Pulling the Docker image..."
docker pull "$IMAGE_NAME"

echo "Docker image pulled successfully: $IMAGE_NAME"
Loading