Add Git Sources to runtimes
A Git Source is the equivalent of an Argo CD application that tracks a Git repository and syncs the desired state of the repo to the destination K8s cluster. In addition to application resources, the Git Source can store resources for Codefresh runtimes, and CI/CD entities such as delivery pipelines, Workflow Templates, workflows, and applications.
Provisioning a runtime automatically creates a Git Source that stores resources for the runtime and for the demo CI pipelines that are optionally installed with the runtime. Every Git Source is associated with a Codefresh runtime. A runtime can have one or more Git Sources. You can add Git Sources at any time, to the same or to different runtimes.
Once you create a Git Source for a runtime, you can store resources for CI/CD entities associated with that runtime. For example, when creating pipelines or applications, you can select the Git Source to which to store manifest definitions.
View Git Sources and definitions
Drill down on a runtime in List View to see its Git Sources.
- In the Codefresh UI, go to the Runtimes page.
- From the List View (the default), select a runtime name, and then select the Git Sources tab.
- To go to the repo tracked by the Git Source, in the Repo column, mouse over the repo name and select Go to Git repo.
- To see the definitions for the Git Source, select the three dots at the end of the row.
Create a Git Source
Create Git Sources for any provisioned runtime. The Git Sources are available to store resources for pipelines or applications when you create them.
Make sure you are in the List View to create Git Sources.
- In the Codefresh UI, go to Runtimes.
- In the List View, select the runtime for which to add a Git Source, and then select the Git Sources tab.
- Select Create Git Sources, and in the Create Git Source panel, define the definitions for the Git Source:
- Git Source Name: The name of the Git Source, which must be unique within the cluster.
- Source: The Git repo with the desired state, tracked by the Git Source, and synced to the destination cluster.
- Repository: Mandatory. The URL to the Git repo.
- Branch: Optional. The specific branch within the repo to track.
- Path: Optional. The specific path within the repo, and branch, if one is specified, to track.
- Destination: The destination cluster with the actual state to which to apply the changes from the Source.
- Namespace: The namespace in the destination cluster to which to sync the changes.
- Include Files and Exclude Files: The file or files to include or exclude from the Git repo when syncing to the destination cluster.
Use GLOB to define patterns using wildcards to match path names in the source Git repo.
For example,workflows/**/*.yaml
, in the Include Files field would include all files in theworkflows
directory and all its child directories, with.yaml
as the extension.
**/images/**/*
in the Exclude Files field, would ignore all directories entitledimages
.
For GLOB guidelines and examples, see this article.
- Select + Create Git Source.
Edit Git Source definitions
Edit an existing Git Source by changing the source and destination definitions.
You cannot change the name of the Git Source.
- In the Codefresh UI, go to Runtimes.
- From the List View (the default), select the runtime with the Git Source, and then select the Git Sources tab.
- In the row with the Git Source to edit, select the three dots, and then select Edit in the panel that appears.
- Change the Source and Destination definitions for the Git Source, and select Save.
View/download logs for a Git Source
View online logs for any Git Source associated with a runtime, and if needed, download the log file for offline viewing and analysis. Online logs show up to 1000 of the most recent events (lines), updated in real time. Downloaded logs include all the events from the application launch to the date and time of download.
- In the Codefresh UI, go to Runtimes.
- From the List View (the default), select the runtime with the Git Source, and then select the Git Sources tab.
- In the row with the Git Source foe which to view/download logs, select the three dots, and then select View Logs.
- Do the following:
- Search by free-text for any string, and click the next and previous buttons to navigate between the search results.
- To toggle between standard and line-wrapped views, click Wrap.
- To download the log, click Download.
The file is downloaded with.log
extension.