-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
huyikun.hyk
committed
Jan 17, 2024
1 parent
9430f29
commit 29035ff
Showing
4 changed files
with
75 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# setup-s-aliyun | ||
<p align="center"> | ||
<span><b><a href="./README.md">中文</a> | <a href="./README_en.md">English</a></b></span><br> | ||
</p> | ||
|
||
Setting up serverless-devs based on Aliyun Function Compute. | ||
|
||
## Usage | ||
```yaml | ||
steps: | ||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Serverless-devs | ||
uses: actions/setup-s-aliyun@v1 | ||
with: | ||
account_id: ${{ secrets.ACCOUNT_ID }} | ||
access_key_id: ${{ secrets.ACCESS_KEYID }} | ||
access_key_secret: ${{ secrets.ACCESS_KEYSECRET }} | ||
access: default | ||
version: v3.0.0 | ||
``` | ||
## Params | ||
| Property | Description | Type | Default | | ||
| ----- | -------- | ---- | ---| | ||
| account_id | required,Aliyun account ID | string |-| | ||
| access_key_id | required,Aliyun AK | string | - | | ||
| access_key_secret | required,Aliyun SK | string | - | | ||
| access | aceess alias | string | default | | ||
| version | setup version | v3.0.0 | v3.0.0 | | ||
More details about access config to [Serverless-devs docs](https://docs.serverless-devs.com/serverless-devs/default_provider_config#%E9%98%BF%E9%87%8C%E4%BA%91%E5%AF%86%E9%92%A5%E8%8E%B7%E5%8F%96). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
set -e # 报错后不继续执行 | ||
echo 'Serverless-devs installing.' | ||
curl https://images.devsapp.cn/bin/s/v3.0.0 --output /usr/local/bin/s | ||
chmod 777 /usr/local/bin/s | ||
echo '################################################' | ||
s config add --AccountID $1 --AccessKeyID $2 --AccessKeySecret $3 -a $4 -f | ||
echo '################################################' | ||
echo 'Serverless-devs has been installed successfully.' | ||
echo 'The access has been configured automatically, use "s config get" to check.' | ||
version=$5 | ||
valid_version=( | ||
v3.0.0 | ||
) | ||
if [[ "${valid_version[@]}" =~ "${version}" ]]; then | ||
echo 'Serverless-devs installing.' | ||
echo "https://images.devsapp.cn/bin/s/${version}" | ||
curl "https://images.devsapp.cn/bin/s/${version}" --output /usr/local/bin/s | ||
chmod 777 /usr/local/bin/s | ||
echo '################################################' | ||
s config add --AccountID $1 --AccessKeyID $2 --AccessKeySecret $3 -a $4 -f | ||
echo '################################################' | ||
echo 'Serverless-devs has been installed successfully.' | ||
echo 'The access has been configured automatically, use "s config get" to check.' | ||
else | ||
echo $version "is not valid, please choose correct version." | ||
fi |