-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
258c2cf
commit 489c467
Showing
5 changed files
with
142 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
apiVersion: tekton.dev/v1 | ||
kind: Task | ||
metadata: | ||
annotations: | ||
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/ | ||
kubectl.kubernetes.io/last-applied-configuration: | | ||
{"apiVersion":"tekton.dev/v1","kind":"Task","metadata":{"annotations":{"artifacthub.io/category":"integration-delivery","artifacthub.io/maintainers":"- name: OpenShift Pipeline task maintainers\n email: [email protected]\n","artifacthub.io/provider":"Red Hat","artifacthub.io/recommendations":"- url: https://tekton.dev/\n","tekton.dev/categories":"containers","tekton.dev/pipelines.minVersion":"0.41.0","tekton.dev/tags":"containers"},"labels":{"app.kubernetes.io/version":"0.3.2"},"name":"jib-maven","namespace":"anebhat"},"spec":{"description":"This Task builds Java/Kotlin/Groovy/Scala source into a container image using Google's Jib tool. Jib works with Maven and Gradle projects, and this template is for Maven projects.","params":[{"description":"Name of the image to build","name":"IMAGE"},{"default":".","description":"The directory containing the app, relative to the source repository root","name":"DIRECTORY","type":"string"},{"default":"false","description":"Whether to allow insecure registry","name":"INSECUREREGISTRY","type":"string"},{"default":"service-ca.crt","description":"CA cert file name for insecure registry service","name":"CACERTFILE","type":"string"}],"results":[{"description":"Digest of the image just built.","name":"IMAGE_DIGEST"}],"stepTemplate":{"env":[{"name":"PARAMS_DIRECTORY","value":"$(params.DIRECTORY)"},{"name":"WORKSPACES_SOURCE_PATH","value":"$(workspaces.source.path)"},{"name":"WORKSPACES_SSLCERTDIR_PATH","value":"$(workspaces.sslcertdir.path)"},{"name":"WORKSPACES_DOCKERCONFIG_BOUND","value":"$(workspaces.dockerconfig.bound)"},{"name":"WORKSPACES_DOCKERCONFIG_PATH","value":"$(workspaces.dockerconfig.path)"},{"name":"PARAMS_CACERTFILE","value":"$(params.CACERTFILE)"},{"name":"PARAMS_INSECUREREGISTRY","value":"$(params.INSECUREREGISTRY)"},{"name":"PARAMS_IMAGE","value":"$(params.IMAGE)"},{"name":"RESULTS_IMAGE_DIGEST_PATH","value":"$(results.IMAGE_DIGEST.path)"}]},"steps":[{"env":[{"name":"HOME","value":"/tekton/home"}],"image":"registry.access.redhat.com/ubi8/openjdk-11:latest","name":"build-and-push","script":"set -e\nprintf '%s' \"IyEvYmluL2Jhc2gKCmRlY2xhcmUgLXJ4IERPQ0tFUl9DT05GSUc9IiR7V09SS1NQQUNFU19ET0NLRVJDT05GSUdfUEFUSH0iCgojIERlbGV0ZSB0aGUgdHJ1c3RzdG9yZSBjcmVhdGVkIG9uIGV4aXQKZnVuY3Rpb24gY2xlYW51cCB7CiAgICBybSAiJHtXT1JLU1BBQ0VTX1NPVVJDRV9QQVRIfS90cnVzdHN0b3JlLmprcyIKfQoKY2VydFBhcmFtcz0iIgoKaWYgW1sgLWYgIiR7V09SS1NQQUNFU19TU0xDRVJURElSX1BBVEh9LyR7UEFSQU1TX0NBQ0VSVEZJTEV9IiBdXTsgdGhlbgogICAgIyBjcmVhdGUgdGhlIHRydXN0c3RvcmUgd2l0aCBleGlzdGluZyBjZXJ0cyBhdmFpbGFibGUKICAgIGtleXRvb2wgLWltcG9ydGtleXN0b3JlIC1zcmNrZXlzdG9yZSAiJEpBVkFfSE9NRS9saWIvc2VjdXJpdHkvY2FjZXJ0cyIgLXNyY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UkFNU19JTUFHRX0iIFwKICAgICRjZXJ0UGFyYW1zIFwKICAgIGNvbXBpbGUgXAogICAgY29tLmdvb2dsZS5jbG91ZC50b29sczpqaWItbWF2ZW4tcGx1Z2luOmJ1aWxkCgpjYXQgJHtXT1JLU1BBQ0VTX1NPVVJDRV9QQVRIfS8ke1BBUkFNU19ESVJFQ1RPUll9L3RhcmdldC9qaWItaW1hZ2UuZGlnZXN0IHwgdGVlICR7UkVTVUxUU19JTUFHRV9ESUdFU1RfUEFUSH0=\" |base64 -d \u003e\"/scripts/jib-maven-build-and-push.sh\"\nchmod +x /scripts/jib-*.sh;echo \"Running Script /scripts/jib-maven-build-and-push.sh\";\n /scripts/jib-maven-build-and-push.sh;\n","securityContext":{"runAsNonRoot":true,"runAsUser":65532},"volumeMounts":[{"mountPath":"/scripts","name":"scripts-dir"}],"workingDir":"$(workspaces.source.path)/$(params.DIRECTORY)"}],"volumes":[{"emptyDir":{},"name":"empty-dir-volume"},{"emptyDir":{},"name":"scripts-dir"}],"workspaces":[{"description":"The workspace consisting of maven project.","name":"source","optional":false},{"description":"The workspace containing SSL certificates.","name":"sslcertdir","optional":true},{"description":"The workspace containing Docker configuration.","name":"dockerconfig","optional":true}]}} | ||
tekton.dev/categories: containers | ||
tekton.dev/pipelines.minVersion: 0.41.0 | ||
tekton.dev/tags: containers | ||
creationTimestamp: "2024-11-21T05:06:44Z" | ||
generation: 1 | ||
labels: | ||
app.kubernetes.io/version: 0.3.2 | ||
name: jib-maven | ||
namespace: anebhat | ||
resourceVersion: "58176" | ||
uid: 61f6bf72-3b5f-445a-95e3-a12343f8d973 | ||
spec: | ||
description: This Task builds Java/Kotlin/Groovy/Scala source into a container image | ||
using Google's Jib tool. Jib works with Maven and Gradle projects, and this template | ||
is for Maven projects. | ||
params: | ||
- description: Name of the image to build | ||
name: IMAGE | ||
type: string | ||
- default: . | ||
description: The directory containing the app, relative to the source repository | ||
root | ||
name: DIRECTORY | ||
type: string | ||
- default: "false" | ||
description: Whether to allow insecure registry | ||
name: INSECUREREGISTRY | ||
type: string | ||
- default: service-ca.crt | ||
description: CA cert file name for insecure registry service | ||
name: CACERTFILE | ||
type: string | ||
results: | ||
- description: Digest of the image just built. | ||
name: IMAGE_DIGEST | ||
type: string | ||
stepTemplate: | ||
computeResources: {} | ||
env: | ||
- name: PARAMS_DIRECTORY | ||
value: $(params.DIRECTORY) | ||
- name: WORKSPACES_SOURCE_PATH | ||
value: $(workspaces.source.path) | ||
- name: WORKSPACES_SSLCERTDIR_PATH | ||
value: $(workspaces.sslcertdir.path) | ||
- name: WORKSPACES_DOCKERCONFIG_BOUND | ||
value: $(workspaces.dockerconfig.bound) | ||
- name: WORKSPACES_DOCKERCONFIG_PATH | ||
value: $(workspaces.dockerconfig.path) | ||
- name: PARAMS_CACERTFILE | ||
value: $(params.CACERTFILE) | ||
- name: PARAMS_INSECUREREGISTRY | ||
value: $(params.INSECUREREGISTRY) | ||
- name: PARAMS_IMAGE | ||
value: $(params.IMAGE) | ||
- name: RESULTS_IMAGE_DIGEST_PATH | ||
value: $(results.IMAGE_DIGEST.path) | ||
steps: | ||
- computeResources: {} | ||
env: | ||
- name: HOME | ||
value: /tekton/home | ||
image: registry.access.redhat.com/ubi8/openjdk-11:latest | ||
name: build-and-push | ||
script: | | ||
set -e | ||
printf '%s' "IyEvYmluL2Jhc2gKCmRlY2xhcmUgLXJ4IERPQ0tFUl9DT05GSUc9IiR7V09SS1NQQUNFU19ET0NLRVJDT05GSUdfUEFUSH0iCgojIERlbGV0ZSB0aGUgdHJ1c3RzdG9yZSBjcmVhdGVkIG9uIGV4aXQKZnVuY3Rpb24gY2xlYW51cCB7CiAgICBybSAiJHtXT1JLU1BBQ0VTX1NPVVJDRV9QQVRIfS90cnVzdHN0b3JlLmprcyIKfQoKY2VydFBhcmFtcz0iIgoKaWYgW1sgLWYgIiR7V09SS1NQQUNFU19TU0xDRVJURElSX1BBVEh9LyR7UEFSQU1TX0NBQ0VSVEZJTEV9IiBdXTsgd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IGFuZCBwdXNoIHRoZSBpbWFnZQptdm4gLUIgXAogICAgLUR1c2VyLmhvbWU9IiRIT01FIiBcCiAgICAtRGppYi5hbGxvd0luc2VjdXJlUmVnaXN0cmllcz0iJHtQQVJBTVNfSU5TRUNVUkVSRUdJU1RSWX0iIFwKICAgIC1EamliLnRvLmltYWdlPSIke1BBUkFNU19JTUFHRX0iIFwKICAgICRjZXJ0UGFyYW1zIFwKICAgIGNvbXBpbGUgXAogICAgY29tLmdvb2dsZS5jbG91ZC50b29sczpqaWItbWF2ZW4tcGx1Z2luOmJ1aWxkCgpjYXQgJHtXT1JLU1BBQ0VTX1NPVVJDRV9QQVRIfS8ke1BBUkFNU19ESVJFQ1RPUll9L3RhcmdldC9qaWItaW1hZ2UuZGlnZXN0IHwgdGVlICR7UkVTVUxUU19JTUFHRV9ESUdFU1RfUEFUSH0=" |base64 -d >"/scripts/jib-maven-build-and-push.sh" | ||
chmod +x /scripts/jib-*.sh;echo "Running Script /scripts/jib-maven-build-and-push.sh"; | ||
/scripts/jib-maven-build-and-push.sh; | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: 65532 | ||
volumeMounts: | ||
- mountPath: /scripts | ||
name: scripts-dir | ||
workingDir: $(workspaces.source.path)/$(params.DIRECTORY) | ||
volumes: | ||
- emptyDir: {} | ||
name: empty-dir-volume | ||
- emptyDir: {} | ||
name: scripts-dir | ||
workspaces: | ||
- description: The workspace consisting of maven project. | ||
name: source | ||
- description: The workspace containing SSL certificates. | ||
name: sslcertdir | ||
optional: true | ||
- description: The workspace containing Docker configuration. | ||
name: dockerconfig | ||
optional: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters