-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub-setup.sh
More file actions
executable file
·77 lines (61 loc) · 2.26 KB
/
Copy pathgithub-setup.sh
File metadata and controls
executable file
·77 lines (61 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
# GitHub Setup Script for Workie
# Run this script after creating the repository on GitHub
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${GREEN}🚀 GitHub Setup Script for Workie${NC}"
echo "============================================="
# Check if username is provided
if [ -z "$1" ]; then
echo -e "${RED}❌ Error: GitHub username is required${NC}"
echo "Usage: $0 <github-username>"
echo "Example: $0 johndoe"
exit 1
fi
USERNAME="$1"
REPO_URL="git@github.com:$USERNAME/workie.git"
echo -e "${YELLOW}📋 Pre-flight checks...${NC}"
# Check if we're in the right directory
if [ ! -f "go.mod" ] || [ ! -d ".git" ]; then
echo -e "${RED}❌ Error: This script must be run from the workie project root directory${NC}"
exit 1
fi
# Check if git is configured
if [ -z "$(git config user.name)" ] || [ -z "$(git config user.email)" ]; then
echo -e "${RED}❌ Error: Git is not configured. Please run:${NC}"
echo "git config --global user.name 'Your Name'"
echo "git config --global user.email 'your.email@example.com'"
exit 1
fi
echo -e "${GREEN}✅ Pre-flight checks passed${NC}"
# Check if remote already exists
if git remote get-url origin >/dev/null 2>&1; then
echo -e "${YELLOW}⚠️ Origin remote already exists. Removing it...${NC}"
git remote remove origin
fi
# Add GitHub remote
echo -e "${YELLOW}🔗 Adding GitHub remote: $REPO_URL${NC}"
git remote add origin "$REPO_URL"
# Verify remote was added
git remote -v
# Push main branch
echo -e "${YELLOW}📤 Pushing main branch to GitHub...${NC}"
git push -u origin main
# Push tags
echo -e "${YELLOW}🏷️ Pushing tags to GitHub...${NC}"
git push --tags
echo ""
echo -e "${GREEN}✅ GitHub setup completed successfully!${NC}"
echo ""
echo -e "${YELLOW}🎯 Next steps:${NC}"
echo "1. Visit: https://github.com/$USERNAME/workie"
echo "2. Add repository description: 'A flexible worker queue system for distributed task processing'"
echo "3. Add topics: 'go', 'queue', 'worker', 'distributed', 'task-processing', 'microservices'"
echo "4. Set repository website (if applicable)"
echo "5. Consider enabling GitHub Pages for documentation"
echo ""
echo -e "${GREEN}🎉 Your Workie project is now live on GitHub!${NC}"