-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.bat
57 lines (46 loc) · 1.11 KB
/
deploy.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
@echo off
SET MY_IONIC_ENV=%1
IF NOT DEFINED MY_IONIC_ENV (
echo HELP
echo deploy [env]
GOTO :end
)
echo deploy mode is %MY_IONIC_ENV%
GOTO :build
:build
echo start buildind project
call ionic build --%MY_IONIC_ENV%
echo project built
GOTO :use
:use
echo define used firebase project
call firebase use %MY_IONIC_ENV%
echo %MY_IONIC_ENV% defined as used firebase project
GOTO :functions
:functions
echo define functions'variables
set PROPERTIES=.\functions\conf\functions
if not "%MY_IONIC_ENV%" == "dev" (
set PROPERTIES=%PROPERTIES%.%MY_IONIC_ENV%
)
set PROPERTIES=%PROPERTIES%.properties
echo %PROPERTIES% will be used as property file for functions
set command=firebase functions:config:set
for /f "tokens=*" %%a in (%PROPERTIES%) DO call :concat %%a
call %command%
echo functions'variables defined
GOTO :deploy
:deploy
echo deploy firebase project
call firebase deploy
echo firebase project deployed
GOTO :use_default
:use_default
echo set back used firebase project to default
call firebase use default
echo used firebase project set back to default
GOTO :end
:concat
set command=%command% %*
:end
SET MY_IONIC_ENV=