Nixius
/
template
Template
2
1
Fork 1

Add Git workflow Cursor rule and enhance build-test-run.sh with Git guidance

This commit is contained in:
Leopere 2025-04-23 10:08:07 -04:00
parent b0c1265262
commit 1dde4ddb57
3 changed files with 33 additions and 1 deletions

View File

@ -56,6 +56,14 @@
{
"pattern": "**/.woodpecker.yml",
"rule": "ci-pipeline.mdc"
},
{
"pattern": "**/build-test-run.sh",
"rule": "git-workflow.mdc"
},
{
"pattern": "**/.git/**/*",
"rule": "git-workflow.mdc"
}
]
}

View File

@ -0,0 +1,5 @@
---
description:
globs:
alwaysApply: false
---

View File

@ -5,6 +5,7 @@ set -e
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
echo -e "${YELLOW}Starting build-test-run script for local development${NC}"
@ -27,6 +28,7 @@ fi
echo -e "${GREEN}Build completed successfully${NC}"
# Step 2: Run tests if they exist
TESTS_PASSED=false
if [ -f "./tests/run_tests.sh" ]; then
echo -e "${GREEN}Step 2: Running tests${NC}"
echo "Running tests..." >> $LOG_FILE
@ -34,9 +36,11 @@ if [ -f "./tests/run_tests.sh" ]; then
./tests/run_tests.sh >> $LOG_FILE 2>&1
if [ $? -ne 0 ]; then
echo -e "${RED}Tests failed. Check $LOG_FILE for details.${NC}"
echo -e "${YELLOW}Please fix the issues before committing your changes.${NC}"
exit 1
fi
echo -e "${GREEN}Tests completed successfully${NC}"
TESTS_PASSED=true
else
echo -e "${YELLOW}No test script found. Skipping tests.${NC}"
fi
@ -61,4 +65,19 @@ fi
echo -e "${GREEN}All services are up and running!${NC}"
echo -e "To view logs: ${YELLOW}docker compose -f docker-compose.dev.yml logs -f${NC}"
echo -e "To stop: ${YELLOW}docker compose -f docker-compose.dev.yml down${NC}"
echo "Build and run completed at $(date)" >> $LOG_FILE
echo "Build and run completed at $(date)" >> $LOG_FILE
# Show Git workflow guidance if tests passed
if [ "$TESTS_PASSED" = true ]; then
echo -e "\n${BLUE}=== Ready to Commit and Push ===${NC}"
echo -e "${GREEN}All tests have passed! You can now commit and push your changes:${NC}"
echo -e "${YELLOW}git add .${NC}"
echo -e "${YELLOW}git commit -m \"Your descriptive commit message\"${NC}"
echo -e "${YELLOW}git push${NC}"
echo -e "\n${GREEN}Or use the convenient one-liner:${NC}"
echo -e "${YELLOW}git add . && git commit -m \"Your descriptive commit message\" && git push${NC}"
echo -e "\n${BLUE}Remember:${NC}"
echo -e "- Use descriptive commit messages"
echo -e "- Add 'HOTFIX:' prefix for emergency fixes"
echo -e "- Document significant changes in your commit message"
fi