forked from BLC/sgeUpdated
Update sgeupdated pipeline v12
All checks were successful
sgeUpdated Smoke Test / smoke-test (push) Successful in 6s
All checks were successful
sgeUpdated Smoke Test / smoke-test (push) Successful in 6s
a new update that fixed the docker files problem, it deletes the old ones then builds the new accordingly
This commit is contained in:
@@ -32,27 +32,36 @@ jobs:
|
|||||||
cd/home/ubuntu/sgeUpdated
|
cd/home/ubuntu/sgeUpdated
|
||||||
git pull origin main
|
git pull origin main
|
||||||
|
|
||||||
# --- Backend ---
|
# --- Backend ---
|
||||||
if echo "${CHANGED_FILES}" | grep -q "sge-backend"; then
|
if echo "${CHANGED_FILES}" | grep -q "sge-backend"; then
|
||||||
echo "Backend changes detected..."
|
echo "Backend changes detected..."
|
||||||
cd sge-backend
|
cd sge-backend
|
||||||
mvn clean install
|
mvn clean install
|
||||||
cd ..
|
cd ..
|
||||||
docker build -t bgreen-backend ./sge-backend
|
|
||||||
docker compose up -d --force-recreate backend
|
|
||||||
fi
|
|
||||||
|
|
||||||
# --- Frontend ---
|
# Stop & remove old backend container (ignore errors if not exists)
|
||||||
if echo "${CHANGED_FILES}" | grep -q "sge-frontend"; then
|
docker stop sgeupdated-backend-1 || true
|
||||||
echo "Frontend changes detected..."
|
docker rm sgeupdated-backend-1 || true
|
||||||
cd sge-frontend
|
|
||||||
if echo "${CHANGED_FILES}" | grep -q "sge-frontend/package.json"; then
|
|
||||||
echo "package.json changed → installing dependencies"
|
|
||||||
npm install
|
|
||||||
fi
|
|
||||||
npm run build
|
|
||||||
cd ..
|
|
||||||
docker build -t bgreen-frontend ./sge-frontend
|
|
||||||
docker compose up -d --force-recreate frontend
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
# Build Docker image and restart container
|
||||||
|
docker compose build --no-cache backend
|
||||||
|
docker compose up -d --force-recreate backend
|
||||||
|
fi
|
||||||
|
|
||||||
|
# --- Frontend ---
|
||||||
|
if echo "${CHANGED_FILES}" | grep -q "sge-frontend"; then
|
||||||
|
echo "Frontend changes detected..."
|
||||||
|
cd sge-frontend
|
||||||
|
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
# Stop & remove old frontend container (ignore errors if not exists)
|
||||||
|
docker stop sgeupdated-frontend-1 || true
|
||||||
|
docker rm sgeupdated-frontend-1 || true
|
||||||
|
|
||||||
|
# Build Docker image and restart container
|
||||||
|
docker compose build --no-cache frontend
|
||||||
|
docker compose up -d --force-recreate frontend
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user