1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-22 06:02:51 +00:00
catalog/task/git-cli/0.1
Yulia Gaponenko bbcc51cefc Use multi-arch alpine/git image for git-cli and git-rebase
Image sha specified in git-cli and git-rebase tasks is for
amd64 version of alpine/git:v2.26.2 image. The image is actually
multi-arch one.
Replacement of image sha to point to multi-arch version will allow to
use the same catalog task for many hardware acrhitectures.

Signed-off-by: Yulia Gaponenko <yulia.gaponenko1@de.ibm.com>
2021-01-28 12:38:41 +00:00
..
samples Moved samples to their correct place and modified a few files 2020-11-18 17:55:28 +00:00
tests Fix git cli tests 2020-07-16 18:35:59 +01:00
git-cli.yaml Use multi-arch alpine/git image for git-cli and git-rebase 2021-01-28 12:38:41 +00:00
README.md Fixed typo 2020-09-17 11:52:24 +01:00

Git Task

This Task is Git task to work with repositories used by other tasks in your Pipeline.

git-cli

This task can be used to perform git operations. All git commands can be found here.

Command that needs to be run can be passed as a script to the task.

Workspaces

  • source: A workspace that contains the fetched git repository.
  • input: A workspace that contains file that needs to be added to git.

Parameters

  • BASE_IMAGE: The base image for the task. (default: alpine/git:latest)
  • GIT_USER_NAME: Git user name for performing git operation.
  • GIT_USER_EMAIL: Git user email for performing git operation.
  • GIT_SCRIPT: The git script to run. (required)

Results

  • commit: The precise commit SHA after git operation is performed.

Usage

This task needs authentication to git in order to push after the git operation. This can be done via secrets and service account. Refer this example to create secret and service account for the git authentication.

After creating the task, you should now be able to execute git commands by specifying the command you would like to run as the GIT_SCRIPT param.

Example:

  params:
    - name: GIT_SCRIPT
      value: |
        git init
        git remote add origin https://github.com/kelseyhightower/nocode
        git pull origin master        

Git Pipeline can be referred to use this task in the pipeline.

NOTE

  • If two factor authentication is enabled in your git account, then access-token for the respective git platform must be provided in the password field while adding secrets.