Update Graphical Pipeline Docs

Signed-off-by: Felixnoo <felixliu@kubesphere.io>
This commit is contained in:
Felixnoo 2021-12-10 11:04:21 +08:00
parent 927e8f8d84
commit 7eb682b5ea
6 changed files with 26 additions and 12 deletions

View File

@ -292,12 +292,21 @@ This stage uses SonarQube to test your code. You can skip this stage if you do n
{{</ notice >}}
3. Click **Add Step** under the **Deploy to Dev** stage again. Select **kubernetesDeploy** from the list and fill in the following fields in the displayed dialog box. Click **OK** to save it.
3. Click **Add Step** under the **Deploy to Dev** stage again. Select **container** from the list, name it `maven`, and click **OK**.
- **Kubeconfig**: Select the Kubeconfig you created, such as `demo-kubeconfig`.
- **Configuration File Path**: Enter `deploy/no-branch-dev/**`, which is the relative path of the Kubernetes resource [YAML](https://github.com/kubesphere/devops-maven-sample/tree/sonarqube/deploy/no-branch-dev) file in the code repository.
3. Click **Add Nesting Steps** in the `maven` container step. Select **withCredentials** from the list, fill in the following fields in the displayed dialog box, and click **OK**.
![kubernetesDeploy](/images/docs/devops-user-guide/using-devops/create-a-pipeline-using-graphical-editing-panels/kubernetesDeploy.png)
- **Credential Name**: Select the kubeconfig credential you created, such as `demo-kubeconfig`.
- **Kubeconfig Variable**: Enter `KUBECONFIG_CONTENT`.
5. Click **Add Nesting Steps** in the **withCredentials** step. Select **shell** from the list, enter the following commands in the displayed dialog box, and click **OK**.
```shell
mkdir ~/.kube
echo "$KUBECONFIG_CONTENT" > ~/.kube/config
envsubst < deploy/dev-ol/devops-sample-svc.yaml | kubectl apply -f -
envsubst < deploy/dev-ol/devops-sample.yaml | kubectl apply -f -
```
4. If you want to receive email notifications when the pipeline runs successfully, click **Add Step** and select **mail** to add email information. Note that configuring the email server is optional, which means you can still run your pipeline if you skip this step.
@ -309,8 +318,6 @@ This stage uses SonarQube to test your code. You can skip this stage if you do n
5. When you finish the steps above, click **Save** in the lower-right corner. You can see the pipeline now has a complete workflow with each stage clearly listed on the pipeline. When you define a pipeline using the graphical editing panel, KubeSphere automatically creates its corresponding Jenkinsfile. Click **Edit Jenkinsfile** to view the Jenkinsfile.
![pipeline-done](/images/docs/devops-user-guide/using-devops/create-a-pipeline-using-graphical-editing-panels/pipeline-done.png)
{{< notice note >}}
On the **Pipelines** page, you can click <img src="/images/docs/common-icons/three-dots.png" width="15" /> on the right side of the pipeline and then select **Copy** to create a copy of it. If you need to concurrently run multiple pipelines that don't contain multiple branches, you can select all of these pipelines and then click **Run** to run them in a batch.

View File

@ -292,12 +292,21 @@ KubeSphere 中的图形编辑面板包含用于 Jenkins [阶段 (Stage)](https:/
{{</ notice >}}
3. 再次点击 **Deploy to Dev** 阶段下的**添加步骤**。在列表中选择 **kubernetesDeploy** 并在弹出的对话框中填写以下字段。点击**确定**保存操作
3. 再次点击 **Deploy to Dev** 阶段下的**添加步骤**。在列表中选择**指定容器**,将其命名为 `maven` 然后点击**确定**
- **Kubeconfig**:选择您创建的 Kubeconfig例如 `demo-kubeconfig`
- **配置文件路径**:输入 `deploy/no-branch-dev/**`,即代码仓库中 Kubernetes 资源 [YAML](https://github.com/kubesphere/devops-maven-sample/tree/sonarqube/deploy/no-branch-dev) 文件的相对路径。
3. 点击 `maven` 容器步骤下的**添加嵌套步骤**。在列表中选择**添加凭证**,在弹出的对话框中填写以下字段,然后点击**确定**。
![kubernetesDeploy](/images/docs/zh-cn/devops-user-guide/use-devops/create-a-pipeline-using-graphical-editing-panel/kubernetesDeploy_set.png)
- 凭证名称:选择您创建的 kubeconfig 凭证,例如 `demo-kubeconfig`
- kubeconfig 变量:输入 `KUBECONFIG_CONTENT`
5. 点击**添加凭证**步骤下的**添加嵌套步骤**。在列表中选择 **shell**,在弹出的对话框中输入以下命令,然后点击**确定**。
```shell
mkdir ~/.kube
echo "$KUBECONFIG_CONTENT" > ~/.kube/config
envsubst < deploy/dev-ol/devops-sample-svc.yaml | kubectl apply -f -
envsubst < deploy/dev-ol/devops-sample.yaml | kubectl apply -f -
```
4. 如果您想在流水线成功运行时接收电子邮件通知,请点击**添加步骤**,选择**邮件**,以添加电子邮件信息。请注意,配置电子邮件服务器是可选操作,如果您跳过该步骤,依然可以运行流水线。
@ -309,8 +318,6 @@ KubeSphere 中的图形编辑面板包含用于 Jenkins [阶段 (Stage)](https:/
5. 待您完成上述步骤,请在右下角点击**保存**。随后您可以看到该流水线有完整的工作流并且每个阶段也清晰列示。当您用图形编辑面板定义流水线时KubeSphere 会自动创建相应的 Jenkinsfile。点击**编辑 Jenkinsfile** 查看该 Jenkinsfile。
![流水线设置完成](/images/docs/zh-cn/devops-user-guide/use-devops/create-a-pipeline-using-graphical-editing-panel/pipeline_done.png)
{{< notice note >}}
在**流水线**页面,您可以点击该流水线右侧的 <img src="/images/docs/common-icons/three-dots.png" width="15" />,然后选择**复制**来创建该流水线的副本。如果您需要同时运行多个不包含多分支的流水线,您可以全部选中这些流水线,然后点击**运行**来批量运行它们。