From 8ac2b6724667c55acd2ec9d4c5fe8bcb71e504bb Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 19 Dec 2023 17:21:14 +0000 Subject: [PATCH] experimental/task-git: Auto-update tekton tasks resources\n\nURL: https://github.com/openshift-pipelines/task-git\nIgnoredVersions: --- experimental/pipelines/artifacthub-repo.yml | 4 + experimental/tasks/artifacthub-repo.yml | 11 + experimental/tasks/task-git/0.1.0/README.md | 155 +++++++++++ .../tasks/task-git/0.1.0/task-git.yaml | 250 ++++++++++++++++++ experimental/tasks/task-git/0.2.0/README.md | 155 +++++++++++ .../tasks/task-git/0.2.0/task-git.yaml | 250 ++++++++++++++++++ 6 files changed, 825 insertions(+) create mode 100644 experimental/pipelines/artifacthub-repo.yml create mode 100644 experimental/tasks/artifacthub-repo.yml create mode 100644 experimental/tasks/task-git/0.1.0/README.md create mode 100644 experimental/tasks/task-git/0.1.0/task-git.yaml create mode 100644 experimental/tasks/task-git/0.2.0/README.md create mode 100644 experimental/tasks/task-git/0.2.0/task-git.yaml diff --git a/experimental/pipelines/artifacthub-repo.yml b/experimental/pipelines/artifacthub-repo.yml new file mode 100644 index 00000000..b2053ec8 --- /dev/null +++ b/experimental/pipelines/artifacthub-repo.yml @@ -0,0 +1,4 @@ +repositoryID: 0b580f09-c7b5-4c62-9f67-4208d4da28e3 +owners: + - name: vdemeester + email: vdemeest@redhat.com \ No newline at end of file diff --git a/experimental/tasks/artifacthub-repo.yml b/experimental/tasks/artifacthub-repo.yml new file mode 100644 index 00000000..d3ea652e --- /dev/null +++ b/experimental/tasks/artifacthub-repo.yml @@ -0,0 +1,11 @@ +repositoryID: 6b1e3fa7-3d04-47d2-9b3e-14009e0d52b3 +owners: + - name: vdemeester + email: vdemeest@redhat.com +ignore: +- name: go-ko-image + version: v0.2.0 # This release is not working (wrong image) +#ignore: # (optional, packages that should not be indexed by Artifact Hub) +# - name: package1 +# - name: package2 # Exact match +# version: beta # Regular expression (when omitted, all versions are ignored) diff --git a/experimental/tasks/task-git/0.1.0/README.md b/experimental/tasks/task-git/0.1.0/README.md new file mode 100644 index 00000000..60f0bdb6 --- /dev/null +++ b/experimental/tasks/task-git/0.1.0/README.md @@ -0,0 +1,155 @@ +

+ + GitHub Test Workflow Status + + + GitHub release (latest by date) + +

+ +`git` Tekton Task +----------------- + +The `git` Task will clone and prepare a Git repository on the `output` Workspace. By default the Git repository (`URL`) will be cloned on the root of the Workspace, but you can alter the clone location using the `SUBDIRECTORY` parameter, and [other settings](#parameters). + +A quick usage example is: + +```yaml +--- +apiVersion: tekton.dev/v1beta1 +kind: TaskRun +metadata: {} +spec: + taskRef: + name: git + params: + - name: URL + value: https://github.com/openshift-pipelines/task-git.git + workspaces: + - name: output + emptyDir: {} +``` + +Please consider the [Workspaces](#workspaces), [Parameters](#parameters) and [Results](#results) described below. + +# Workspaces + +A single Workspace is required for this Task, while the optional Workspaces will allow advanced Git configuration and authentication. + +## `output` + +The `output` is a required Workspace, represents the primary location where the Git repository data will be stored, and later on, this Workspace will be monted in subsequent Pipeline's Task. + +Knowing the Workspace data will be employed on other Tasks, the recommended approach is using a [persistent volume][tektonPVC], for instance a [`PersistentVolumeClaim` (PVC)][k8sPVC]. + +## Authentication Workspaces + +The recommended approach to authentication is using the [default mechanisms supported by Tekton Pipeline][tektonAuthentication], please consider it as your first option. + +More advanced use-cases may require different methods of interacting with private repositories, the following Workspaces are meant to support advanced Git configuration and authentication. + +### `basic-auth` (HTTP/SSH) + +The `basic-auth` is a optional Workspace to provide Git credentials and configuration. + +The following Workspace files (items) are shared with Git before cloning the repository, the Task copies the files to the Git user home directory, configured by the parameter `USER_HOME`. + +| Workspace File | Required | Description | +| :----------------- | :------: | :------------------------------------- | +| `.git-credentials` | `true` | [Git credentials file][gitCredentials] | +| `.gitconfig` | `true` | [Git configuration file][gitConfig] | + +Typically, this type of data is stored as a Kubernetes Secret. For example: + +```bash +kubectl create secret generic basic-auth-ex \ + --from-file=".git-credentials=${HOME}/.git-credentials" \ + --from-file=".gitconfig=${HOME}/.gitconfig" +``` + +Then, you can [reference the Secret][tektonWorkspaceSecret] as the `basic-auth` Workspace. + +### `ssh-directory` (SSH) + +The `ssh-directory` is a optional Workspace, meant to store the files commonly found on a [`~/.ssh` directory][dotSSHDirectory], when informed, the whole directory will be copied into the Git's home (configured by the parameter `USER_HOME`). + +During the `prepare` step you can see the details about what's being copied, please consider the output log snippet below. For more verbose logging set the peramater `VERBOSE` to `true`. + +``` +---> Phase: Copying '.ssh' from ssh-directory workspace ('/workspaces/ssh-directory')... +'/workspaces/ssh-directory' -> '/home/git/.ssh' +'/workspaces/ssh-directory/config' -> '/home/git/.ssh/config' +mode of '/home/git/.ssh' changed from 0755 (rwxr-xr-x) to 0700 (rwx------) +mode of '/home/git/.ssh/config' changed from 0644 (rw-r--r--) to 0400 (r--------) + +``` + +It's recommended storing this type of data as a Kubernetes Secret, like the following example: + +```bash +kubectl create secret generic ssh-directory-ex \ + --from-file="config=${HOME}/.ssh/config" \ + --from-file="authorized_keys=${HOME}/.ssh/authorized_keys" +``` + +Then, you can [reference the Secret][tektonWorkspaceSecret] as the `ssh-directory` Workspace. + +### `ssl-ca-directory` (mTLS) + +The `ssl-ca-directory` is a optional Workspace to store a additional [Certificate Authority (CA)][tlsCA] bundles, commonly `.pem` or `.crt` files. The exact bundle file name is defined by the parameter `CRT_FILENAME`. + +Before running the Git clone command, the [`GIT_SSL_CAINFO` environment variable][gitSSLCAInfo] is exported with the full path to the `CRT_FILENAME` in the `ssl-ca-directory` Workspace. + +You can observe the setting taking place on the beggining of the `git-clone` step: + +``` +phase 'Exporting custom CA certificate "GIT_SSL_CAINFO=/workspaces/ssl-ca-directory/ca-bundle.crt"' +``` + +This is a sensitive information and therefore it's recommended to store as a Kubernetes Secret, please consider the previous examples to create Secrets with the `--from-file` option. + +Finally, you can [reference the Secret][tektonWorkspaceSecret] as the `ssl-ca-directory` Workspace. + +# Parameters + +The following parameters are supported by this Task. + +| Parameter | Type | Default | Description | +| :-------- | :---: | :------ | :---------- | +| `URL` | `string` | (required) | Git repository URL| +| `REVISION` | `string` | `main` | Revision to checkout, an branch, tag, sha, ref, etc... | +| `SUBMODULES` | `string` | `true` | Initialize and fetch Git submodules | +| `DEPTH` | `string` | `1` | [Number of commits to fetch][gitCloneDepath], a "shallow clone" is a single commit | +| `SSL_VERIFY` | `string` | `true` | Sets the global [`http.sslVerify`][gitHTTPSSLVerify] value, `false` is not advised unless you trust the remote repository | +| `CRT_FILENAME` | `string` | `ca-bundle.crt` | Certificate Authority (CA) bundle filename on the `ssl-ca-directory` Workspace. | +| `SUBDIRECTORY` | `string` | "" (empty) | Relative path to the `output` Workspace where the repository will be cloned | +| `SPARSE_CHECKOUT_DIRECTORIES` | `string` | "" (empty) | List of directory patterns split by comma to perform ["sparse checkout"][gitSparseCheckout] | +| `DELETE_EXISTING` | `string` | `true` | Clean out the contents of the `output` Workspace before cloning the repository, if data exists. | +| `HTTP_PROXY` | `string` | "" (empty) | HTTP proxy server (non-TLS requests) | +| `HTTPS_PROXY` | `string` | "" (empty) | HTTPS proxy server (TLS requests) | +| `NO_PROXY` | `string` | "" (empty) | Opt out of proxying HTTP/HTTPS requests | +| `VERBOSE` | `string` | `false` | Log the commands executed | +| `USER_HOME` | `string` | `/home/git` | Absolute path to the Git user home directory | + +# Results + +The following results are produced by this Task. + +| Name | Description | +| :--- | :---------- | +| `COMMIT` | The precise commit SHA digest cloned | +| `URL` | The precise repository URL | +| `COMMITTER_DATE` | The epoch timestamp of the commit cloned | + +[dotSSHDirectory]: https://man.openbsd.org/sshd#FILES +[gitCloneDepath]: https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt +[gitConfig]: https://git-scm.com/docs/git-config#FILES +[gitCredentials]: https://git-scm.com/docs/git-credential-store#Documentation/git-credential-store.txt-git-credentials +[gitHTTPSSLVerify]: https://git-scm.com/docs/git-config#Documentation/git-config.txt-httpsslVerify +[gitSparseCheckout]: https://git-scm.com/docs/git-sparse-checkout#_description +[gitSSLCAInfo]: https://git-scm.com/docs/git-config#Documentation/git-config.txt-httpsslCAInfo +[k8sPVC]: https://kubernetes.io/docs/concepts/storage/persistent-volumes/ +[tektonAuthentication]: https://tekton.dev/docs/pipelines/auth/ +[tektonPVC]: https://tekton.dev/docs/pipelines/workspaces/#using-persistentvolumeclaims-as-volumesource +[tektonWorkspaceSecret]: https://tekton.dev/docs/pipelines/workspaces/#secret +[tlsCA]: https://en.wikipedia.org/wiki/Certificate_authority diff --git a/experimental/tasks/task-git/0.1.0/task-git.yaml b/experimental/tasks/task-git/0.1.0/task-git.yaml new file mode 100644 index 00000000..acd9fd13 --- /dev/null +++ b/experimental/tasks/task-git/0.1.0/task-git.yaml @@ -0,0 +1,250 @@ +--- +# Source: task-git/templates/task.yaml +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + name: git + labels: + app.kubernetes.io/version: 0.1.0 + annotations: + tekton.dev/categories: Git + tekton.dev/displayName: git + tekton.dev/pipelines.minVersion: 0.38.0 + tekton.dev/platforms: linux/amd64,linux/s390x,linux/ppc64le,linux/arm64 + tekton.dev/tags: git +spec: + description: | + This Task represents Git and is able to initialize and clone a remote repository on the informed Workspace. It's likely to become the first `step` on a Pipeline. + + workspaces: + - name: output + description: | + The Git repository directory, data will be placed on the root of the + Workspace, or on the relative path defined by the SUBDIRECTORY + parameter. + - name: ssh-directory + optional: true + description: | + A `.ssh` directory with private key, `known_hosts`, `config`, etc. + Copied to the Git user's home before cloning the repository, in order to + server as authentication mechanismBinding a Secret to this Workspace is + strongly recommended over other volume types. + - name: basic-auth + optional: true + description: | + A Workspace containing a `.gitconfig` and `.git-credentials` files. + These will be copied to the user's home before Git commands run. All + other files in this Workspace are ignored. It is strongly recommended to + use `ssh-directory` over `basic-auth` whenever possible, and to bind a + Secret to this Workspace over other volume types. + - name: ssl-ca-directory + optional: true + description: | + A Workspace containing CA certificates, this will be used by Git to + verify the peer with when interacting with remote repositories using + HTTPS. + + params: + - name: URL + type: string + description: | + Git repository URL. + - name: REVISION + type: string + default: main + description: | + Revision to checkout, an branch, tag, sha, ref, etc... + - name: REFSPEC + default: "" + description: | + Repository `refspec` to fetch before checking out the revision. + - name: SUBMODULES + type: string + default: "true" + description: | + Initialize and fetch Git submodules. + - name: DEPTH + type: string + default: "1" + description: | + Number of commits to fetch, a "shallow clone" is a single commit. + - name: SSL_VERIFY + type: string + default: "true" + description: | + Sets the global `http.sslVerify` value, `false` is not advised unless + you trust the remote repository. + - name: CRT_FILENAME + type: string + default: ca-bundle.crt + description: | + Certificate Authority (CA) bundle filename on the `ssl-ca-directory` + Workspace. + - name: SUBDIRECTORY + type: string + default: "" + description: | + Relative path to the `output` Workspace where the repository will be + cloned. + - name: SPARSE_CHECKOUT_DIRECTORIES + type: string + default: "" + description: | + List of directory patterns split by comma to perform "sparse checkout". + - name: DELETE_EXISTING + type: string + default: "true" + description: | + Clean out the contents of the `output` Workspace before cloning the + repository, if data exists. + - name: HTTP_PROXY + type: string + default: "" + description: | + HTTP proxy server (non-TLS requests). + - name: HTTPS_PROXY + type: string + default: "" + description: | + HTTPS proxy server (TLS requests). + - name: NO_PROXY + type: string + default: "" + description: | + Opt out of proxying HTTP/HTTPS requests. + - name: VERBOSE + type: string + default: "false" + description: | + Log the commands executed. + - name: USER_HOME + type: string + default: "/home/git" + description: | + Absolute path to the Git user home directory. + + results: + - name: COMMIT + description: | + The precise commit SHA digest cloned. + - name: URL + description: | + The precise repository URL. + - name: COMMITTER_DATE + description: | + The epoch timestamp of the commit cloned. + + volumes: + - name: user-home + emptyDir: {} + - name: scripts-dir + emptyDir: {} + + stepTemplate: + env: + + - name: PARAMS_URL + value: "$(params.URL)" + - name: PARAMS_REVISION + value: "$(params.REVISION)" + - name: PARAMS_REFSPEC + value: "$(params.REFSPEC)" + - name: PARAMS_SUBMODULES + value: "$(params.SUBMODULES)" + - name: PARAMS_DEPTH + value: "$(params.DEPTH)" + - name: PARAMS_SSL_VERIFY + value: "$(params.SSL_VERIFY)" + - name: PARAMS_CRT_FILENAME + value: "$(params.CRT_FILENAME)" + - name: PARAMS_SUBDIRECTORY + value: "$(params.SUBDIRECTORY)" + - name: PARAMS_SPARSE_CHECKOUT_DIRECTORIES + value: "$(params.SPARSE_CHECKOUT_DIRECTORIES)" + - name: PARAMS_DELETE_EXISTING + value: "$(params.DELETE_EXISTING)" + - name: PARAMS_HTTP_PROXY + value: "$(params.HTTP_PROXY)" + - name: PARAMS_HTTPS_PROXY + value: "$(params.HTTPS_PROXY)" + - name: PARAMS_NO_PROXY + value: "$(params.NO_PROXY)" + - name: PARAMS_VERBOSE + value: "$(params.VERBOSE)" + - name: PARAMS_USER_HOME + value: "$(params.USER_HOME)" + - name: WORKSPACES_OUTPUT_PATH + value: "$(workspaces.output.path)" + - name: WORKSPACES_SSH_DIRECTORY_BOUND + value: "$(workspaces.ssh-directory.bound)" + - name: WORKSPACES_SSH_DIRECTORY_PATH + value: "$(workspaces.ssh-directory.path)" + - name: WORKSPACES_BASIC_AUTH_BOUND + value: "$(workspaces.basic-auth.bound)" + - name: WORKSPACES_BASIC_AUTH_PATH + value: "$(workspaces.basic-auth.path)" + - name: WORKSPACES_SSL_CA_DIRECTORY_BOUND + value: "$(workspaces.ssl-ca-directory.bound)" + - name: WORKSPACES_SSL_CA_DIRECTORY_PATH + value: "$(workspaces.ssl-ca-directory.path)" + - name: RESULTS_COMMITTER_DATE_PATH + value: "$(results.COMMITTER_DATE.path)" + - name: RESULTS_COMMIT_PATH + value: "$(results.COMMIT.path)" + - name: RESULTS_URL_PATH + value: "$(results.URL.path)" + resources: + limits: + cpu: 100m + memory: 256Mi + requests: + cpu: 100m + memory: 256Mi + securityContext: + runAsNonRoot: true + runAsUser: 65532 + + steps: + - name: load-scripts + image: gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init:latest + workingDir: /scripts + script: | + printf '%s' "IyEvdXNyL2Jpbi9lbnYgc2gKCmV4cG9ydCBQQVJBTVNfVVJMPSIke1BBUkFNU19VUkw6LX0iCmV4cG9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b25lZCByZXBvc2l0b3J5IGluZm9ybWF0aW9uICgnJHtjaGVja291dF9kaXJ9JykiCgpjZCAiJHtjaGVja291dF9kaXJ9IiB8fCBmYWlsICJOb3QgYWJsZSB0byBlbnRlciBjaGVja291dC1kaXIgJyR7Y2hlY2tvdXRfZGlyfSciCgpwaGFzZSAiU2V0dGluZyBvdXRwdXQgd29ya3NwYWNlIGFzIHNhZmUgZGlyZWN0b3J5ICgnJHtXT1JLU1BBQ0VTX09VVFBVVF9QQVRIfScpIgpnaXQgY29uZmlnIC0tZ2xvYmFsIC0tYWRkIHNhZmUuZGlyZWN0b3J5ICIke1dPUktTUEFDRVNfT1VUUFVUX1BBVEh9IgoKcmVzdWx0X3NoYT0iJChnaXQgcmV2LXBhcnNlIEhFQUQpIgpyZXN1bHRfY29tbWl0dGVyX2RhdGU9IiQoZ2l0IGxvZyAtMSAtLXByZXR0eT0lY3QpIgoKcGhhc2UgIlJlcG9ydGluZyBsYXN0IGNvbW1pdCBkYXRlICcke3Jlc3VsdF9jb21taXR0ZXJfZGF0ZX0nIgpwcmludGYgIiVzIiAiJHtyZXN1bHRfY29tbWl0dGVyX2RhdGV9IiA+JHtSRVNVTFRTX0NPTU1JVFRFUl9EQVRFX1BBVEh9CgpwaGFzZSAiUmVwb3J0aW5nIHBhcnNlZCByZXZpc2lvbiBTSEEgJyR7cmVzdWx0X3NoYX0nIgpwcmludGYgIiVzIiAiJHtyZXN1bHRfc2hhfSIgPiR7UkVTVUxUU19DT01NSVRfUEFUSH0KCnBoYXNlICJSZXBvcnRpbmcgcmVwb3NpdG9yeSBVUkwgJyR7UEFSQU1TX1VSTH0nIgpwcmludGYgIiVzIiAiJHtQQVJBTVNfVVJMfSIgPiR7UkVTVUxUU19VUkxfUEFUSH0KCmV4aXQgMA==" |base64 -d >report.sh + chmod +x "report.sh" + volumeMounts: + - name: scripts-dir + mountPath: /scripts + + - name: prepare + image: gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init:latest + command: + - /scripts/prepare.sh + volumeMounts: + - name: scripts-dir + mountPath: /scripts + - name: user-home + mountPath: $(params.USER_HOME) + + - name: git-clone + image: gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init:latest + command: + - /scripts/git-clone.sh + volumeMounts: + - name: scripts-dir + mountPath: /scripts + - name: user-home + mountPath: $(params.USER_HOME) + + - name: report + image: gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init:latest + command: + - /scripts/report.sh + volumeMounts: + - name: scripts-dir + mountPath: /scripts diff --git a/experimental/tasks/task-git/0.2.0/README.md b/experimental/tasks/task-git/0.2.0/README.md new file mode 100644 index 00000000..60f0bdb6 --- /dev/null +++ b/experimental/tasks/task-git/0.2.0/README.md @@ -0,0 +1,155 @@ +

+ + GitHub Test Workflow Status + + + GitHub release (latest by date) + +

+ +`git` Tekton Task +----------------- + +The `git` Task will clone and prepare a Git repository on the `output` Workspace. By default the Git repository (`URL`) will be cloned on the root of the Workspace, but you can alter the clone location using the `SUBDIRECTORY` parameter, and [other settings](#parameters). + +A quick usage example is: + +```yaml +--- +apiVersion: tekton.dev/v1beta1 +kind: TaskRun +metadata: {} +spec: + taskRef: + name: git + params: + - name: URL + value: https://github.com/openshift-pipelines/task-git.git + workspaces: + - name: output + emptyDir: {} +``` + +Please consider the [Workspaces](#workspaces), [Parameters](#parameters) and [Results](#results) described below. + +# Workspaces + +A single Workspace is required for this Task, while the optional Workspaces will allow advanced Git configuration and authentication. + +## `output` + +The `output` is a required Workspace, represents the primary location where the Git repository data will be stored, and later on, this Workspace will be monted in subsequent Pipeline's Task. + +Knowing the Workspace data will be employed on other Tasks, the recommended approach is using a [persistent volume][tektonPVC], for instance a [`PersistentVolumeClaim` (PVC)][k8sPVC]. + +## Authentication Workspaces + +The recommended approach to authentication is using the [default mechanisms supported by Tekton Pipeline][tektonAuthentication], please consider it as your first option. + +More advanced use-cases may require different methods of interacting with private repositories, the following Workspaces are meant to support advanced Git configuration and authentication. + +### `basic-auth` (HTTP/SSH) + +The `basic-auth` is a optional Workspace to provide Git credentials and configuration. + +The following Workspace files (items) are shared with Git before cloning the repository, the Task copies the files to the Git user home directory, configured by the parameter `USER_HOME`. + +| Workspace File | Required | Description | +| :----------------- | :------: | :------------------------------------- | +| `.git-credentials` | `true` | [Git credentials file][gitCredentials] | +| `.gitconfig` | `true` | [Git configuration file][gitConfig] | + +Typically, this type of data is stored as a Kubernetes Secret. For example: + +```bash +kubectl create secret generic basic-auth-ex \ + --from-file=".git-credentials=${HOME}/.git-credentials" \ + --from-file=".gitconfig=${HOME}/.gitconfig" +``` + +Then, you can [reference the Secret][tektonWorkspaceSecret] as the `basic-auth` Workspace. + +### `ssh-directory` (SSH) + +The `ssh-directory` is a optional Workspace, meant to store the files commonly found on a [`~/.ssh` directory][dotSSHDirectory], when informed, the whole directory will be copied into the Git's home (configured by the parameter `USER_HOME`). + +During the `prepare` step you can see the details about what's being copied, please consider the output log snippet below. For more verbose logging set the peramater `VERBOSE` to `true`. + +``` +---> Phase: Copying '.ssh' from ssh-directory workspace ('/workspaces/ssh-directory')... +'/workspaces/ssh-directory' -> '/home/git/.ssh' +'/workspaces/ssh-directory/config' -> '/home/git/.ssh/config' +mode of '/home/git/.ssh' changed from 0755 (rwxr-xr-x) to 0700 (rwx------) +mode of '/home/git/.ssh/config' changed from 0644 (rw-r--r--) to 0400 (r--------) + +``` + +It's recommended storing this type of data as a Kubernetes Secret, like the following example: + +```bash +kubectl create secret generic ssh-directory-ex \ + --from-file="config=${HOME}/.ssh/config" \ + --from-file="authorized_keys=${HOME}/.ssh/authorized_keys" +``` + +Then, you can [reference the Secret][tektonWorkspaceSecret] as the `ssh-directory` Workspace. + +### `ssl-ca-directory` (mTLS) + +The `ssl-ca-directory` is a optional Workspace to store a additional [Certificate Authority (CA)][tlsCA] bundles, commonly `.pem` or `.crt` files. The exact bundle file name is defined by the parameter `CRT_FILENAME`. + +Before running the Git clone command, the [`GIT_SSL_CAINFO` environment variable][gitSSLCAInfo] is exported with the full path to the `CRT_FILENAME` in the `ssl-ca-directory` Workspace. + +You can observe the setting taking place on the beggining of the `git-clone` step: + +``` +phase 'Exporting custom CA certificate "GIT_SSL_CAINFO=/workspaces/ssl-ca-directory/ca-bundle.crt"' +``` + +This is a sensitive information and therefore it's recommended to store as a Kubernetes Secret, please consider the previous examples to create Secrets with the `--from-file` option. + +Finally, you can [reference the Secret][tektonWorkspaceSecret] as the `ssl-ca-directory` Workspace. + +# Parameters + +The following parameters are supported by this Task. + +| Parameter | Type | Default | Description | +| :-------- | :---: | :------ | :---------- | +| `URL` | `string` | (required) | Git repository URL| +| `REVISION` | `string` | `main` | Revision to checkout, an branch, tag, sha, ref, etc... | +| `SUBMODULES` | `string` | `true` | Initialize and fetch Git submodules | +| `DEPTH` | `string` | `1` | [Number of commits to fetch][gitCloneDepath], a "shallow clone" is a single commit | +| `SSL_VERIFY` | `string` | `true` | Sets the global [`http.sslVerify`][gitHTTPSSLVerify] value, `false` is not advised unless you trust the remote repository | +| `CRT_FILENAME` | `string` | `ca-bundle.crt` | Certificate Authority (CA) bundle filename on the `ssl-ca-directory` Workspace. | +| `SUBDIRECTORY` | `string` | "" (empty) | Relative path to the `output` Workspace where the repository will be cloned | +| `SPARSE_CHECKOUT_DIRECTORIES` | `string` | "" (empty) | List of directory patterns split by comma to perform ["sparse checkout"][gitSparseCheckout] | +| `DELETE_EXISTING` | `string` | `true` | Clean out the contents of the `output` Workspace before cloning the repository, if data exists. | +| `HTTP_PROXY` | `string` | "" (empty) | HTTP proxy server (non-TLS requests) | +| `HTTPS_PROXY` | `string` | "" (empty) | HTTPS proxy server (TLS requests) | +| `NO_PROXY` | `string` | "" (empty) | Opt out of proxying HTTP/HTTPS requests | +| `VERBOSE` | `string` | `false` | Log the commands executed | +| `USER_HOME` | `string` | `/home/git` | Absolute path to the Git user home directory | + +# Results + +The following results are produced by this Task. + +| Name | Description | +| :--- | :---------- | +| `COMMIT` | The precise commit SHA digest cloned | +| `URL` | The precise repository URL | +| `COMMITTER_DATE` | The epoch timestamp of the commit cloned | + +[dotSSHDirectory]: https://man.openbsd.org/sshd#FILES +[gitCloneDepath]: https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt +[gitConfig]: https://git-scm.com/docs/git-config#FILES +[gitCredentials]: https://git-scm.com/docs/git-credential-store#Documentation/git-credential-store.txt-git-credentials +[gitHTTPSSLVerify]: https://git-scm.com/docs/git-config#Documentation/git-config.txt-httpsslVerify +[gitSparseCheckout]: https://git-scm.com/docs/git-sparse-checkout#_description +[gitSSLCAInfo]: https://git-scm.com/docs/git-config#Documentation/git-config.txt-httpsslCAInfo +[k8sPVC]: https://kubernetes.io/docs/concepts/storage/persistent-volumes/ +[tektonAuthentication]: https://tekton.dev/docs/pipelines/auth/ +[tektonPVC]: https://tekton.dev/docs/pipelines/workspaces/#using-persistentvolumeclaims-as-volumesource +[tektonWorkspaceSecret]: https://tekton.dev/docs/pipelines/workspaces/#secret +[tlsCA]: https://en.wikipedia.org/wiki/Certificate_authority diff --git a/experimental/tasks/task-git/0.2.0/task-git.yaml b/experimental/tasks/task-git/0.2.0/task-git.yaml new file mode 100644 index 00000000..b6db8430 --- /dev/null +++ b/experimental/tasks/task-git/0.2.0/task-git.yaml @@ -0,0 +1,250 @@ +--- +# Source: task-git/templates/task.yaml +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + name: git + labels: + app.kubernetes.io/version: 0.2.0 + annotations: + tekton.dev/categories: Git + tekton.dev/displayName: git + tekton.dev/pipelines.minVersion: 0.41.0 + tekton.dev/platforms: linux/amd64,linux/s390x,linux/ppc64le,linux/arm64 + tekton.dev/tags: git +spec: + description: | + This Task represents Git and is able to initialize and clone a remote repository on the informed Workspace. It's likely to become the first `step` on a Pipeline. + + workspaces: + - name: output + description: | + The Git repository directory, data will be placed on the root of the + Workspace, or on the relative path defined by the SUBDIRECTORY + parameter. + - name: ssh-directory + optional: true + description: | + A `.ssh` directory with private key, `known_hosts`, `config`, etc. + Copied to the Git user's home before cloning the repository, in order to + server as authentication mechanismBinding a Secret to this Workspace is + strongly recommended over other volume types. + - name: basic-auth + optional: true + description: | + A Workspace containing a `.gitconfig` and `.git-credentials` files. + These will be copied to the user's home before Git commands run. All + other files in this Workspace are ignored. It is strongly recommended to + use `ssh-directory` over `basic-auth` whenever possible, and to bind a + Secret to this Workspace over other volume types. + - name: ssl-ca-directory + optional: true + description: | + A Workspace containing CA certificates, this will be used by Git to + verify the peer with when interacting with remote repositories using + HTTPS. + + params: + - name: URL + type: string + description: | + Git repository URL. + - name: REVISION + type: string + default: main + description: | + Revision to checkout, an branch, tag, sha, ref, etc... + - name: REFSPEC + default: "" + description: | + Repository `refspec` to fetch before checking out the revision. + - name: SUBMODULES + type: string + default: "true" + description: | + Initialize and fetch Git submodules. + - name: DEPTH + type: string + default: "1" + description: | + Number of commits to fetch, a "shallow clone" is a single commit. + - name: SSL_VERIFY + type: string + default: "true" + description: | + Sets the global `http.sslVerify` value, `false` is not advised unless + you trust the remote repository. + - name: CRT_FILENAME + type: string + default: ca-bundle.crt + description: | + Certificate Authority (CA) bundle filename on the `ssl-ca-directory` + Workspace. + - name: SUBDIRECTORY + type: string + default: "" + description: | + Relative path to the `output` Workspace where the repository will be + cloned. + - name: SPARSE_CHECKOUT_DIRECTORIES + type: string + default: "" + description: | + List of directory patterns split by comma to perform "sparse checkout". + - name: DELETE_EXISTING + type: string + default: "true" + description: | + Clean out the contents of the `output` Workspace before cloning the + repository, if data exists. + - name: HTTP_PROXY + type: string + default: "" + description: | + HTTP proxy server (non-TLS requests). + - name: HTTPS_PROXY + type: string + default: "" + description: | + HTTPS proxy server (TLS requests). + - name: NO_PROXY + type: string + default: "" + description: | + Opt out of proxying HTTP/HTTPS requests. + - name: VERBOSE + type: string + default: "false" + description: | + Log the commands executed. + - name: USER_HOME + type: string + default: "/home/git" + description: | + Absolute path to the Git user home directory. + + results: + - name: COMMIT + description: | + The precise commit SHA digest cloned. + - name: URL + description: | + The precise repository URL. + - name: COMMITTER_DATE + description: | + The epoch timestamp of the commit cloned. + + volumes: + - name: user-home + emptyDir: {} + - name: scripts-dir + emptyDir: {} + + stepTemplate: + env: + + - name: PARAMS_URL + value: "$(params.URL)" + - name: PARAMS_REVISION + value: "$(params.REVISION)" + - name: PARAMS_REFSPEC + value: "$(params.REFSPEC)" + - name: PARAMS_SUBMODULES + value: "$(params.SUBMODULES)" + - name: PARAMS_DEPTH + value: "$(params.DEPTH)" + - name: PARAMS_SSL_VERIFY + value: "$(params.SSL_VERIFY)" + - name: PARAMS_CRT_FILENAME + value: "$(params.CRT_FILENAME)" + - name: PARAMS_SUBDIRECTORY + value: "$(params.SUBDIRECTORY)" + - name: PARAMS_SPARSE_CHECKOUT_DIRECTORIES + value: "$(params.SPARSE_CHECKOUT_DIRECTORIES)" + - name: PARAMS_DELETE_EXISTING + value: "$(params.DELETE_EXISTING)" + - name: PARAMS_HTTP_PROXY + value: "$(params.HTTP_PROXY)" + - name: PARAMS_HTTPS_PROXY + value: "$(params.HTTPS_PROXY)" + - name: PARAMS_NO_PROXY + value: "$(params.NO_PROXY)" + - name: PARAMS_VERBOSE + value: "$(params.VERBOSE)" + - name: PARAMS_USER_HOME + value: "$(params.USER_HOME)" + - name: WORKSPACES_OUTPUT_PATH + value: "$(workspaces.output.path)" + - name: WORKSPACES_SSH_DIRECTORY_BOUND + value: "$(workspaces.ssh-directory.bound)" + - name: WORKSPACES_SSH_DIRECTORY_PATH + value: "$(workspaces.ssh-directory.path)" + - name: WORKSPACES_BASIC_AUTH_BOUND + value: "$(workspaces.basic-auth.bound)" + - name: WORKSPACES_BASIC_AUTH_PATH + value: "$(workspaces.basic-auth.path)" + - name: WORKSPACES_SSL_CA_DIRECTORY_BOUND + value: "$(workspaces.ssl-ca-directory.bound)" + - name: WORKSPACES_SSL_CA_DIRECTORY_PATH + value: "$(workspaces.ssl-ca-directory.path)" + - name: RESULTS_COMMITTER_DATE_PATH + value: "$(results.COMMITTER_DATE.path)" + - name: RESULTS_COMMIT_PATH + value: "$(results.COMMIT.path)" + - name: RESULTS_URL_PATH + value: "$(results.URL.path)" + resources: + limits: + cpu: 100m + memory: 256Mi + requests: + cpu: 100m + memory: 256Mi + securityContext: + runAsNonRoot: true + runAsUser: 65532 + + steps: + - name: load-scripts + image: registry.redhat.io/openshift-pipelines/pipelines-git-init-rhel8@sha256:c4b2183f7c7997bd401d86b33eefb637b3ef2fa90618e875106292cd69a15c14 + workingDir: /scripts + script: | + printf '%s' "IyEvdXNyL2Jpbi9lbnYgc2gKCmV4cG9ydCBQQVJBTVNfVVJMPSIke1BBUkFNU19VUkw6LX0iCmV4cG9ydCBQQVJBTVNfUkVWSVNJT049IiR7UEFSQU1TX1JFVklTSU9OOi19IgpleHBvcnQgUEFSQU1TX1JFRlNQRUM9IiR7UEFSQU1TX1JFRlNQRUM6LX0iCmV4cG9ydCBQQVJBTVNfU1VCTU9EVUxFUz0iJHtQQVJBTVNfU1VCTU9EVUxFUzotfSIKZXhwb3J0IFBBUkFNU19ERVBUSD0iJHtQQVJBTVNfREVQVEg6LX0iCmV4cG9ydCBQQVJBTVNfU1NMX1ZFUklGWT0iJHtQQVJBTVNfU1NMX1ZFUklGWTotfSIKZXhwb3J0IFBBUkFNU19DUlRfRklMRU5BTUU9IiR7UEFSQU1TX0NSVF9GSUxFTkFNRTotfSIKZXhwb3J0IFBBUkFNU19TVUJESVJFQ1RPUlk9IiR7UEFSQU1TX1NVQkRJUkVDVE9SWTotfSIKZXhwb3J0IFBBUkFNU19TUEFSU0VfQ0hFQ0tPVVRfRElSRUNUT1JJRVM9IiR7UEFSQU1TX1NQQVJTRV9DSEVDS09VVF9ESVJFQ1RPUklFUzotfSIKZXhwb3J0IFBBUkFNU19ERUxFVEVfRVhJU1RJTkc9IiR7UEFSQU1TX0RFTEVURV9FWElTVElORzotfSIKZXhwb3J0IFBBUkFNU19IVFRQX1BST1hZPSIke1BBUkFNU19IVFRQX1BST1hZOi19IgpleHBvcnQgUEFSQU1TX0hUVFBTX1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Wx0X3NoYX0nIgpwcmludGYgIiVzIiAiJHtyZXN1bHRfc2hhfSIgPiR7UkVTVUxUU19DT01NSVRfUEFUSH0KCnBoYXNlICJSZXBvcnRpbmcgcmVwb3NpdG9yeSBVUkwgJyR7UEFSQU1TX1VSTH0nIgpwcmludGYgIiVzIiAiJHtQQVJBTVNfVVJMfSIgPiR7UkVTVUxUU19VUkxfUEFUSH0KCmV4aXQgMA==" |base64 -d >report.sh + chmod +x "report.sh" + volumeMounts: + - name: scripts-dir + mountPath: /scripts + + - name: prepare + image: registry.redhat.io/openshift-pipelines/pipelines-git-init-rhel8@sha256:c4b2183f7c7997bd401d86b33eefb637b3ef2fa90618e875106292cd69a15c14 + command: + - /scripts/prepare.sh + volumeMounts: + - name: scripts-dir + mountPath: /scripts + - name: user-home + mountPath: $(params.USER_HOME) + + - name: git-clone + image: registry.redhat.io/openshift-pipelines/pipelines-git-init-rhel8@sha256:c4b2183f7c7997bd401d86b33eefb637b3ef2fa90618e875106292cd69a15c14 + command: + - /scripts/git-clone.sh + volumeMounts: + - name: scripts-dir + mountPath: /scripts + - name: user-home + mountPath: $(params.USER_HOME) + + - name: report + image: registry.redhat.io/openshift-pipelines/pipelines-git-init-rhel8@sha256:c4b2183f7c7997bd401d86b33eefb637b3ef2fa90618e875106292cd69a15c14 + command: + - /scripts/report.sh + volumeMounts: + - name: scripts-dir + mountPath: /scripts