-
Notifications
You must be signed in to change notification settings - Fork 1
/
depl.bat
65 lines (55 loc) · 1.32 KB
/
depl.bat
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
@ECHO OFF
SETLOCAL
REM Check for commit message argument
IF "%~1"=="" (
ECHO No commit message provided, using default.
SET "COMMIT_MSG=end of day auto-commit"
) ELSE (
SET "COMMIT_MSG=%~1"
)
REM Perform git operations
CALL :git_ops "%COMMIT_MSG%"
IF ERRORLEVEL 1 (
ECHO Git operations failed.
EXIT /B 1
)
REM Perform flutter and firebase operations
CALL :flutter_firebase_ops
IF ERRORLEVEL 1 (
ECHO Flutter and Firebase operations failed.
EXIT /B 1
)
CD /D "functions"
CALL :git_ops_functions "functions: %COMMIT_MSG%" "functions"
IF ERRORLEVEL 1 (
ECHO Git operations for 'functions' failed.
EXIT /B 1
)
ECHO Operations completed successfully.
EXIT /B 0
REM A subroutine to perform git operations
:git_ops
CALL git add .
IF ERRORLEVEL 1 EXIT /B 1
CALL git commit -m "%~1"
IF ERRORLEVEL 1 EXIT /B 1
CALL git push -u origin master
IF ERRORLEVEL 1 EXIT /B 1
CALL git push -u dorg master
IF ERRORLEVEL 1 EXIT /B 1
EXIT /B 0
REM A subroutine to perform flutter and firebase operations
:flutter_firebase_ops
CALL flutter build web
IF ERRORLEVEL 1 EXIT /B 1
CALL firebase deploy --only hosting
IF ERRORLEVEL 1 EXIT /B 1
EXIT /B 0
:git_ops_functions
CALL git add .
IF ERRORLEVEL 1 EXIT /B 1
CALL git commit -m "%~1"
IF ERRORLEVEL 1 EXIT /B 1
CALL git push -u origin master
IF ERRORLEVEL 1 EXIT /B 1
EXIT /B 0