mirror of
https://github.com/kubesphere/website.git
synced 2025-12-28 23:02:50 +00:00
Remove the offline flag of maven command
This commit is contained in:
parent
d28d422b23
commit
7ea83703a8
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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
|
||||
```
|
||||
|
||||

|
||||
|
|
@ -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
|
||||
```
|
||||
|
||||

|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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
|
||||
```
|
||||
|
||||

|
||||
|
|
@ -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
|
||||
```
|
||||
|
||||

|
||||
|
|
|
|||
Loading…
Reference in New Issue