-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-github.bat
More file actions
71 lines (61 loc) · 1.89 KB
/
setup-github.bat
File metadata and controls
71 lines (61 loc) · 1.89 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
@echo off
REM GitHub Setup Script for ops-automation-engine (Windows)
REM This script automates the GitHub repository setup
setlocal enabledelayedexpansion
echo ================================
echo GitHub Setup for ops-automation-engine
echo ================================
echo.
REM Check if git is available
git --version >nul 2>&1
if %errorlevel% neq 0 (
echo Error: Git is not installed. Please install Git first.
exit /b 1
)
REM Get GitHub username
set /p GITHUB_USERNAME="Enter your GitHub username: "
set /p REPO_NAME="Enter repository name (default: ops-automation-engine): "
if "!REPO_NAME!"=="" (
set REPO_NAME=ops-automation-engine
)
set REPO_URL=https://github.com/!GITHUB_USERNAME!/!REPO_NAME!.git
echo.
echo Repository URL: !REPO_URL!
echo.
REM Check if remote already exists
git remote get-url origin >nul 2>&1
if %errorlevel% equ 0 (
echo Note: Remote 'origin' already configured as:
git remote get-url origin
set /p UPDATE_REMOTE="Do you want to update it? (y/n): "
if "!UPDATE_REMOTE!"=="y" (
git remote remove origin
git remote add origin !REPO_URL!
echo Remote updated
)
) else (
git remote add origin !REPO_URL!
echo Remote added
)
REM Push to main
echo.
echo Pushing code to GitHub main branch...
git push -u origin main
echo Code pushed to main branch
echo.
echo ================================
echo Next: Add Secrets to GitHub
echo ================================
echo.
echo 1. Go to: https://github.com/!GITHUB_USERNAME!/!REPO_NAME!/settings/secrets/actions
echo.
echo 2. Create secret: DOCKER_USERNAME
echo Value: Your Docker Hub username
echo.
echo 3. Create secret: DOCKER_PASSWORD
echo Value: Your Docker Hub Personal Access Token
echo (Get it at: https://hub.docker.com/settings/security)
echo.
echo 4. After adding secrets, watch the build at:
echo https://github.com/!GITHUB_USERNAME!/!REPO_NAME!/actions
echo.