-
Notifications
You must be signed in to change notification settings - Fork 21
/
upload.sh
executable file
·58 lines (53 loc) · 1.52 KB
/
upload.sh
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
56
57
58
#
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
echo "code-push-vsts-extension 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/code-push-vsts-extension) 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 VSTS/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