#!/bin/bash # CTO AI Delegation - Integration Automation Setup set -e echo "๐Ÿ”ง CTO AI Delegation - Setting up Integration Automation" echo "========================================================" # Gitea-exclusive platform (GitHub and GitLab banned at this organization) PLATFORM="gitea" echo "๐ŸŽฏ CTO Delegation Template - Gitea-Exclusive Integration" echo "๐Ÿ“‹ Setting up integration automation for Gitea (exclusive platform)" # Validate we're in a CTO delegation template directory if [ ! -f "docs/AGENT-LLM.MD" ]; then echo "โŒ Error: CTO delegation template not found!" echo "๐Ÿ“ Make sure you're in a directory with the CTO template" exit 1 fi # Check if INTEGRATION-WIP branch exists if ! git show-ref --quiet refs/heads/INTEGRATION-WIP; then echo "โŒ Error: INTEGRATION-WIP branch not found!" echo "๐Ÿ”ง Run the bootstrap process first from docs/AGENT-LLM.MD" exit 1 fi # Gitea-exclusive setup echo "๐Ÿ”ง Setting up Gitea Actions..." mkdir -p .gitea/workflows cp docs/workflows/gitea-auto-integrate.yml .gitea/workflows/auto-integrate.yml echo "โœ… Gitea Actions workflow created: .gitea/workflows/auto-integrate.yml" echo "" echo "๐Ÿ“ Next steps for Gitea:" echo " 1. Ensure Gitea Actions is enabled on your instance" echo " 2. Commit and push the workflow file" echo " 3. Verify runner availability for ubuntu-latest" echo " 4. Feature branches will auto-merge to INTEGRATION-WIP" echo " 5. Check Actions tab in Gitea for workflow execution" echo "" echo "๐ŸŽฏ Gitea-exclusive integration automation ready!" echo "" echo "๐ŸŽฏ Integration automation setup complete!" echo "๐Ÿ“‹ Feature branches will now automatically merge to INTEGRATION-WIP" echo "๐Ÿ” Monitor the INTEGRATION-WIP branch for continuous testing" echo "" echo "๐Ÿงช Test the setup:" echo " 1. Create a test feature branch" echo " 2. Make a commit and push" echo " 3. Check INTEGRATION-WIP for auto-merge" # Add integration instructions to AGENT-LLM.MD if not already present if ! grep -q "INTEGRATION AUTOMATION" docs/AGENT-LLM.MD; then echo "" >> docs/AGENT-LLM.MD echo "## INTEGRATION AUTOMATION" >> docs/AGENT-LLM.MD echo "**Automatic process - AI agents observe only:**" >> docs/AGENT-LLM.MD echo "- Feature branches automatically merge to INTEGRATION-WIP after push" >> docs/AGENT-LLM.MD echo "- Merge conflicts require manual CTO resolution" >> docs/AGENT-LLM.MD echo "- Monitor INTEGRATION-WIP branch for integration test results" >> docs/AGENT-LLM.MD echo "- Failed integrations create issues/notifications for CTO attention" >> docs/AGENT-LLM.MD echo "โœ… Updated docs/AGENT-LLM.MD with integration automation info" fi echo "" echo "๐Ÿš€ Ready for automated continuous integration!"