Skip to content

Commit

Permalink
feat: select version parameter (#29)
Browse files Browse the repository at this point in the history
* ci: add testing for version parameter

* docs: Add description to provider

* fix: account for empty provider
  • Loading branch information
KyleTryon authored Apr 22, 2022
1 parent 9e65156 commit 266132e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
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

0 comments on commit 266132e

Please sign in to comment.