From 7ea83703a8bdf2edf368bf04c136c0cc1b22798e Mon Sep 17 00:00:00 2001 From: rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Thu, 11 Nov 2021 16:27:34 +0800 Subject: [PATCH] Remove the offline flag of maven command --- .../docs/devops-user-guide/examples/a-maven-project.md | 2 +- .../examples/create-multi-cluster-pipeline.md | 7 +++---- .../devops-user-guide/examples/go-project-pipeline.md | 2 +- .../create-a-pipeline-using-graphical-editing-panel.md | 6 +++--- .../zh/blogs/create-pipeline-across-multi-clusters.md | 7 +++---- .../docs/devops-user-guide/examples/a-maven-project.md | 2 +- .../examples/create-multi-cluster-pipeline.md | 9 +++------ .../devops-user-guide/examples/go-project-pipeline.md | 2 +- .../create-a-pipeline-using-graphical-editing-panel.md | 6 +++--- 9 files changed, 19 insertions(+), 24 deletions(-) diff --git a/content/en/docs/devops-user-guide/examples/a-maven-project.md b/content/en/docs/devops-user-guide/examples/a-maven-project.md index a3e21f59d..362ff7fcc 100644 --- a/content/en/docs/devops-user-guide/examples/a-maven-project.md +++ b/content/en/docs/devops-user-guide/examples/a-maven-project.md @@ -121,7 +121,7 @@ In this example, all workloads are deployed in `kubesphere-sample-dev`. You must stage ('build & push') { steps { container ('maven') { - sh 'mvn -o -Dmaven.test.skip=true clean package' + sh 'mvn -Dmaven.test.skip=true clean package' sh 'docker build -f Dockerfile-online -t $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER .' withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : "$DOCKER_CREDENTIAL_ID" ,)]) { sh 'echo "$DOCKER_PASSWORD" | docker login $REGISTRY -u "$DOCKER_USERNAME" --password-stdin' diff --git a/content/en/docs/devops-user-guide/examples/create-multi-cluster-pipeline.md b/content/en/docs/devops-user-guide/examples/create-multi-cluster-pipeline.md index 7d0684ca4..04ed4b9ca 100644 --- a/content/en/docs/devops-user-guide/examples/create-multi-cluster-pipeline.md +++ b/content/en/docs/devops-user-guide/examples/create-multi-cluster-pipeline.md @@ -144,9 +144,8 @@ You must create the projects as shown in the table below in advance. Make sure y stage('unit test') { steps { container('maven') { - sh 'mvn clean -o -gs `pwd`/configuration/settings.xml test' + sh 'mvn clean test' } - } } stage('sonarqube analysis') { @@ -154,7 +153,7 @@ You must create the projects as shown in the table below in advance. Make sure y container('maven') { withCredentials([string(credentialsId: "$SONAR_CREDENTIAL_ID", variable: 'SONAR_TOKEN')]) { withSonarQubeEnv('sonar') { - sh "mvn sonar:sonar -o -gs `pwd`/configuration/settings.xml -Dsonar.login=$SONAR_TOKEN" + sh "mvn sonar:sonar -Dsonar.login=$SONAR_TOKEN" } } @@ -165,7 +164,7 @@ You must create the projects as shown in the table below in advance. Make sure y stage('build & push') { steps { container('maven') { - sh 'mvn -o -Dmaven.test.skip=true -gs `pwd`/configuration/settings.xml clean package' + sh 'mvn -Dmaven.test.skip=true clean package' sh 'docker build -f Dockerfile-online -t $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER .' withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : "$DOCKER_CREDENTIAL_ID" ,)]) { sh 'echo "$DOCKER_PASSWORD" | docker login $REGISTRY -u "$DOCKER_USERNAME" --password-stdin' diff --git a/content/en/docs/devops-user-guide/examples/go-project-pipeline.md b/content/en/docs/devops-user-guide/examples/go-project-pipeline.md index 23668d157..8ae0ba3ad 100644 --- a/content/en/docs/devops-user-guide/examples/go-project-pipeline.md +++ b/content/en/docs/devops-user-guide/examples/go-project-pipeline.md @@ -67,7 +67,7 @@ With the above credentials ready, you can create a pipeline using an example Jen DOCKERHUB_USERNAME = 'Docker Hub Username' // Docker image name APP_NAME = 'devops-go-sample' - // ‘dockerhubid’ is the credentials ID you created in KubeSphere with Docker Hub Access Token + // 'dockerhubid' is the credentials ID you created in KubeSphere with Docker Hub Access Token DOCKERHUB_CREDENTIAL = credentials('dockerhubid') // the kubeconfig credentials ID you created in KubeSphere KUBECONFIG_CREDENTIAL_ID = 'go' diff --git a/content/en/docs/devops-user-guide/how-to-use/create-a-pipeline-using-graphical-editing-panel.md b/content/en/docs/devops-user-guide/how-to-use/create-a-pipeline-using-graphical-editing-panel.md index 4a885b493..10ed694ed 100644 --- a/content/en/docs/devops-user-guide/how-to-use/create-a-pipeline-using-graphical-editing-panel.md +++ b/content/en/docs/devops-user-guide/how-to-use/create-a-pipeline-using-graphical-editing-panel.md @@ -146,7 +146,7 @@ Pipelines include [declarative pipelines](https://www.jenkins.io/doc/book/pipeli 3. Click **Add Nesting Steps** to add a nested step under the `maven` container. Select **shell** from the list and enter the following command in the command line. Click **OK** to save it. ```shell - mvn clean -o -gs `pwd`/configuration/settings.xml test + mvn clean test ``` {{< notice note >}} @@ -190,7 +190,7 @@ This stage uses SonarQube to test your code. You can skip this stage if you do n 7. Click **shell** and enter the following command in the command line for the sonarqube branch and authentication. Click **OK** to finish. ```shell - mvn sonar:sonar -o -gs `pwd`/configuration/settings.xml -Dsonar.login=$SONAR_TOKEN + mvn sonar:sonar -Dsonar.login=$SONAR_TOKEN ``` ![sonarqube-shell-new](/images/docs/devops-user-guide/using-devops/create-a-pipeline-using-graphical-editing-panels/sonarqube-shell-new.png) @@ -220,7 +220,7 @@ This stage uses SonarQube to test your code. You can skip this stage if you do n 3. Click **Add Nesting Steps** under the `maven` container to add a nested step. Select **shell** from the list, and enter the following command in the displayed dialog box. Click **OK** to finish. ```shell - mvn -o -Dmaven.test.skip=true -gs `pwd`/configuration/settings.xml clean package + mvn -Dmaven.test.skip=true clean package ``` ![nested-step-maven](/images/docs/devops-user-guide/using-devops/create-a-pipeline-using-graphical-editing-panels/nested-step-maven.png) diff --git a/content/zh/blogs/create-pipeline-across-multi-clusters.md b/content/zh/blogs/create-pipeline-across-multi-clusters.md index 2de385f25..65c0ee365 100644 --- a/content/zh/blogs/create-pipeline-across-multi-clusters.md +++ b/content/zh/blogs/create-pipeline-across-multi-clusters.md @@ -136,9 +136,8 @@ pipeline { stage('unit test') { steps { container('maven') { - sh 'mvn clean -o -gs `pwd`/configuration/settings.xml test' + sh 'mvn clean test' } - } } stage('sonarqube analysis') { @@ -146,7 +145,7 @@ pipeline { container('maven') { withCredentials([string(credentialsId: "$SONAR_CREDENTIAL_ID", variable: 'SONAR_TOKEN')]) { withSonarQubeEnv('sonar') { - sh "mvn sonar:sonar -o -gs `pwd`/configuration/settings.xml -Dsonar.login=$SONAR_TOKEN" + sh "mvn sonar:sonar -Dsonar.login=$SONAR_TOKEN" } } @@ -157,7 +156,7 @@ pipeline { stage('build & push') { steps { container('maven') { - sh 'mvn -o -Dmaven.test.skip=true -gs `pwd`/configuration/settings.xml clean package' + sh 'mvn -Dmaven.test.skip=true clean package' sh 'docker build -f Dockerfile-online -t $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER .' withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : "$DOCKER_CREDENTIAL_ID" ,)]) { sh 'echo "$DOCKER_PASSWORD" | docker login $REGISTRY -u "$DOCKER_USERNAME" --password-stdin' diff --git a/content/zh/docs/devops-user-guide/examples/a-maven-project.md b/content/zh/docs/devops-user-guide/examples/a-maven-project.md index 3f01f32f4..5fe629e52 100644 --- a/content/zh/docs/devops-user-guide/examples/a-maven-project.md +++ b/content/zh/docs/devops-user-guide/examples/a-maven-project.md @@ -121,7 +121,7 @@ kubectl get cm -n kubesphere-devops-system ks-devops-agent -o yaml stage ('build & push') { steps { container ('maven') { - sh 'mvn -o -Dmaven.test.skip=true clean package' + sh 'mvn -Dmaven.test.skip=true clean package' sh 'docker build -f Dockerfile-online -t $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER .' withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : "$DOCKER_CREDENTIAL_ID" ,)]) { sh 'echo "$DOCKER_PASSWORD" | docker login $REGISTRY -u "$DOCKER_USERNAME" --password-stdin' diff --git a/content/zh/docs/devops-user-guide/examples/create-multi-cluster-pipeline.md b/content/zh/docs/devops-user-guide/examples/create-multi-cluster-pipeline.md index 9e64f4c57..dc9d1d865 100644 --- a/content/zh/docs/devops-user-guide/examples/create-multi-cluster-pipeline.md +++ b/content/zh/docs/devops-user-guide/examples/create-multi-cluster-pipeline.md @@ -144,9 +144,8 @@ weight: 11440 stage('unit test') { steps { container('maven') { - sh 'mvn clean -o -gs `pwd`/configuration/settings.xml test' + sh 'mvn clean test' } - } } stage('sonarqube analysis') { @@ -154,18 +153,16 @@ weight: 11440 container('maven') { withCredentials([string(credentialsId: "$SONAR_CREDENTIAL_ID", variable: 'SONAR_TOKEN')]) { withSonarQubeEnv('sonar') { - sh "mvn sonar:sonar -o -gs `pwd`/configuration/settings.xml -Dsonar.login=$SONAR_TOKEN" + sh "mvn sonar:sonar -Dsonar.login=$SONAR_TOKEN" } - } } - } } stage('build & push') { steps { container('maven') { - sh 'mvn -o -Dmaven.test.skip=true -gs `pwd`/configuration/settings.xml clean package' + sh 'mvn -Dmaven.test.skip=true clean package' sh 'docker build -f Dockerfile-online -t $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER .' withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : "$DOCKER_CREDENTIAL_ID" ,)]) { sh 'echo "$DOCKER_PASSWORD" | docker login $REGISTRY -u "$DOCKER_USERNAME" --password-stdin' diff --git a/content/zh/docs/devops-user-guide/examples/go-project-pipeline.md b/content/zh/docs/devops-user-guide/examples/go-project-pipeline.md index 0d00344ad..4911b1883 100644 --- a/content/zh/docs/devops-user-guide/examples/go-project-pipeline.md +++ b/content/zh/docs/devops-user-guide/examples/go-project-pipeline.md @@ -67,7 +67,7 @@ weight: 11410 DOCKERHUB_USERNAME = 'Docker Hub Username' // Docker 镜像名称 APP_NAME = 'devops-go-sample' - // ‘dockerhubid’ 是您在 KubeSphere 用 Docker Hub 访问令牌创建的凭证 ID + // 'dockerhubid' 是您在 KubeSphere 用 Docker Hub 访问令牌创建的凭证 ID DOCKERHUB_CREDENTIAL = credentials('dockerhubid') // 您在 KubeSphere 创建的 kubeconfig 凭证 ID KUBECONFIG_CREDENTIAL_ID = 'go' diff --git a/content/zh/docs/devops-user-guide/how-to-use/create-a-pipeline-using-graphical-editing-panel.md b/content/zh/docs/devops-user-guide/how-to-use/create-a-pipeline-using-graphical-editing-panel.md index 1529bbdda..8fe8b8800 100644 --- a/content/zh/docs/devops-user-guide/how-to-use/create-a-pipeline-using-graphical-editing-panel.md +++ b/content/zh/docs/devops-user-guide/how-to-use/create-a-pipeline-using-graphical-editing-panel.md @@ -146,7 +146,7 @@ KubeSphere 中的图形编辑面板包含用于 Jenkins [阶段 (Stage)](https:/ 3. 点击**添加嵌套步骤**,在 `maven` 容器下添加一个嵌套步骤。在列表中选择 **shell** 并在命令行中输入以下命令。点击**确定**保存操作。 ```shell - mvn clean -o -gs `pwd`/configuration/settings.xml test + mvn clean test ``` {{< notice note >}} @@ -190,7 +190,7 @@ KubeSphere 中的图形编辑面板包含用于 Jenkins [阶段 (Stage)](https:/ 7. 点击 **shell** 并在命令行中输入以下命令,用于 sonarqube 分支和认证,点击**确定**完成操作。 ```shell - mvn sonar:sonar -o -gs `pwd`/configuration/settings.xml -Dsonar.login=$SONAR_TOKEN + mvn sonar:sonar -Dsonar.login=$SONAR_TOKEN ``` ![新的 SonarQube shell](/images/docs/zh-cn/devops-user-guide/use-devops/create-a-pipeline-using-graphical-editing-panel/sonarqube_shell_new.png) @@ -220,7 +220,7 @@ KubeSphere 中的图形编辑面板包含用于 Jenkins [阶段 (Stage)](https:/ 3. 点击 `maven` 容器下的**添加嵌套步骤**添加一个嵌套步骤。在列表中选择 **shell** 并在弹出窗口中输入以下命令,点击**确定**完成操作。 ```shell - mvn -o -Dmaven.test.skip=true -gs `pwd`/configuration/settings.xml clean package + mvn -Dmaven.test.skip=true clean package ``` ![maven 嵌套步骤](/images/docs/zh-cn/devops-user-guide/use-devops/create-a-pipeline-using-graphical-editing-panel/nested_step_maven.png)