-
Notifications
You must be signed in to change notification settings - Fork 576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add maven command path to maven task #1207
base: main
Are you sure you want to change the base?
Conversation
Hi @mosuke5. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Diff between version 0.3 and 0.4diff --git a/task/maven/0.3/README.md b/task/maven/0.4/README.md
index bd09885..90af923 100644
--- a/task/maven/0.3/README.md
+++ b/task/maven/0.4/README.md
@@ -11,6 +11,7 @@ kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/maven/0.3/ra
## Parameters
- **MAVEN_IMAGE**: The base image for maven (_default_: `gcr.io/cloud-builders/mvn`)
+- **MAVEN_COMMAND**: Maven command to execute, you could use the maven wrapper over here (_default_: `/usr/bin/mvn`)
- **GOALS**: Maven `goals` to be executed
- **MAVEN_MIRROR_URL**: Maven mirror url (to be inserted into ~/.m2/settings.xml)
- **SERVER_USER**: Username to authenticate to the server (to be inserted into ~/.m2/settings.xml)
diff --git a/task/maven/0.3/maven.yaml b/task/maven/0.4/maven.yaml
index d78758a..45afbf8 100644
--- a/task/maven/0.3/maven.yaml
+++ b/task/maven/0.4/maven.yaml
@@ -3,7 +3,7 @@ kind: Task
metadata:
name: maven
labels:
- app.kubernetes.io/version: "0.3"
+ app.kubernetes.io/version: "0.4"
annotations:
tekton.dev/pipelines.minVersion: "0.17.0"
tekton.dev/categories: Build Tools
@@ -28,6 +28,10 @@ spec:
type: string
description: Maven base image
default: gcr.io/cloud-builders/mvn@sha256:57523fc43394d6d9d2414ee8d1c85ed7a13460cbb268c3cd16d28cfb3859e641 #tag: latest
+ - name: MAVEN_COMMAND
+ description: Maven command to execute, you could use the maven wrapper over here.
+ type: string
+ default: "/usr/bin/mvn"
- name: GOALS
description: maven goals to run
type: array
@@ -77,7 +81,7 @@ spec:
default: "."
steps:
- name: mvn-settings
- image: registry.access.redhat.com/ubi8/ubi-minimal:8.2
+ image: registry.access.redhat.com/ubi8/ubi-minimal:8.8
script: |
#!/usr/bin/env bash
@@ -146,7 +150,7 @@ spec:
- name: mvn-goals
image: $(params.MAVEN_IMAGE)
workingDir: $(workspaces.source.path)/$(params.CONTEXT_DIR)
- command: ["/usr/bin/mvn"]
+ command: ["$(params.MAVEN_COMMAND)"]
args:
- -s
- $(workspaces.maven-settings.path)/settings.xml |
Catlin Output
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ok-to-test
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vinamra28 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
In version v0.3, the path for the mvn command was set to
/usr/bin/mvn
. In this setup, it wasn't possible to switch to a different mvn container image or to utilize themvnw
located within the application's repository. By introducingMAVEN_COMMAND
, users are now able to execute any mvn command of their choice.Additionally, with this change, the default value for MAVEN_COMMAND is
/usr/bin/mvn
, ensuring compatibility with v0.3.Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
contains
/kind <type>
. Valid types are bug, cleanup, design, documentation,feature, flake, misc, question, tep
File path follows
<kind>/<name>/<version>/name.yaml
Has
README.md
at<kind>/<name>/<version>/README.md
Has mandatory
metadata.labels
-app.kubernetes.io/version
the same as the<version>
of the resourceHas mandatory
metadata.annotations
tekton.dev/pipelines.minVersion
mandatory
spec.description
follows the conventionSee the contribution guide for more details.