Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set download mirror location default to us #33

Merged
merged 4 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/commands/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ parameters:
type: string
description: Specify the version of the Serverless Framework CLI to install. By default, the latest version will be used.
default: ""
mirror:
type: enum
enum:
- us
- cn
default: us
description: Select the geo-location for the download mirror. By default the value will be `us`, do not change if on CircleCI Cloud. Switch to `cn` for the China hosted mirror.
steps:
- run:
name: Install Serverless CLI
environment:
ORB_PARAM_SERVERLESS_VERSION: <<parameters.version>>
ORB_PARAM_MIRROR: <<parameters.mirror>>
command: <<include(scripts/install.sh)>>
8 changes: 7 additions & 1 deletion src/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash
curl -o- -L https://slss.io/install | VERSION=$ORB_PARAM_SERVERLESS_VERSION bash
export SLS_SCRIPT_URL="https://sls-standalone-sv-1300963013.cos.na-siliconvalley.myqcloud.com/install.sh"
SLS_GEO_LOCATION=us
if [ "$ORB_PARAM_MIRROR" = "cn" ]; then
export SLS_SCRIPT_URL="https://sls-standalone-1300963013.cos.ap-shanghai.myqcloud.com/install.sh"
export SLS_GEO_LOCATION=cn
fi
curl -o- -L "$SLS_SCRIPT_URL" | VERSION=$ORB_PARAM_SERVERLESS_VERSION bash
# shellcheck disable=SC2016
echo 'export PATH=$HOME/.serverless/bin:$PATH' >> "$BASH_ENV"
# shellcheck disable=SC1090
Expand Down