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: select version parameter #29

Merged
merged 5 commits into from
Apr 22, 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
23 changes: 20 additions & 3 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,21 @@ filters: &filters
tags:
only: /.*/
jobs:
integration-test-1:
test-sls-install-versioned:
executor: serverless/default
environment:
SLS_DEBUG: "1"
steps:
- checkout
- serverless/setup:
version: 3.15.0
provider: ""
- run:
name: Check SLS version
command: |
serverless --version | grep 3.15.0

test-sls-deploy:
# Test within the default executor
# - install the aws cli
# - run serverless setup
Expand Down Expand Up @@ -41,9 +55,11 @@ workflows:
test-deploy:
jobs:
# Make sure to include "filters: *filters" in every test job you want to run as part of your deployment.
- integration-test-1:
- test-sls-deploy:
filters: *filters
context: CPE_ORBS_AWS
- test-sls-install-versioned:
filters: *filters
- orb-tools/pack:
filters: *filters
- orb-tools/publish:
Expand All @@ -53,7 +69,8 @@ workflows:
pub-type: production
requires:
- orb-tools/pack
- integration-test-1
- test-sls-deploy
- test-sls-install-versioned
context: orb-publisher
filters:
branches:
Expand Down
7 changes: 7 additions & 0 deletions src/commands/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ parameters:
provider:
type: enum
enum: ["", "AWS", "azure", "tencent", "google", "knative", "alibaba", "cloudflare", "fn", "kubeless", "openwhisk", "spotinist"]
description: (Optional) Select a cloud provider to receive additional helpful error messages during your initial configuration if a misconfiguration is detected.
default: "AWS"
version:
type: string
description: Specify the version of the Serverless Framework CLI to install. By default, the latest version will be used.
default: ""
steps:
- run:
name: Provider Check
Expand All @@ -14,4 +19,6 @@ steps:
command: <<include(scripts/provider-check.sh)>>
- run:
name: Install Serverless CLI
environment:
ORB_PARAM_SERVERLESS_VERSION: <<parameters.version>>
command: <<include(scripts/install.sh)>>
2 changes: 1 addition & 1 deletion src/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
curl -o- -L https://slss.io/install | bash
curl -o- -L https://slss.io/install | VERSION=$ORB_PARAM_SERVERLESS_VERSION bash
echo "export PATH=$HOME/.serverless/bin:$PATH" >> "$BASH_ENV"
# shellcheck disable=SC1090
source "$BASH_ENV"
Expand Down
3 changes: 3 additions & 0 deletions src/scripts/provider-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ openwhisk_Check () {
spotinist_Check () {
output_Provider_Selected "Spotinist"
}
other_Check () {
output_Provider_Selected "Other"
}
###
# Call provider based on parameter
###
Expand Down