forked from microsoft/BotFramework-WebChat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_cdn
More file actions
26 lines (21 loc) · 1.2 KB
/
Copy pathdeploy_cdn
File metadata and controls
26 lines (21 loc) · 1.2 KB
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
#!/bin/bash
# Install blobxfer
curl -L -o ~/blobxfer https://github.com/Azure/blobxfer/releases/download/1.7.1/blobxfer-1.7.1-linux-x86_64
chmod +x ~/blobxfer
PACKAGE_NAME=$(node -p require\(\'$TRAVIS_BUILD_DIR/packages/bundle/package.json\'\).name)
PACKAGE_VERSION=$(node -p require\(\'$TRAVIS_BUILD_DIR/packages/bundle/package.json\'\).version)
echo Will publish to CDN at $PACKAGE_NAME/$PACKAGE_VERSION/*
# Upload to based on version from package.json
~/blobxfer upload --local-path $TRAVIS_BUILD_DIR/packages/bundle/dist --remote-path $PACKAGE_NAME/$PACKAGE_VERSION --storage-account $CDN_BLOB_ACCOUNT --storage-account-key $CDN_BLOB_KEY
# If TRAVIS_TAG is present, it means this is going PRODUCTION
if [ -n "$TRAVIS_TAG" ]
then
# Upload to /latest/
~/blobxfer upload --local-path $TRAVIS_BUILD_DIR/packages/bundle/dist --remote-path $PACKAGE_NAME/latest --storage-account $CDN_BLOB_ACCOUNT --storage-account-key $CDN_BLOB_KEY
fi
# If on "master" branch, deploy to "master" tag too
if [ "$TRAVIS_BRANCH" = "master" ]
then
# Upload to /master/
~/blobxfer upload --local-path $TRAVIS_BUILD_DIR/packages/bundle/dist --remote-path $PACKAGE_NAME/master --storage-account $CDN_BLOB_ACCOUNT --storage-account-key $CDN_BLOB_KEY
fi