Clone a Git repository into pipeline runtime environment.
Git account and repository should be provided while creating a pipeline. The account and the repository will be automatically used in the Git Clone step while executing the pipeline.
Git Clone step uses Git accounts connected within Microtica Portal to obtain temporary access credentials.
Credentials for the specified Git repository will be automatically provided by Microtica.
steps: step-name: type: git-clone clone_dir: sub/folder/
|title||The display name of the step.||No|
|type||The type of the Microtica built-in step.|
Should always be git-clone for this type of step.
|clone_dir||Path to where the source code should be cloned.|
Current working dir of the pipeline runtime environment.
#Clone a source code from a Git repository
When using the built-in step Git Clone, the Git account and repository provided while creating the pipeline will be automatically used in the step.
In the following example, the Clone step will clone the master branch from microtica/app repository hosted on Microtica Git account.
So, if you run ls -l command in the next step you should be able to see the content of the source code root dir.
steps: Clone: type: git-clone ListContent: image: alpine:latest commands: - ls -l
#Clone into sub directory
By default the source code will be cloned in the current working dir of the pipeline runtime environment. If you need to store the code in a different directory you can achieve that by using clone_dir parameter.
steps: Clone: type: git-clone clone_dir: sub/folder ListContent: image: alpine:latest commands: - cd sub/folder - ls -l
So, if you navigate to sub/folder and run ls -l command in the next step you should be able to see the content of the source code root dir.