Skip to content

Commit

Permalink
task-maven: Auto-update tekton tasks resources\n\nURL: https://github…
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions authored and openshift-merge-bot[bot] committed May 13, 2024
1 parent 5e082bf commit 8b98486
Showing 1 changed file with 136 additions and 0 deletions.
136 changes: 136 additions & 0 deletions tasks/task-maven/0.2.1/task-maven.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
---
# Source: task-maven/templates/task-maven.yaml
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: maven
labels:
app.kubernetes.io/version: 0.2.1
annotations:
tekton.dev/source: "https://github.com/openshift-pipelines/task-maven"
artifacthub.io/category: integration-delivery
artifacthub.io/maintainers: |
- name: OpenShift Pipeline task maintainers
email: [email protected]
artifacthub.io/provider: Red Hat
artifacthub.io/recommendations: |
- url: https://tekton.dev/
tekton.dev/categories: containers
tekton.dev/pipelines.minVersion: 0.41.0
tekton.dev/tags: containers
spec:
description: >-
This Task can be used to run a Maven build.
workspaces:
- name: source
optional: false
description: The workspace consisting of maven project.
- name: server_secret
optional: true
description: The workspace containing server secrets (username and password)
- name: proxy_secret
optional: true
description: The workspace containing proxy server access credentials (username, password).
- name: proxy_configmap
optional: true
description: The workspace containing some proxy values (proxy_port,proxy_host,proxy_protocol,proxy_non_proxy_hosts)
- name: maven_settings
optional: true
description: The workspace consisting of the custom maven settings provided by the user.
params:
- name: GOALS
description: maven goals to run
type: array
default:
- "package"
- name: MAVEN_MIRROR_URL
description: The Maven repository mirror url
type: string
default: ""
- name: SUBDIRECTORY
type: string
description: >-
The subdirectory within the repository for sources on
which we want to execute maven goals.
default: "."

stepTemplate:
env:

- name: PARAMS_MAVEN_MIRROR_URL
value: "$(params.MAVEN_MIRROR_URL)"
- name: PARAMS_SUBDIRECTORY
value: "$(params.SUBDIRECTORY)"
- name: WORKSPACES_SOURCE_PATH
value: "$(workspaces.source.path)"
- name: WORKSPACES_SOURCE_BOUND
value: "$(workspaces.source.bound)"
- name: WORKSPACES_SERVER_SECRET_PATH
value: "$(workspaces.server_secret.path)"
- name: WORKSPACES_SERVER_SECRET_BOUND
value: "$(workspaces.server_secret.bound)"
- name: WORKSPACES_PROXY_SECRET_PATH
value: "$(workspaces.proxy_secret.path)"
- name: WORKSPACES_PROXY_SECRET_BOUND
value: "$(workspaces.proxy_secret.bound)"
- name: WORKSPACES_PROXY_CONFIGMAP_PATH
value: "$(workspaces.proxy_configmap.path)"
- name: WORKSPACES_PROXY_CONFIGMAP_BOUND
value: "$(workspaces.proxy_configmap.bound)"
- name: WORKSPACES_MAVEN_SETTINGS_PATH
value: "$(workspaces.maven_settings.path)"
- name: WORKSPACES_MAVEN_SETTINGS_BOUND
value: "$(workspaces.maven_settings.bound)"

steps:
- name: load-scripts
image: registry.access.redhat.com/ubi8/ubi-minimal:8.9
workingDir: /scripts
script: |
set -e
printf '%s' "IyEvdXNyL2Jpbi9lbnYgYmFzaAoKZGVjbGFyZSAtcnggTUFWRU5fR0VORVJBVEVfRElSRUNUT1JZPSIke1dPUktTUEFDRVNfU09VUkNFX1BBVEh9L21hdmVuLWdlbmVyYXRlIgoKZGVjbGFyZSAtcnggTUFWRU5fU0VUVElOR1NfRklMRT0iJHtNQVZFTl9HRU5FUkFURV9ESVJFQ1RPUll9L3NldHRpbmdzLnhtbCIKCmlmIFtbIC1mICR7TUFWRU5fU0VUVElOR1NfRklMRX0gXV07IHRoZW4KICAgIGVjaG8gInVzaW5nIGV4aXN0aW5nICcke01BVkVOX1NFVFRJTkdTX0ZJTEV9JyIKICAgIGNhdCAke01BVkVOX1NFVFRJTkdTX0ZJTEV9CiAgICBleGl0IDAKZmkKCiMgQ2hlY2sgaWYgc2V0dGluZ3MueG1sIGV4aXN0cyBpbiB0aGUgd29ya3NwYWNlIG1hdmVuLXNldHRpbmdzCmlmIFtbIC1mICIke1dPUktTUEFDRVNfTUFWRU5fU0VUVElOR1NfUEFUSH0vc2V0dGluZ3MueG1sIiBdXTsgdGhlbgogICAgY3AgIiR7V09SS1N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IDEKICAgIGZpCmZpCgppZiBbIC1uICIke1BBUkFNU19NQVZFTl9NSVJST1JfVVJMfSIgXTsgdGhlbgogICAgeG1sPSIgICAgPG1pcnJvcj5cCiAgICA8aWQ+bWlycm9yLmRlZmF1bHQ8L2lkPlwKICAgIDx1cmw+JHtQQVJBTVNfTUFWRU5fTUlSUk9SX1VSTH08L3VybD5cCiAgICA8bWlycm9yT2Y+Y2VudHJhbDwvbWlycm9yT2Y+XAogICAgPC9taXJyb3I+IgogICAgc2VkIC1pICJzfDwhLS0gIyMjIG1pcnJvcnMgZnJvbSBFTlYgIyMjIC0tPnwkeG1sfCIgJHtNQVZFTl9TRVRUSU5HU19GSUxFfQpmaQo=" |base64 -d >maven-generate.sh
chmod +x maven-*.sh
volumeMounts:
- name: scripts-dir
mountPath: /scripts

- name: maven-generate
image: registry.access.redhat.com/ubi8/ubi-minimal:8.9
env:
- name: HOME
value: /tekton/home
command:
- /scripts/maven-generate.sh
securityContext:
runAsNonRoot: true
runAsUser: 65532
volumeMounts:
- name: scripts-dir
mountPath: /scripts
- name: maven-settings-dir
mountPath: /maven-generate

- name: maven-goals
env:
- name: HOME
value: /tekton/home
image: registry.access.redhat.com/ubi8/openjdk-11:latest
workingDir: $(workspaces.source.path)/$(params.SUBDIRECTORY)
command: ["/usr/bin/mvn"]
args:
- -s
- maven-generate/settings.xml
- "$(params.GOALS[*])"
securityContext:
runAsNonRoot: true
runAsUser: 65532
volumeMounts:
- name: maven-settings-dir
mountPath: /maven-generate

volumes:
- name: scripts-dir
emptyDir: {}
- name: maven-settings-dir
emptyDir: {}

0 comments on commit 8b98486

Please sign in to comment.