-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit-git.sh
More file actions
executable file
·177 lines (154 loc) · 4.8 KB
/
init-git.sh
File metadata and controls
executable file
·177 lines (154 loc) · 4.8 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#!/bin/bash
# Git Repository Initialization Script for IBM OpenPages MCP Server
# This script helps you initialize and push your repository to GitHub
echo "=========================================="
echo "IBM OpenPages MCP Server - Git Setup"
echo "=========================================="
echo ""
# Check if git is installed
if ! command -v git &> /dev/null; then
echo "❌ Git is not installed. Please install Git first."
echo " Visit: https://git-scm.com/downloads"
exit 1
fi
echo "✓ Git is installed"
echo ""
# Check if already a git repository
if [ -d .git ]; then
echo "⚠️ This directory is already a git repository."
read -p "Do you want to continue? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
else
echo "Initializing git repository..."
git init
echo "✓ Git repository initialized"
fi
echo ""
echo "Checking for sensitive files..."
# Check if .env exists and warn
if [ -f .env ]; then
echo "⚠️ WARNING: .env file found!"
echo " This file contains sensitive credentials and should NOT be committed."
echo " It is already in .gitignore, but please verify."
fi
# Verify .gitignore exists
if [ ! -f .gitignore ]; then
echo "❌ .gitignore file not found!"
exit 1
fi
echo "✓ .gitignore file exists"
echo ""
# Show what will be committed
echo "Files to be committed:"
git add -n .
echo ""
read -p "Do you want to add all files? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
git add .
echo "✓ Files added to staging"
else
echo "Skipping file addition. You can manually add files with: git add <file>"
exit 0
fi
echo ""
echo "Creating initial commit..."
git commit -m "Initial commit: IBM OpenPages MCP Server with Watsonx and Langflow support
Features:
- MCP server with 18 tools for OpenPages API
- REST API wrapper for Watsonx Orchestrate integration
- Langflow integration support
- Comprehensive documentation
- Support for Claude Desktop, Watsonx, and Langflow"
echo "✓ Initial commit created"
echo ""
# Ask for GitHub username
read -p "Enter your GitHub username: " github_username
if [ -z "$github_username" ]; then
echo "❌ GitHub username is required"
exit 1
fi
# Ask for repository name
read -p "Enter repository name (default: mcp-openpages-server): " repo_name
repo_name=${repo_name:-mcp-openpages-server}
echo ""
echo "Repository will be created at:"
echo "https://github.com/$github_username/$repo_name"
echo ""
# Check if GitHub CLI is installed
if command -v gh &> /dev/null; then
echo "✓ GitHub CLI detected"
echo ""
read -p "Do you want to create the repository using GitHub CLI? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
read -p "Make repository public? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
gh repo create $repo_name --public --source=. --push
else
gh repo create $repo_name --private --source=. --push
fi
echo ""
echo "✓ Repository created and pushed!"
echo ""
echo "Your repository is available at:"
echo "https://github.com/$github_username/$repo_name"
exit 0
fi
fi
# Manual setup instructions
echo ""
echo "=========================================="
echo "Manual Setup Instructions"
echo "=========================================="
echo ""
echo "1. Create a new repository on GitHub:"
echo " https://github.com/new"
echo ""
echo "2. Repository name: $repo_name"
echo " Description: MCP Server for IBM OpenPages REST API with Watsonx and Langflow support"
echo " ⚠️ DO NOT initialize with README, .gitignore, or license"
echo ""
echo "3. After creating the repository, run these commands:"
echo ""
echo " git remote add origin https://github.com/$github_username/$repo_name.git"
echo " git branch -M main"
echo " git push -u origin main"
echo ""
echo "Or with SSH:"
echo ""
echo " git remote add origin git@github.com:$github_username/$repo_name.git"
echo " git branch -M main"
echo " git push -u origin main"
echo ""
echo "=========================================="
echo ""
read -p "Do you want to add the remote now? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
read -p "Use SSH (s) or HTTPS (h)? " -n 1 -r
echo
if [[ $REPLY =~ ^[Ss]$ ]]; then
git remote add origin git@github.com:$github_username/$repo_name.git
else
git remote add origin https://github.com/$github_username/$repo_name.git
fi
echo "✓ Remote added"
echo ""
echo "Now run: git push -u origin main"
fi
echo ""
echo "Setup complete! 🚀"
echo ""
echo "Next steps:"
echo "1. Push your code to GitHub"
echo "2. Add topics/tags to your repository"
echo "3. Update repository description"
echo "4. Share with the community!"
echo ""
echo "For detailed instructions, see GITHUB_SETUP.md"
# Made with Bob