Skip to content

Commit f73d7a7

Browse files
author
serverless-devs
committed
commit by Serverless devs docs 1-10-2024 2:8:20
1 parent 0da3761 commit f73d7a7

File tree

17 files changed

+592
-94
lines changed

17 files changed

+592
-94
lines changed

content/en/serverless-devs/cicd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- uses: actions/checkout@v2
3434
- uses: actions/setup-node@v2
3535
with:
36-
node-version: 12
36+
node-version: 16
3737
registry-url: https://registry.npmjs.org/
3838
- run: npm install
3939
- run: npm install -g @serverless-devs/s

content/en/serverless-devs/command/clean.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@ position: 3
55
category: 'Commands'
66
---
77
# Clean Command
8+
89
The `s clean` command is designated to clear the cache and associated functionalities within Serverless Devs. With this command, you're able to cleanse the environment, eliminate unused dependencies, and remove relevant cached data.
10+
911
- [Command Overview](#command-overview)
10-
- [Parameters](#parameters)
11-
- [Usage Examples](#usage-examples)
12+
- [Parameters](#parameters)
13+
- [Usage Examples](#usage-examples)
1214
- [Cautions](#cautions)
15+
1316
## Command Overview
17+
1418
To access help information, execute `s clean -h`:
19+
1520
```shell script
1621
$ s clean -h
1722
Usage: s clean [options]
@@ -30,39 +35,53 @@ Options:
3035
--component [componentName] Remove component (like: fc, fc@0.0.1)
3136
-h, --help Display help for command
3237
```
38+
3339
### Parameters
40+
3441
Navigate through the command's options with ease, each tailored for a specific aspect of the clean-up process:
3542
| Parameter | Abbreviation | Required | Description |
3643
|-----|-----|-----|-----|
3744
| all | | Optional | Initiates a comprehensive environment clean-up |
3845
| logs | | Optional | Targets log files for cleaning |
3946
| cache | | Optional | Specifies and removes a <dirName> within the cache |
4047
| component | | Optional | Deletes a particular component (e.g., fc, fc@0.0.1) |
48+
4149
### Usage Examples
50+
4251
To purge a specific component, employ the `--component` flag alongside the name of the component:
52+
4353
```shell script
4454
$ s clean --component fc api
4555
[2023-******][INFO][s_cli] Component [fc api] has been cleaned up successfully.
4656
```
57+
4758
For cache removal, utilize the `--cache` option as demonstrated below:
59+
4860
```shell script
4961
$ s clean --cache
5062
[2023-******][INFO][s_cli] Cache cleaned up successfully.
5163
```
64+
5265
Log file clean-up can be achieved through the `--logs` parameter:
66+
5367
```shell script
5468
$ s clean --logs
5569
[2023-******][INFO][s_cli] Logs cleaned up successfully.
5670
```
71+
5772
For an all-encompassing clean-up, the `--all` parameter is at your disposal:
73+
5874
```shell script
5975
$ s clean --all
6076
[2023-******][INFO][s_cli] Component cleaned up successfully.
6177
[2023-******][INFO][s_cli] Cache cleaned up successfully.
6278
[2023-******][INFO][s_cli] Logs cleaned up successfully.
6379
[2023-******][INFO][s_cli] The environment of Serverless Devs has been cleaned up successfully.
6480
```
81+
6582
## Cautions
83+
6684
Please note the following protocols when executing a component-specific clean-up:
85+
6786
1. The system will first assess if there are any corresponding components within the current Registry cache and proceed to clear them.
6887
2. Following that, the system will purge the ultimate Registry cache, the Github Registry, eradicating any components that match the criteria.

content/en/serverless-devs/command/cli.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,20 @@ position: 4
55
category: 'Commands'
66
---
77
# Cli Command
8+
89
The `cli` command provides a command line interface within Yamlized, allowing direct use of Serverless Devs components via the CLI without the dependence on Yaml files.
9-
- [Command Breakdown](#command-breakdown)
10+
11+
- [Command Overview](#command-overview)
1012
- [Common Usage Patterns](#common-usage-patterns)
11-
- [General Component Support](#general-component-support)
12-
- [Specific Component Support](#specific-component-support)
13+
- [General Component Support](#general-component-support)
14+
- [Specific Component Support](#specific-component-support)
15+
1316
> For insights into the differences between Yaml mode and Cli mode, as well as their respective use cases, please consult the [Yaml Mode vs. Cli Mode Comparison](./../yaml_and_cli.md) document.
14-
## Command Breakdown
17+
>
18+
## Command Overview
19+
1520
Executing `s cli -h` displays the relevant help information:
21+
1622
```shell script
1723
$ s cli -h
1824
Usage: s cli [options]
@@ -27,14 +33,20 @@ Options:
2733
-p, --props <jsonString> JSON string of props
2834
-h, --help Display help for command
2935
```
36+
3037
Typical usage involves:
38+
3139
```shell script
3240
s cli [component name, e.g., fc, fc api, etc.] [component method] -p/--props [Yaml property equivalent for the method (JSON string)] -a/--access [specify key info] [additional settings]
3341
```
42+
3443
## Common Usage Patterns
44+
3545
### General Component Support
46+
3647
In Cli mode, you can support components by using the `-p, --props [jsonString]` parameter.
3748
For instance, a Serverless Devs application might be described like so:
49+
3850
```yaml
3951
edition: 3.0.0
4052
access: "myaccess"
@@ -51,23 +63,32 @@ resources:
5163
hosts:
5264
- host: auto
5365
```
66+
5467
This setup's `website-starter` segment can normally be deployed with `s website-starter deploy`.
5568
However, to deploy via `cli` mode, you bypass the Yaml file and directly input complete parameter details on the command line:
69+
5670
```shell script
5771
s cli devsapp/website deploy -p "{\"bucket\":\"testbucket\",\"src\":{\"codeUri\":\"./\",\"publishDir\":\"./build\",\"index\":\"index.html\"},\"region\":\"cn-hangzhou\",\"hosts\":[{\"host\":\"auto\"}]}" -a myaccess
5872
```
73+
5974
### Specific Component Support
75+
6076
Serverless Devs offers several well-designed components that are optimized for Cli mode. For example, the `fc api` component is prioritized for command line usage, facilitating quick interactions with certain Aliyun Function Compute (FC) service interfaces, such as:
77+
6178
- Listing functions within a specified service and region:
79+
6280
```shell script
6381
s cli fc api listFunctions --service-name my-service --region cn-beijing -a myaccess
6482
```
83+
6584
- Updating function code via the command line:
85+
6686
```shell script
6787
s cli fc api updateFunction --region cn-hangzhou --serviceName fc-deploy-service --functionName http-trigger-function --code '{"zipFile":"./"}'
6888
```
89+
6990
Furthermore, several components that typically support Yaml mode may also offer an optimized pure command line interface for specific operations. An example is the `fc` component, which provides commands for resource synchronization:
91+
7092
```shell script
7193
s cli fc sync --region cn-shanghai --service-name myService --type config
7294
```
73-

content/en/serverless-devs/command/component.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ category: 'Command'
99

1010
`component` is used to get the details of installed components.
1111

12-
- [Command Parse](#Command-Parse)
13-
- [Parameter](#Parameter)
14-
- [Example](#Example)
12+
- [Command Overview](#command-overview)
13+
- [Parameter](#parameter)
14+
- [Example](#example)
1515

16-
## Command Parse
16+
## Command Overview
1717

1818
When we execute `s component -h`, we can get help information:
1919

0 commit comments

Comments
 (0)