Skip to content

Commit fdfdad5

Browse files
Release 1.0.91
1 parent c2ac2ba commit fdfdad5

File tree

3 files changed

+60
-60
lines changed

3 files changed

+60
-60
lines changed

Jenkinsfile-windows

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ pipeline {
4747
echo "The workspace is ${env.WORKSPACE}"
4848
script {
4949
echo 'Stage Build, Test, Deploy'
50+
bat "dir"
51+
// bat "del /s /q *"
52+
// bat "dir"
5053
def status = powershell(returnStatus: true, script: "cd")
51-
status = powershell(returnStatus: true, script: "(new-object net.webclient).DownloadFile('https://raw.githubusercontent.com/PredixDev/local-setup/master/setup-windows.bat','setup-windows.bat')")
54+
// status = powershell(returnStatus: true, script: "(new-object net.webclient).DownloadFile('https://raw.githubusercontent.com/PredixDev/local-setup/master/setup-windows.bat','setup-windows.bat')")
5255
if (status == 0) {
5356
echo "powershell1 success"
5457
bat "echo %cd%"
@@ -58,7 +61,7 @@ pipeline {
5861
echo "powershell2 success"
5962
}
6063
else {
61-
echo "powershell2 failed"
64+
echo "powershell2 failed status=${status}"
6265
error("powershell2 failed")
6366
}
6467
}

setup-windows.bat

Lines changed: 54 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@ IF NOT !errorlevel! EQU 0 (
8888
)
8989
ENDLOCAL & GOTO :eof
9090

91+
:NPM_INSTALL_GLOBAL
92+
SETLOCAL
93+
SET tool=%1
94+
SET cmd=%1
95+
IF NOT "%2"=="" (
96+
SET cmd=%2
97+
)
98+
where !cmd! >$null 2>&1
99+
IF NOT !errorlevel! EQU 0 (
100+
ECHO npm install -g %1
101+
npm install -g %1
102+
CALL :CHECK_FAIL
103+
) ELSE (
104+
ECHO %1 already installed
105+
ECHO.
106+
)
107+
ENDLOCAL & GOTO :eof
108+
91109
:DOWNLOAD_TO_FILE
92110
ECHO download to file
93111
ECHO %~1 %~2
@@ -106,11 +124,12 @@ GOTO :eof
106124
GOTO :eof
107125

108126
:CHECK_FAIL
109-
IF NOT !errorlevel! EQU 0 (
110-
ECHO FAILED !errorlevel!
111-
ECHO Any changes to the PATH will not take affect unless you reopen a new Admin command window, please open a new window now.
112-
exit /b !errorlevel!
113-
)
127+
ECHO CHECK_FAIL errorlevel: !errorlevel!
128+
IF NOT !errorlevel! EQU 0 (
129+
ECHO FAILED !errorlevel!
130+
ECHO Any changes to the PATH will not take affect unless you reopen a new Admin command window, please open a new window now.
131+
exit /b !errorlevel!
132+
)
114133
GOTO :EOF
115134

116135
:INSTALL_NOTHING
@@ -232,29 +251,29 @@ GOTO :eof
232251
GOTO :eof
233252

234253
:INSTALL_MOBILECLI
235-
ECHO.
236-
ECHO Installing mobilecli...
237-
where pm >$null 2>&1
238-
IF NOT !errorlevel! EQU 0 (
239-
ECHO Downloading installer
240-
CALL :CHOCO_INSTALL 7zip.commandline 7z
241-
REM get the url of the release file
242-
CALL :DOWNLOAD_TO_FILE https://api.github.com/repos/PredixDev/predix-mobile-cli/releases , mobile-output.tmp
243-
<mobile-output.tmp ( jq -r "[ .[] | select(.prerelease==false) ] | .[0].assets[] | select(.name | contains(\"win\")) | .browser_download_url" >mobile-output2.tmp )
244-
<mobile-output2.tmp (SET /p cli_url=)
245-
CALL :DOWNLOAD_BINARY_TO_FILE !cli_url! , pm.zip
246-
del /Q /S mobile-cli
247-
7z x "pm.zip" -o"mobile-cli"
248-
REM Just put in the chocolatey/bin directory, since we know that's on the PATH env var.
249-
copy mobile-cli\pm.exe %ALLUSERSPROFILE%\chocolatey\bin\
250-
ECHO Mobile CLI installed here: %ALLUSERSPROFILE%\chocolatey\bin\
251-
) ELSE (
252-
ECHO Mobile CLI already installed, pm is installed at...
253-
where pm
254-
ECHO Mobile CLI version is as follows, please check for updates at https://github.com/PredixDev/predix-mobile-cli
255-
)
256-
rem pm -v
257-
GOTO :eof
254+
ECHO.
255+
ECHO Installing mobilecli...
256+
where pm >$null 2>&1
257+
IF NOT !errorlevel! EQU 0 (
258+
ECHO Downloading installer
259+
CALL :CHOCO_INSTALL 7zip.commandline 7z
260+
REM get the url of the release file
261+
CALL :DOWNLOAD_TO_FILE https://api.github.com/repos/PredixDev/predix-mobile-cli/releases , mobile-output.tmp
262+
<mobile-output.tmp ( jq -r "[ .[] | select(.prerelease==false) ] | .[0].assets[] | select(.name | contains(\"win\")) | .browser_download_url" >mobile-output2.tmp )
263+
<mobile-output2.tmp (SET /p cli_url=)
264+
CALL :DOWNLOAD_BINARY_TO_FILE !cli_url! , pm.zip
265+
IF EXIST mobile-cli\ del /Q /S mobile-cli
266+
7z x "pm.zip" -o"mobile-cli"
267+
REM Just put in the chocolatey/bin directory, since we know that's on the PATH env var.
268+
copy mobile-cli\pm.exe %ALLUSERSPROFILE%\chocolatey\bin\
269+
ECHO Mobile CLI installed here: %ALLUSERSPROFILE%\chocolatey\bin\
270+
) ELSE (
271+
ECHO Mobile CLI already installed, pm is installed at...
272+
where pm
273+
ECHO Mobile CLI version is as follows, please check for updates at https://github.com/PredixDev/predix-mobile-cli
274+
)
275+
rem pm -v
276+
GOTO :eof
258277

259278

260279
:START
@@ -322,44 +341,22 @@ IF !install[nodejs]! EQU 1 (
322341
ECHO.
323342
ECHO Install Node.js
324343
CALL :CHOCO_INSTALL nodejs.install node
344+
node -v
325345
)
326346
CALL :RELOAD_ENV
327347
SET "PATH=%PATH%;%APPDATA%\npm"
328348
IF !install[nodejs]! EQU 1 (
349+
ECHO Install node tools
329350
ECHO "ensure npm global location (typically C:\Users\YourUserName\AppData\Roaming\npm) is in the path. If not, please add manually in System and reopen this Admin Command window."
330351
path
331352
ECHO.
332353
ECHO 'If you get a certificate error, it could mean your company network and/or proxy server is using self signed certificates. You can temporily use npm config set strict-ssl false to allow the download or also try npm config set cafile="C:\mycacert.pem"'
333354
ECHO.
334-
where bower >$null 2>&1
335-
IF NOT !errorlevel! EQU 0 (
336-
ECHO npm install -g bower
337-
npm install -g bower
338-
CALL :CHECK_FAIL
339-
)
340-
where grunt >$null 2>&1
341-
IF NOT !errorlevel! EQU 0 (
342-
ECHO npm install -g grunt
343-
npm install -g grunt-cli
344-
CALL :CHECK_FAIL
345-
)
346-
where gulp >$null 2>&1
347-
IF NOT !errorlevel! EQU 0 (
348-
ECHO npm install -g gulp
349-
path
350-
npm install -g gulp-cli
351-
CALL :CHECK_FAIL
352-
)
353-
where node-gyp >$null 2>&1
354-
IF NOT !errorlevel! EQU 0 (
355-
ECHO npm install -g node-gyp
356-
path
357-
npm install -g node-gyp
358-
CALL :CHECK_FAIL
359-
ECHO npm install -g --production windows-build-tools
360-
npm install --g --production windows-build-tools
361-
CALL :CHECK_FAIL
362-
)
355+
CALL :NPM_INSTALL_GLOBAL gulp-cli gulp
356+
CALL :NPM_INSTALL_GLOBAL grunt-cli grunt
357+
CALL :NPM_INSTALL_GLOBAL bower
358+
REM npm install -g node-gyp
359+
REM npm install --g --production windows-build-tools
363360
)
364361

365362
IF !install[python2]! EQU 1 (

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "local setup",
3-
"version": "1.0.90",
3+
"version": "1.0.91",
44
"private": true,
55
"dependencies": {},
66
"author": "rishabhtulsian"

0 commit comments

Comments
 (0)