From c11c39328cca5c94463d1d745eb0f6a5e194f107 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Thu, 24 Mar 2016 10:53:42 -0700 Subject: [PATCH 1/7] win,build: add creation of zip and 7z package Add a step in vcbuild.bat to create a minimal package including node and npm that can be used as an alternative to the MSI. Compress the node.pdb file as zip and 7z. All files are uploaded as part of build-release. Fixes: https://github.com/nodejs/build/issues/299 Fixes: https://github.com/nodejs/node/issues/5696 --- vcbuild.bat | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/vcbuild.bat b/vcbuild.bat index 259e0d4d5d311d..5171bd00126b30 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -21,6 +21,7 @@ set nobuild= set nosign= set nosnapshot= set test_args= +set package= set msi= set upload= set licensertf= @@ -67,6 +68,7 @@ if /i "%1"=="test-all" set test_args=%test_args% sequential parallel messag if /i "%1"=="test-known-issues" set test_args=%test_args% known_issues&goto arg-ok if /i "%1"=="jslint" set jslint=1&goto arg-ok if /i "%1"=="jslint-ci" set jslint_ci=1&goto arg-ok +if /i "%1"=="package" set package=1&goto arg-ok if /i "%1"=="msi" set msi=1&set licensertf=1&set download_arg="--download=all"&set i18n_arg=small-icu&goto arg-ok if /i "%1"=="build-release" set build_release=1&goto arg-ok if /i "%1"=="upload" set upload=1&goto arg-ok @@ -89,6 +91,7 @@ goto next-arg if defined build_release ( set config=Release + set package=1 set msi=1 set licensertf=1 set download_arg="--download=all" @@ -210,11 +213,53 @@ if errorlevel 1 echo Failed to sign exe&goto exit :licensertf @rem Skip license.rtf generation if not requested. -if not defined licensertf goto msi +if not defined licensertf goto package %config%\node tools\license2rtf.js < LICENSE > %config%\license.rtf if errorlevel 1 echo Failed to generate license.rtf&goto exit +:package +if not defined package goto msi +echo Creating package... +cd Release +mkdir node-v%FULLVERSION%-win-%target_arch% > nul 2> nul +mkdir node-v%FULLVERSION%-win-%target_arch%\node_modules > nul 2>nul + +copy /Y node.exe node-v%FULLVERSION%-win-%target_arch%\ > nul +if errorlevel 1 echo Cannot copy node.exe && goto package_error +robocopy /e ..\deps\npm node-v%FULLVERSION%-win-%target_arch%\node_modules\npm > nul +if errorlevel 8 echo Cannot copy npm package && goto package_error +copy /Y ..\deps\npm\bin\npm node-v%FULLVERSION%-win-%target_arch%\ > nul +if errorlevel 1 echo Cannot copy npm && goto package_error +copy /Y ..\deps\npm\bin\npm.cmd node-v%FULLVERSION%-win-%target_arch%\ > nul +if errorlevel 1 echo Cannot copy npm.cmd && goto package_error + +echo Creating node-v%FULLVERSION%-win-%target_arch%.7z +del node-v%FULLVERSION%-win-%target_arch%.7z > nul 2> nul +7z a -r -mx9 -t7z node-v%FULLVERSION%-win-%target_arch%.7z node-v%FULLVERSION%-win-%target_arch% > nul +if errorlevel 1 echo Cannot create node-v%FULLVERSION%-win-%target_arch%.7z && goto package_error + +echo Creating node-v%FULLVERSION%-win-%target_arch%.zip +del node-v%FULLVERSION%-win-%target_arch%.zip > nul 2> nul +7z a -r -mx9 -tzip node-v%FULLVERSION%-win-%target_arch%.zip node-v%FULLVERSION%-win-%target_arch% > nul +if errorlevel 1 echo Cannot create node-v%FULLVERSION%-win-%target_arch%.zip && goto package_error + +echo Creating node_pdb.7z +del node_pdb.7z > nul 2> nul +7z a -mx9 -t7z node_pdb.7z node.pdb > nul + +echo Creating node_pdb.zip +del node_pdb.zip > nul 2> nul +7z a -mx9 -tzip node_pdb.zip node.pdb > nul + +cd %~dp0 +echo Package created! + +goto package_done +:package_error +exit /b 1 +:package_done + :msi @rem Skip msi generation if not requested if not defined msi goto run @@ -240,6 +285,10 @@ if not defined STAGINGSERVER set STAGINGSERVER=node-www ssh -F %SSHCONFIG% %STAGINGSERVER% "mkdir -p nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%" scp -F %SSHCONFIG% Release\node.exe %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node.exe scp -F %SSHCONFIG% Release\node.lib %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node.lib +scp -F %SSHCONFIG% Release\node_pdb.zip %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node_pdb.zip +scp -F %SSHCONFIG% Release\node_pdb.7z %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node_pdb.7z +scp -F %SSHCONFIG% Release\node-v%FULLVERSION%-win-%target_arch%.7z:%STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node-v%FULLVERSION%-win-%target_arch%.7z +scp -F %SSHCONFIG% Release\node-v%FULLVERSION%-win-%target_arch%.zip:%STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node-v%FULLVERSION%-win-%target_arch%.zip scp -F %SSHCONFIG% node-v%FULLVERSION%-%target_arch%.msi %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/ ssh -F %SSHCONFIG% %STAGINGSERVER% "touch nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.msi.done nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%.done && chmod -R ug=rw-x+X,o=r+X nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.msi* nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%*" From 94ea7d4595b23a8eaa34febefc3acd59f12c0b39 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Tue, 5 Apr 2016 07:56:19 -0700 Subject: [PATCH 2/7] add LICENSE, CHANGELOG and README to package --- vcbuild.bat | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vcbuild.bat b/vcbuild.bat index 5171bd00126b30..ad3e139d7cbb12 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -227,6 +227,12 @@ mkdir node-v%FULLVERSION%-win-%target_arch%\node_modules > nul 2>nul copy /Y node.exe node-v%FULLVERSION%-win-%target_arch%\ > nul if errorlevel 1 echo Cannot copy node.exe && goto package_error +copy /Y ..\LICENSE node-v%FULLVERSION%-win-%target_arch%\ > nul +if errorlevel 1 echo Cannot copy LICENSE && goto package_error +copy /Y ..\README.md node-v%FULLVERSION%-win-%target_arch%\ > nul +if errorlevel 1 echo Cannot copy README.md && goto package_error +copy /Y ..\CHANGELOG.md node-v%FULLVERSION%-win-%target_arch%\ > nul +if errorlevel 1 echo Cannot copy CHANGELOG.md && goto package_error robocopy /e ..\deps\npm node-v%FULLVERSION%-win-%target_arch%\node_modules\npm > nul if errorlevel 8 echo Cannot copy npm package && goto package_error copy /Y ..\deps\npm\bin\npm node-v%FULLVERSION%-win-%target_arch%\ > nul @@ -252,11 +258,11 @@ echo Creating node_pdb.zip del node_pdb.zip > nul 2> nul 7z a -mx9 -tzip node_pdb.zip node.pdb > nul -cd %~dp0 +cd .. echo Package created! - goto package_done :package_error +cd .. exit /b 1 :package_done From 60e7b00c2b57ae379aac7d394bbcdd5821c0095d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Mon, 11 Apr 2016 14:22:58 +0100 Subject: [PATCH 3/7] fixup: replace colon --- vcbuild.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcbuild.bat b/vcbuild.bat index ad3e139d7cbb12..c86325e95db3dc 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -293,8 +293,8 @@ scp -F %SSHCONFIG% Release\node.exe %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLV scp -F %SSHCONFIG% Release\node.lib %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node.lib scp -F %SSHCONFIG% Release\node_pdb.zip %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node_pdb.zip scp -F %SSHCONFIG% Release\node_pdb.7z %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node_pdb.7z -scp -F %SSHCONFIG% Release\node-v%FULLVERSION%-win-%target_arch%.7z:%STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node-v%FULLVERSION%-win-%target_arch%.7z -scp -F %SSHCONFIG% Release\node-v%FULLVERSION%-win-%target_arch%.zip:%STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node-v%FULLVERSION%-win-%target_arch%.zip +scp -F %SSHCONFIG% Release\node-v%FULLVERSION%-win-%target_arch%.7z %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node-v%FULLVERSION%-win-%target_arch%.7z +scp -F %SSHCONFIG% Release\node-v%FULLVERSION%-win-%target_arch%.zip %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node-v%FULLVERSION%-win-%target_arch%.zip scp -F %SSHCONFIG% node-v%FULLVERSION%-%target_arch%.msi %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/ ssh -F %SSHCONFIG% %STAGINGSERVER% "touch nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.msi.done nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%.done && chmod -R ug=rw-x+X,o=r+X nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.msi* nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%*" From 5a08270d843fbf98dd021c810dc4a1fabf26f3a1 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Tue, 12 Apr 2016 00:49:11 -0700 Subject: [PATCH 4/7] move archives to parent directories --- vcbuild.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcbuild.bat b/vcbuild.bat index c86325e95db3dc..a91a355d28855f 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -293,8 +293,8 @@ scp -F %SSHCONFIG% Release\node.exe %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLV scp -F %SSHCONFIG% Release\node.lib %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node.lib scp -F %SSHCONFIG% Release\node_pdb.zip %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node_pdb.zip scp -F %SSHCONFIG% Release\node_pdb.7z %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node_pdb.7z -scp -F %SSHCONFIG% Release\node-v%FULLVERSION%-win-%target_arch%.7z %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node-v%FULLVERSION%-win-%target_arch%.7z -scp -F %SSHCONFIG% Release\node-v%FULLVERSION%-win-%target_arch%.zip %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%/node-v%FULLVERSION%-win-%target_arch%.zip +scp -F %SSHCONFIG% Release\node-v%FULLVERSION%-win-%target_arch%.7z %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-win-%target_arch%.7z +scp -F %SSHCONFIG% Release\node-v%FULLVERSION%-win-%target_arch%.zip %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-win-%target_arch%.zip scp -F %SSHCONFIG% node-v%FULLVERSION%-%target_arch%.msi %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/ ssh -F %SSHCONFIG% %STAGINGSERVER% "touch nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.msi.done nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%.done && chmod -R ug=rw-x+X,o=r+X nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.msi* nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%*" From 7018770926550c25ac192ceb715143df8816a0e2 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Tue, 12 Apr 2016 09:36:37 -0700 Subject: [PATCH 5/7] Set proper privileges for uploaded packages --- vcbuild.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcbuild.bat b/vcbuild.bat index a91a355d28855f..d9a1846e59f0ad 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -296,7 +296,7 @@ scp -F %SSHCONFIG% Release\node_pdb.7z %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FU scp -F %SSHCONFIG% Release\node-v%FULLVERSION%-win-%target_arch%.7z %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-win-%target_arch%.7z scp -F %SSHCONFIG% Release\node-v%FULLVERSION%-win-%target_arch%.zip %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-win-%target_arch%.zip scp -F %SSHCONFIG% node-v%FULLVERSION%-%target_arch%.msi %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/ -ssh -F %SSHCONFIG% %STAGINGSERVER% "touch nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.msi.done nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%.done && chmod -R ug=rw-x+X,o=r+X nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.msi* nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%*" +ssh -F %SSHCONFIG% %STAGINGSERVER% "touch nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.msi.done nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%.done && chmod -R ug=rw-x+X,o=r+X nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.* nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%*" :run @rem Run tests if requested. From 36b525a78119a1fc3af9a6934762b4cee0f78a5c Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Wed, 13 Apr 2016 05:00:52 -0700 Subject: [PATCH 6/7] Add .done files for zip packages --- vcbuild.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcbuild.bat b/vcbuild.bat index d9a1846e59f0ad..ec113249ea741d 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -296,7 +296,7 @@ scp -F %SSHCONFIG% Release\node_pdb.7z %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FU scp -F %SSHCONFIG% Release\node-v%FULLVERSION%-win-%target_arch%.7z %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-win-%target_arch%.7z scp -F %SSHCONFIG% Release\node-v%FULLVERSION%-win-%target_arch%.zip %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-win-%target_arch%.zip scp -F %SSHCONFIG% node-v%FULLVERSION%-%target_arch%.msi %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/ -ssh -F %SSHCONFIG% %STAGINGSERVER% "touch nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.msi.done nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%.done && chmod -R ug=rw-x+X,o=r+X nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.* nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%*" +ssh -F %SSHCONFIG% %STAGINGSERVER% "touch nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.msi.done nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.zip.done nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.7z.done nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%.done && chmod -R ug=rw-x+X,o=r+X nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.* nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%*" :run @rem Run tests if requested. From 8b733b76c753513ff87ed841e2bef69b12fe0460 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Mon, 16 May 2016 12:57:23 +0200 Subject: [PATCH 7/7] Fix .done filenames --- vcbuild.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcbuild.bat b/vcbuild.bat index ec113249ea741d..ee5b4c8a17df08 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -296,7 +296,7 @@ scp -F %SSHCONFIG% Release\node_pdb.7z %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FU scp -F %SSHCONFIG% Release\node-v%FULLVERSION%-win-%target_arch%.7z %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-win-%target_arch%.7z scp -F %SSHCONFIG% Release\node-v%FULLVERSION%-win-%target_arch%.zip %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-win-%target_arch%.zip scp -F %SSHCONFIG% node-v%FULLVERSION%-%target_arch%.msi %STAGINGSERVER%:nodejs/%DISTTYPEDIR%/v%FULLVERSION%/ -ssh -F %SSHCONFIG% %STAGINGSERVER% "touch nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.msi.done nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.zip.done nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.7z.done nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%.done && chmod -R ug=rw-x+X,o=r+X nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.* nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%*" +ssh -F %SSHCONFIG% %STAGINGSERVER% "touch nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.msi.done nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-win-%target_arch%.zip.done nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-win-%target_arch%.7z.done nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%.done && chmod -R ug=rw-x+X,o=r+X nodejs/%DISTTYPEDIR%/v%FULLVERSION%/node-v%FULLVERSION%-%target_arch%.* nodejs/%DISTTYPEDIR%/v%FULLVERSION%/win-%target_arch%*" :run @rem Run tests if requested.