Skip to content

Commit 748965f

Browse files
authored
Merge pull request #158 from LinuxSuRen/java-env-mvn
Add two more maven related env
2 parents 8f20b67 + 1510f46 commit 748965f

File tree

4 files changed

+24
-14
lines changed

4 files changed

+24
-14
lines changed

config/templates/java.yaml

+11-6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ spec:
3434
description: "Additional Maven arguments, useful for temporary adding arguments like -X or -am -pl ."
3535
required: false
3636
defaultValue: ""
37+
- key: MAVEN_MIRROR_URL
38+
type: string
39+
description: "With Repositories you specify from which locations you want to download certain artifacts, such as dependencies and maven-plugins."
40+
required: false
41+
defaultValue: ""
42+
- key: MAVEN_CLEAR_REPO
43+
type: boolean
44+
description: "If set then the Maven repository is removed after the artifact is built. This is useful for keeping the created application image small, but prevents incremental builds. The default is false"
45+
required: false
46+
defaultValue: ""
3747
- key: ARTIFACT_DIR
3848
type: string
3949
description: "Path to target/ where the jar files are created for multi module builds. These are added to ${MAVEN_ARGS}"
@@ -44,11 +54,6 @@ spec:
4454
description: "Arguments to use when copying artifacts from the output dir to the application dir. Useful to specify which artifacts will be part of the image. It defaults to -r hawt-app/* when a hawt-app dir is found on the build directory, otherwise jar files only will be included (*.jar)."
4555
required: false
4656
defaultValue: ""
47-
- key: MAVEN_CLEAR_REPO
48-
type: boolean
49-
description: "If set then the Maven repository is removed after the artifact is built. This is useful for keeping the created application image small, but prevents incremental builds. The default is false"
50-
required: false
51-
defaultValue: ""
5257
- key: JAVA_APP_DIR
5358
type: string
5459
description: "the directory where the application resides. All paths in your application are relative to this directory. By default it is the same directory where this startup script resides."
@@ -141,6 +146,6 @@ spec:
141146
defaultValue: ""
142147
codeFramework: java
143148
defaultBaseImage: kubespheredev/java-8-centos7:latest
144-
version: 0.0.1
149+
version: 0.0.2
145150
description: "This is a builder template for Java builds whose result can be run directly without any further application server.It's suited ideally for microservices with a flat classpath (including \"far jars\")."
146151
iconPath: assets/java.png

config/templates/tomcat.yaml

+11-6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ spec:
3434
description: "Additional Maven arguments, useful for temporary adding arguments like -X or -am -pl ."
3535
required: false
3636
defaultValue: ""
37+
- key: MAVEN_MIRROR_URL
38+
type: string
39+
description: "With Repositories you specify from which locations you want to download certain artifacts, such as dependencies and maven-plugins."
40+
required: false
41+
defaultValue: ""
42+
- key: MAVEN_CLEAR_REPO
43+
type: boolean
44+
description: "If set then the Maven repository is removed after the artifact is built. This is useful for keeping the created application image small, but prevents incremental builds. The default is false"
45+
required: false
46+
defaultValue: ""
3747
- key: ARTIFACT_DIR
3848
type: string
3949
description: "Path to target/ where the jar files are created for multi module builds. These are added to ${MAVEN_ARGS}"
@@ -44,11 +54,6 @@ spec:
4454
description: "Arguments to use when copying artifacts from the output dir to the application dir. Useful to specify which artifacts will be part of the image. It defaults to -r hawt-app/* when a hawt-app dir is found on the build directory, otherwise jar files only will be included (*.jar)."
4555
required: false
4656
defaultValue: ""
47-
- key: MAVEN_CLEAR_REPO
48-
type: boolean
49-
description: "If set then the Maven repository is removed after the artifact is built. This is useful for keeping the created application image small, but prevents incremental builds. The default is false"
50-
required: false
51-
defaultValue: ""
5257
- key: JAVA_APP_DIR
5358
type: string
5459
description: "the directory where the application resides. All paths in your application are relative to this directory. By default it is the same directory where this startup script resides."
@@ -141,6 +146,6 @@ spec:
141146
defaultValue: ""
142147
codeFramework: java
143148
defaultBaseImage: kubespheredev/tomcat85-java8-centos7:latest
144-
version: 0.0.1
149+
version: 0.0.2
145150
description: "This is a builder template for Java builds whose result can be run directly with Tomcat application server."
146151
iconPath: assets/tomcat.png

pkg/apis/devops/v1alpha1/s2ibuildertemplate_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type Parameter struct {
3636
Value string `json:"value,omitempty"`
3737
}
3838

39-
func (p *Parameter) ToEnvonment() *EnvironmentSpec {
39+
func (p *Parameter) ToEnvironment() *EnvironmentSpec {
4040
var v string
4141
if p.Value == "" && p.DefaultValue != "" {
4242
v = p.DefaultValue

pkg/controller/s2irun/ksbuilder_jobs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (r *ReconcileS2iRun) NewConfigMap(instance *devopsv1alpha1.S2iRun, config d
8888
}
8989
if len(template.Parameters) > 0 {
9090
for _, p := range template.Parameters {
91-
e := p.ToEnvonment()
91+
e := p.ToEnvironment()
9292
if e != nil {
9393
config.Environment = append(config.Environment, *e)
9494
}

0 commit comments

Comments
 (0)