-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cmd_template
30 lines (22 loc) · 1.06 KB
/
build.cmd_template
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
REM ### Usage 1: build.cmd Simply ZIP the design archive and move to /dist directory
REM ### Usage 2: build.cmd /upload Upload and stores the design ZIP via REST API (requires to configure REST_API_URL)
REM ### ----- CONFIGURATION ---
REM ### Copy REST API URL from dev menu in DesignForm - keep double quotes
set REST_API_URL="[url]"
REM ### Increase the DESIGN_BUILD variable with every significant new version
set CX_VERSION=1.3
set DESIGN_BUILD=8
set ZIP_PATH=C:\Program Files\7-Zip
set DESIGN_PATH=dist\unicorn-website-design-%CX_VERSION%-%DESIGN_BUILD%.zip
set ARGS=%1
REM ### ----- EXECUTION -------
REM ### ----- CREATE ZIP ------
del %DESIGN_PATH%
"%ZIP_PATH%\7z" a %DESIGN_PATH% -xr!dist -xr!node_modules -xr!.git -x!design-preview.png -x!*.cmd -x!*.cmd_template -x!.gitignore -x!package.json -x!package-lock.json
IF DEFINED ARGS (
IF "%ARGS%"=="/upload" GOTO upload
)
goto :eof
REM ### ----- UPLOAD ----------
:upload
curl -X PUT --data-binary @.\%DESIGN_PATH% -H "Content-Type:application/octet-stream" --trace-ascii dist/curl-debug.log %REST_API_URL%