Skip to content

Commit 97553d3

Browse files
committed
update struct
1 parent 3b0e16f commit 97553d3

9 files changed

Lines changed: 7 additions & 9 deletions

File tree

‎.s2i/environment‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
S2I_DESTINATION=/tmp/src
2-
MAVEN_ARGS_APPEND=-o
1+
S2I_DESTINATION=/tmp
2+
MAVEN_ARGS_APPEND=-Dmaven.repo.local=/tmp/src/artifacts/m2 -o
3+
DISABLE_ARTIFACTS=true

‎Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM harbor.devops.kubesphere.local:30280/library/java:openjdk-8-jre-alpine
22

33
WORKDIR /home
44

5-
COPY ./devops-sample-s2i/src/target/*.jar /home
5+
COPY target/*.jar /home
66

77
ENTRYPOINT java -jar *.jar
88

‎Jenkinsfile‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ pipeline {
1010
}
1111

1212
environment {
13-
SOURCE_DIR_NAME = 'devops-sample-s2i'
1413
HARBOR_CREDENTIAL_ID = 'harbor-id'
1514
GITLAB_CREDENTIAL_ID = 'gitlab-id'
1615
KUBECONFIG_CREDENTIAL_ID = 'demo-kubeconfig'
@@ -30,16 +29,15 @@ pipeline {
3029
stage ('unit test') {
3130
steps {
3231
container ('maven') {
33-
sh 'cd $SOURCE_DIR_NAME'
34-
sh 'mvn -o -f $SOURCE_DIR_NAME/src -gs `pwd`/$SOURCE_DIR_NAME/src/configuration/settings.xml test'
32+
sh 'mvn -o -gs `pwd`/configuration/settings.xml test'
3533
}
3634
}
3735
}
3836

3937
stage ('build & push') {
4038
steps {
4139
container ('maven') {
42-
sh 'mvn -o -Dmaven.test.skip=true -f $SOURCE_DIR_NAME/src -gs `pwd`/$SOURCE_DIR_NAME/src/configuration/settings.xml clean package'
40+
sh 'mvn -o -Dmaven.test.skip=true -gs `pwd`/configuration/settings.xml clean package'
4341
sh 'docker build -t $REDISTRY/$NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER .'
4442
withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : "$HARBOR_CREDENTIAL_ID" ,)]) {
4543
sh 'echo "$DOCKER_PASSWORD" | docker login $REDISTRY -u "$DOCKER_USERNAME" --password-stdin'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<pluginGroup>org.jenkins-ci.tools</pluginGroup>
44
</pluginGroups>
55

6-
<localRepository>${PWD}/devops-sample-s2i/artifacts/m2</localRepository>
6+
<localRepository>${PWD}/artifacts/m2</localRepository>
77

88
<profiles>
99
<!-- Give access to Jenkins plugins -->
File renamed without changes.

‎src/README.md‎

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.

src/src/main/java/io/kubesphere/devops/HelloWorldController.java renamed to src/main/java/io/kubesphere/devops/HelloWorldController.java

File renamed without changes.

src/src/test/java/io/kubesphere/devops/HelloWorldControllerTest.java renamed to src/test/java/io/kubesphere/devops/HelloWorldControllerTest.java

File renamed without changes.

0 commit comments

Comments
 (0)