fix: Use home directory instead of /opt for CT109 deployment (permission issue)
This commit is contained in:
parent
d4c2bedf9b
commit
541b531290
@ -191,16 +191,25 @@ jobs:
|
|||||||
set -e
|
set -e
|
||||||
export VERSION="${{ github.sha }}"
|
export VERSION="${{ github.sha }}"
|
||||||
|
|
||||||
# Navigate to deployment directory
|
# Use home directory for deployment
|
||||||
cd /opt/littleshop || mkdir -p /opt/littleshop && cd /opt/littleshop
|
DEPLOY_DIR="$HOME/littleshop"
|
||||||
|
echo "Using deployment directory: $DEPLOY_DIR"
|
||||||
|
|
||||||
|
# Create deployment directory if it doesn't exist
|
||||||
|
mkdir -p "$DEPLOY_DIR"
|
||||||
|
cd "$DEPLOY_DIR"
|
||||||
|
|
||||||
# Clone or pull latest code
|
# Clone or pull latest code
|
||||||
if [ ! -d .git ]; then
|
if [ ! -d .git ]; then
|
||||||
echo "Cloning repository..."
|
echo "Cloning repository..."
|
||||||
|
rm -rf * # Clean any existing files
|
||||||
git clone https://git.silverlabs.uk/Jamie/littleshop.git .
|
git clone https://git.silverlabs.uk/Jamie/littleshop.git .
|
||||||
|
else
|
||||||
|
echo "Repository already cloned, pulling latest..."
|
||||||
|
git fetch origin
|
||||||
fi
|
fi
|
||||||
echo "Pulling latest code from git..."
|
|
||||||
git fetch origin
|
echo "Checking out version: $VERSION"
|
||||||
git checkout $VERSION || git checkout main
|
git checkout $VERSION || git checkout main
|
||||||
|
|
||||||
# Build images on CT109
|
# Build images on CT109
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user