You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _docs/pipelines/pipelines.md
+55-5Lines changed: 55 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,9 +112,54 @@ Notice that in the editor you can expand/collapse individual yaml blocks using t
112
112
113
113
##Loading codefresh.yml from Version Control
114
114
115
-
Working with the inline editor is very convenient in the beginning, but it makes your pipeline definition only exist within the Codefresh UI and therefore goes against the basic principles of[infrastructure as code](https://en.wikipedia.org/wiki/Infrastructure_as_Code){:target="\_blank"}. Once you are happy with how your pipeline works you should commit it to a Git repository (which can be the same one that has the source code of the application or a completely different one).
115
+
Working with the inline editor is very convenient in the beginning, but it makes your pipeline definition only exist within the Codefresh UI and therefore goes against the basic principles of[infrastructure as code](https://en.wikipedia.org/wiki/Infrastructure_as_Code){:target="\_blank"}.
116
116
117
-
You can click on the*Inline YAML* header and switch it to*Use YAML from URL* or*Use YAML from Repository*.
117
+
Once you are happy with how your pipeline works you should commit it to a Git repository, either the same one that has the source code of the application or a completely different one.
118
+
119
+
* From the**Inline YAML** dropdown, select**Use YAML from URL** or**Use YAML from Repository**.
Loading the pipeline from a Git repository is the recommended way to associate a pipeline with a project once you are finished with it. Even though the inline editor is great for quick prototyping and experimentation, ideally all your pipelines should be under source control.
134
+
135
+
Selecting**Use YAML from Repository**, allows you to select any Git repository already connected to Codefresh along with a preview of the pipeline.
Unlike other CI options, the Git repository that contains the pipeline can be completely different from the Git repository that has the source code of your application.
148
+
149
+
**Use branch from Git trigger**
150
+
151
+
The**Use branch from Git trigger** option is very important, as it defines the branch in the Git repo the pipeline is loaded from. In most cases, you want to keep this enabled as it loads the pipeline from the same branch that triggered the build.
152
+
153
+
For example, if you open a new pull request for a branch named`feature-x`, that has changes both in source code and in the pipeline definition itself, ideally you would want the pipeline responsible for the build to be the same one that contains the new changes in the`feature-x` branch.
154
+
155
+
If you disable this option, then you can select a specific branch from the field directly above the switch. The option is great for organizations that want to lock down their pipelines.
156
+
157
+
For example, if you define`master` as the branch to use for this pipeline, then even if a developer creates a custom branch for their source code changes, they will not be able to change the pipeline itself to do something different. Their pipeline changes in their own branch will be ignored as all builds will always load the pipeline from`master`. This can be very useful for security-sensitive pipelines.
158
+
159
+
160
+
###Using any public URL
161
+
162
+
The**Use YAML from URL** option allows you to load the pipeline definition from any_public_ URL.
You can then copy and paste a URL to a raw Codefresh YAML file. This will allow you to load a Codefresh YAML from any public URL. Notice that a raw URL is needed in the case of GitHub.
174
+
You can then copy and paste the URL to a raw Codefresh YAML file. This will allow you to load a Codefresh YAML from any URL.
175
+
130
176
131
-
As an example, instead of using`https://github.com/codefresh-contrib/example-voting-app/blob/master/codefresh.yml` you should enter`https://raw.githubusercontent.com/codefresh-contrib/example-voting-app/master/codefresh.yml`
177
+
>GitHub requires a raw URL.
178
+
As an example:
179
+
instead of using`https://github.com/codefresh-contrib/example-voting-app/blob/master/codefresh.yml`