-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsynchro_gh_pages.cmd
More file actions
59 lines (39 loc) · 1.3 KB
/
synchro_gh_pages.cmd
File metadata and controls
59 lines (39 loc) · 1.3 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
SET SOURCE_FOLDER=target\staging
SET TARGET_FOLDER=target\gh-pages_branch
SET TARGET_FOLDER2=target\gh-pages_branch2
IF EXIST %SOURCE_FOLDER% GOTO :staging_exists
echo The site must have been staged before
goto :Error
:staging_exists
RMDIR %TARGET_FOLDER% /S /Q
IF ERRORLEVEL 1 GOTO :Error
MKDIR %TARGET_FOLDER%
IF ERRORLEVEL 1 GOTO :Error
REM Let's clone the existing gh_pages
git clone https://github.com/graphql-java-generator/graphql-maven-plugin-project --branch gh-pages --single-branch %TARGET_FOLDER%
IF ERRORLEVEL 1 GOTO :Error
REM Let's create a folder the compile the ".git" sub-folder, and the staged site.
DEL %TARGET_FOLDER2% /F /S /Q
IF ERRORLEVEL 1 GOTO :Error
MKDIR %TARGET_FOLDER2%
IF ERRORLEVEL 1 GOTO :Error
MKDIR %TARGET_FOLDER2%\.git
IF ERRORLEVEL 1 GOTO :Error
XCOPY %TARGET_FOLDER%\.git\*.* %TARGET_FOLDER2%\.git /E /Q /K
IF ERRORLEVEL 1 GOTO :Error
XCOPY %SOURCE_FOLDER%\*.* %TARGET_FOLDER2% /E /Q /K
IF ERRORLEVEL 1 GOTO :Error
REM CAUTION: DIRECTORY CHANGE
cd %TARGET_FOLDER2%
git add *
IF ERRORLEVEL 1 GOTO :Error
git commit -m "Checking new site in"
IF ERRORLEVEL 1 GOTO :Error
git push
IF ERRORLEVEL 1 GOTO :Error
REM Let's go back in the previous directory
cd ..\..
goto :ThEnd
:Error
ECHO An error occured...
:TheEnd