-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Visual Studio Team Services Extension for CodePush | ||
Copyright (c) Microsoft Corporation | ||
All rights reserved. | ||
|
||
MIT License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
@ECHO OFF | ||
REM | ||
REM Copyright (c) Microsoft. All rights reserved. | ||
REM Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
REM | ||
ECHO vso-cordova-tasks upload | ||
ECHO Copyright Microsoft Corporation | ||
ECHO. | ||
ECHO This script will acquire and install some dependant node modules. Each package | ||
ECHO is licensed to you by its owner. Microsoft is not responsible for, nor does it | ||
ECHO grant any licenses to, third-party packages. Some packages may include | ||
ECHO dependencies which are governed by additional licenses. Follow the package | ||
ECHO source URL (http://github.com/Microsoft/vso-cordova-tasks) to determine any | ||
ECHO dependencies. | ||
ECHO. | ||
SET /p YN="Continue [Y/n]? " | ||
IF /I '%YN%'=='n' EXIT /B 1 | ||
ECHO. | ||
|
||
CALL npm --version 1>NUL 2>NUL | ||
IF NOT %ERRORLEVEL%==0 GOTO INSTALLFAILED | ||
|
||
CALL tfx version 1>NUL 2>NUL | ||
IF NOT %ERRORLEVEL%==0 GOTO TFXINSTALL | ||
|
||
:NPMINSTALL | ||
ECHO Installing dependencies... | ||
CALL npm install --only=prod | ||
IF NOT %ERRORLEVEL%==0 GOTO INSTALLFAILED | ||
|
||
:EXEC | ||
CALL node bin/tfxupload.js | ||
IF NOT %ERRORLEVEL%==0 GOTO UPLOADFAILED | ||
EXIT /B 0 | ||
|
||
:TFXINSTALL | ||
ECHO Installing tfx-cli... | ||
CALL npm install -g tfx-cli | ||
IF NOT %ERRORLEVEL%==0 GOTO INSTALLFAILED | ||
ECHO Log in to the VSO/TFS collection you wish to deploy the tasks. | ||
CALL tfx login --authType basic | ||
IF NOT %ERRORLEVEL%==0 GOTO LOGINFAILED | ||
GOTO NPMINSTALL | ||
|
||
:UPLOADFAILED | ||
ECHO Failed to upload! Ensure Node.js is installed and in your path and you are logged into a VSO/TFS collection where you have build administration privileges. | ||
EXIT /B %ERRORLEVEL% | ||
|
||
:INSTALLFAILED | ||
ECHO Failed to install npm packages. Ensure Node.js is installed and node and npm are in your path. | ||
EXIT /B %ERRORLEVEL% | ||
|
||
:LOGINFAILED | ||
ECHO Login failed. Type "tfx login" to log in and then re-run this script. | ||
EXIT /B %ERRORLEVEL% | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# | ||
# Copyright (c) Microsoft. All rights reserved. | ||
# Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
# | ||
|
||
echo "vso-cordova-tasks upload" | ||
echo "Copyright Microsoft Corporation" | ||
echo | ||
echo "This script will acquire and install some dependant node modules. Each package" | ||
echo "is licensed to you by its owner. Microsoft is not responsible for, nor does it" | ||
echo "grant any licenses to, third-party packages. Some packages may include" | ||
echo "dependencies which are governed by additional licenses. Follow the package" | ||
echo "source URL (http://github.com/Microsoft/vso-cordova-tasks) to determine any" | ||
echo "dependencies." | ||
echo | ||
read -p "Continue [Y/n]? " yn | ||
if [ -z "$yn" ]; then yn='y'; fi | ||
if [ $yn = 'n' ] || [ $yn = 'N' ] | ||
then | ||
exit 1 | ||
fi | ||
|
||
if ! type "npm" > /dev/null; then | ||
echo Could not find npm. Be sure node.js is installed and both node and npm are in your path. | ||
exit 1; | ||
fi | ||
|
||
if ! type "tfx" > /dev/null; then | ||
echo Installing tfx-cli... | ||
npm install -g tfx-cli | ||
if [ $? -ne 0 ] | ||
then | ||
echo "Failed to install tfx-cli." | ||
exit 1 | ||
fi | ||
echo Log in to the VSO/TFS collection you wish to deploy the tasks. | ||
tfx login --authType basic | ||
if [ $? -ne 0 ] | ||
then | ||
echo "Login failed. Type 'tfx login' to log in and then run this script again." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
echo Installing dependencies... | ||
npm install --only=prod | ||
if [ $? -ne 0 ] | ||
then | ||
echo "Failed to install dependencies." | ||
exit 1 | ||
fi | ||
|
||
node bin/tfxupload.js | ||
if [ $? -ne 0 ] | ||
then | ||
echo "Upload failed!" | ||
exit 1 | ||
fi |