-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-github-pages.bat
More file actions
165 lines (141 loc) Β· 5.24 KB
/
Copy pathdeploy-github-pages.bat
File metadata and controls
165 lines (141 loc) Β· 5.24 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
@echo off
REM Requirements Tracker - GitHub Pages Deployment Script (Windows)
REM Copyright (C) 2024 DRYTRIX
REM
REM This program is free software: you can redistribute it and/or modify
REM it under the terms of the GNU General Public License as published by
REM the Free Software Foundation, either version 3 of the License, or
REM (at your option) any later version.
REM
REM This program is distributed in the hope that it will be useful,
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
REM GNU General Public License for more details.
REM
REM You should have received a copy of the GNU General Public License
REM along with this program. If not, see <https://www.gnu.org/licenses/>.
echo π Requirements Tracker - GitHub Pages Deployment Script
echo ========================================================
REM Check if we're in the right directory
if not exist "app.py" (
echo β Error: This script must be run from the RequirementsTracker directory
pause
exit /b 1
)
if not exist "index.html" (
echo β Error: index.html not found. This script must be run from the RequirementsTracker directory
pause
exit /b 1
)
REM Check if git is available
git --version >nul 2>&1
if errorlevel 1 (
echo β Error: Git is not installed or not in PATH
pause
exit /b 1
)
REM Check if we're in a git repository
if not exist ".git" (
echo β Error: This is not a git repository
pause
exit /b 1
)
echo π Checking repository status...
REM Get current branch
for /f "tokens=*" %%i in ('git branch --show-current 2^>nul') do set CURRENT_BRANCH=%%i
if "%CURRENT_BRANCH%"=="" (
echo β Error: Could not determine current branch
pause
exit /b 1
)
echo Current branch: %CURRENT_BRANCH%
REM Get remote URL
for /f "tokens=*" %%i in ('git remote get-url origin 2^>nul') do set REMOTE_URL=%%i
echo Remote: %REMOTE_URL%
REM Check if remote is accessible
git ls-remote --exit-code origin >nul 2>&1
if errorlevel 1 (
echo β Error: Cannot access remote repository
echo Please check your internet connection and repository URL
pause
exit /b 1
)
echo β
Repository status OK
REM Check if required files exist
echo π Checking required files...
set MISSING_FILES=
if not exist "index.html" set MISSING_FILES=!MISSING_FILES! index.html
if not exist "LICENSE" set MISSING_FILES=!MISSING_FILES! LICENSE
if not exist "README.md" set MISSING_FILES=!MISSING_FILES! README.md
if not exist ".nojekyll" set MISSING_FILES=!MISSING_FILES! .nojekyll
if not exist ".github\workflows\deploy.yml" set MISSING_FILES=!MISSING_FILES! .github\workflows\deploy.yml
if not "%MISSING_FILES%"=="" (
echo β Error: Missing required files: %MISSING_FILES%
pause
exit /b 1
)
echo β
All required files present
REM Check if screenshots exist
echo πΌοΈ Checking screenshots...
if not exist "assets\screenshots" (
echo β Error: Screenshots directory not found: assets\screenshots
pause
exit /b 1
)
set MISSING_SCREENSHOTS=
if not exist "assets\screenshots\dashboard.png" set MISSING_SCREENSHOTS=!MISSING_SCREENSHOTS! dashboard.png
if not exist "assets\screenshots\projects.png" set MISSING_SCREENSHOTS=!MISSING_SCREENSHOTS! projects.png
if not exist "assets\screenshots\New Requirement.png" set MISSING_SCREENSHOTS=!MISSING_SCREENSHOTS! "New Requirement.png"
if not exist "assets\screenshots\Analytics.png" set MISSING_SCREENSHOTS=!MISSING_SCREENSHOTS! Analytics.png
if not exist "assets\screenshots\admin.png" set MISSING_SCREENSHOTS=!MISSING_SCREENSHOTS! admin.png
if not "%MISSING_SCREENSHOTS%"=="" (
echo β οΈ Warning: Missing screenshots: %MISSING_SCREENSHOTS%
set /p CONTINUE=" Continue anyway? (y/N): "
if /i not "%CONTINUE%"=="y" (
echo β Deployment cancelled
pause
exit /b 1
)
) else (
echo β
All screenshots present
)
REM Add all changes
echo π Adding changes to git...
git add .
REM Check if there are changes to commit
git status --porcelain >nul 2>&1
if errorlevel 1 (
echo βΉοΈ No changes to commit
) else (
echo πΎ Committing changes...
git commit -m "Add GPL 3 license, update README with screenshots, and create GitHub Pages site
- Add GNU General Public License v3.0
- Update README.md with screenshots and improved documentation
- Create static GitHub Pages site (index.html)
- Add GitHub Actions workflow for automatic deployment
- Add .nojekyll file for custom static site
- Update license headers in main application files
- Create deployment documentation and scripts"
)
REM Push to GitHub
echo π Pushing to GitHub...
git push origin main
echo.
echo β
Deployment initiated successfully!
echo.
echo π Next steps:
echo 1. Go to your repository on GitHub: https://github.com/DRYTRIX/RequirementsTracker
echo 2. Click on 'Settings' tab
echo 3. Scroll down to 'Pages' section
echo 4. Under 'Source', select 'Deploy from a branch'
echo 5. Choose 'gh-pages' branch
echo 6. Click 'Save'
echo.
echo 7. Go to 'Actions' tab to monitor deployment progress
echo 8. Once complete, your site will be available at:
echo https://drytrix.github.io/RequirementsTracker/
echo.
echo π For more information, see: setup-github-pages.md
echo.
echo π Happy coding!
pause