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/integrations/git-providers.md
+82-63Lines changed: 82 additions & 63 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,6 @@ Currently Codefresh supports:
29
29
30
30
Atlassian Stash/Bitbucket server as well as the on-premises version of GitLab and GitHub are only available to Codefresh enterprise customers.
31
31
32
-
33
32
##Adding more Git providers to your Codefresh Account
34
33
35
34
By default, you have direct access to Git repositories that exist in the Git provider that you used while signing up for Codefresh. You can easily create Codefresh projects that checkout code from that Git provider without any extra configurations.
@@ -40,16 +39,16 @@ To add additional Git providers, go to your Account Configuration, by clicking o
40
39
41
40
You can add a new Git provider using the*Add Git provider* drop-down.
For the**OAuth2 method** you only need to decide on public/private repository access, enter a name for your connection and click*Save*. Then accept the permissions dialog. This is the easiest and recommended way to integrate GitHub. Notice that if
85
84
you used GitHub when you[created your Codefresh account]({{site.baseurl}}/docs/getting-started/create-a-codefresh-account/), this integration is already setup for you.
86
85
87
-
88
86
For the**Access Token** method you need
89
87
90
88
* A friendly name for the Git context (it can be anything you want)
@@ -100,12 +98,13 @@ The "token description" you enter in your GitHub account in order to create the
For GitHub on-premises you also need to provide the URL of the GitHub server in your organization. If enabled in your account you can setup[Pipeline definition restrictions]({{site.baseurl}}/docs/administration/access-control/#pipeline-definition-restrictions) by expanding the*YAML Options* segment.
116
115
117
-
118
-
###Using External Secrets for the Token
116
+
###Using External Secrets for GitHub Token
119
117
120
118
If your GitHub installation is behind your firewall, you can also
121
119
use any[external secrets that you have defined]({{site.baseurl}}/docs/integrations/secret-storage/) (such as Kubernetes secrets) as values by entering a secrets value
@@ -124,7 +122,9 @@ with the same syntax [shown in pipelines]({{site.baseurl}}/docs/configure-ci-cd-
124
122
For example if you already have a`token` on a resource call`git-credentials` you can put in the token field the expression {% raw %}`${{secrets.git-credentials.token}}`{% endraw %}.
125
123
126
124
###Level of Access
125
+
127
126
When the admin clicks off "Allow access to all users" another toggle appears; “Allow these credentials to be shared within a pipeline for cloning a repository“
127
+
128
128
1. When its turned on, the user that runs a pipeline will be able to clone the repo.
129
129
2. When its turned off, the user that runs a pipeline cannot use this integration.
130
130
In both cases, the user cannot decrypt the token used in Git integration with CLI or API.
@@ -151,20 +151,19 @@ An alternative way to authenticate with Github is via the App mechanism.
151
151
152
152
**Step 5** - Click*Test connection* to verify your integration and apply your changes with the*Save* button.
153
153
154
-
155
154
###Manual Creation
156
155
157
156
**Step 1** - Log in your Github account and visit[https://github.com/settings/apps](https://github.com/settings/apps). Click the*New GitHub App* button.
158
157
159
158
**Step 2** - On the New app screen
160
-
161
-
1. Give an arbitrary name to your app (e.g. codefresh-integration)
1. Uncheck the*Active* checkbox under the Webhook section
163
+
1. In the*Repository permissions* section give*Read/Write* access to*Contents*,*Webhooks* and*Issues*
164
+
1. Click the*Create GitHub app* button.
165
+
166
+
**Step 3** - In the next screen
168
167
169
168
1. Note down the*App ID* number under the*About* section
170
169
1. Click the*Generate a private key* button and save the file locally
@@ -185,7 +184,6 @@ For the required fields use:
185
184
186
185
Click*Test connection* to verify your integration and apply your changes with the*Save* button. If enabled in your account you can setup[Pipeline definition restrictions]({{site.baseurl}}/docs/administration/access-control/#pipeline-definition-restrictions) by expanding the*YAML Options* segment.
187
186
188
-
189
187
##GitLab
190
188
191
189
For the**OAuth2 method** you only need to enable private repository access, enter a name for your connection and click*Save*. Then accept the permissions dialog. This is the easiest and recommended way to integrate GitLab. Notice that if
@@ -196,7 +194,6 @@ For the **Access Key** method you need:
196
194
* A friendly name for the Git context (it can be anything you want.)
197
195
* An access token/key
198
196
199
-
200
197
To create an access token, go to your GitLab*settings* and select the*Access tokens* options.
201
198
For more information see the[GitLab Documentation page](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html){:target="_blank"}
202
199
@@ -207,7 +204,7 @@ now save the Git integration.
207
204
208
205
For GitLab on-premises you also need to provide the URL of the GitLab server in your organization. If enabled in your account you can setup[Pipeline definition restrictions]({{site.baseurl}}/docs/administration/access-control/#pipeline-definition-restrictions) by expanding the*YAML Options* segment.
209
206
210
-
###Usingexternal secrets forthe token
207
+
###UsingExternal Secrets forGitLab Token
211
208
212
209
If your GitLab installation is behind your firewall, you can also
213
210
use any[external secrets that you have defined]({{site.baseurl}}/docs/integrations/secret-storage/) (such as Kubernetes secrets) as values by entering a secrets value
@@ -231,45 +228,43 @@ Click the button to create one. For more information see the [Bitbucket Document
231
228
232
229
The minimum permissions needed by Codefresh are shown below.
The "label" you enter in your Bitbucket account in order to create the application password is completely arbitrary (use "Codefresh" for an example). Once you have the token, paste it in the Codefresh UI and click*Test connection*. If everything is OK you can
244
-
now save the Git integration.
241
+
now save the Git integration.
245
242
246
243
If enabled in your account you can setup[Pipeline definition restrictions]({{site.baseurl}}/docs/administration/access-control/#pipeline-definition-restrictions) by expanding the*YAML Options* segment.
247
244
248
245
##Azure DevOps
249
246
250
247
For Azure you need to create a[personal access token](https://docs.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/pats?view=azure-devops). Sign in your Azure DevOps account and click on your profile icon on the top right corner. Then select*Security*:
@@ -300,9 +295,9 @@ alt="Codefresh integration with Azure Devops"
300
295
Click on*Test connection* to verify your settings and finally click save. Now you can[create pipelines]({{site.baseurl}}/docs/configure-ci-cd-pipeline/pipelines/)
@@ -313,57 +308,81 @@ Your Azure DevOps repositories will be available when [creating a new project in
313
308
314
309
If enabled in your account you can setup[Pipeline definition restrictions]({{site.baseurl}}/docs/administration/access-control/#pipeline-definition-restrictions) by expanding the*YAML Options* segment.
315
310
316
-
##Atlassian Stash
311
+
##Atlassian Stash
317
312
318
313
Atlassian stash is only available for an on-premises connection. Follow the same instructions as Bitbucket.
319
314
You also need to provide the URL of the Stash server in your organization.
320
315
321
316
This option is only for Atlassian stash until version 3.10 which is the old version. It was then renamed
322
317
to Bitbucket server.
323
318
324
-
325
319
##Bitbucket Server
326
320
327
321
Bitbucket server is the new and current name of Atlassian Stash. Again, it is only available for an on-premises
328
322
installation.
329
323
330
324
Codefresh supports Bitbucket server versions 5.4.0+ since those expose the API used by the integration.
331
325
332
-
###Usingexternal secrets forthe token
326
+
###UsingExternal Secrets forBitBucket Token
333
327
334
328
If your Bitbucket Server installation is behind your firewall, you can also
335
329
use any[external secrets that you have defined]({{site.baseurl}}/docs/integrations/secret-storage/) (such as Kubernetes secrets) as values by entering a secrets value
336
330
with the same syntax[shown in pipelines]({{site.baseurl}}/docs/configure-ci-cd-pipeline/secrets-store/).
337
331
338
332
For example if you already have a`token` on a resource call`git-credentials` you can put in the token field the expression {% raw %}`${{secrets.git-credentials@token}}`{% endraw %}.
339
333
340
-
341
334
##Using your Git provider
342
335
343
336
Once your provider is active, you can add a new project into Codefresh and then during the[repository selection screen]({{site.baseurl}}/docs/getting-started/create-a-basic-pipeline/) you will have access to the additional Git providers.
344
337
345
-
{% include image.html
346
-
lightbox="true"
347
-
file="/images/integrations/git/select-git.png"
338
+
{% include image.html
339
+
lightbox="true"
340
+
file="/images/integrations/git/select-git.png"
348
341
url="/images/integrations/git/select-git.png"
349
342
max-width="60%"
350
343
caption="Select Git provider"
351
344
alt="Select Git provider"
352
345
%}
353
346
354
347
>Notice that for all supported Git providers Codefresh will automatically create all the webhooks needed for
355
-
triggering pipelines when a commit (or another event) happens.
348
+
triggering pipelines when a commit (or another event) happens.
356
349
357
350
After adding the repository Codefresh will behave exactly the same, regardless of the selected Git provider.
358
351
You will be able to[create pipelines]({{site.baseurl}}/docs/configure-ci-cd-pipeline/pipelines/) for different Git providers in exactly the same manner.
359
352
360
-
##What to read next
353
+
##ABAC for Git Contexts
354
+
355
+
**Account Level:** Pro and above
356
+
357
+
>At this time, you will need to reach out to support to enable ABAC for Git Context and[Pipeline Execution Context]({{site.baseurl}}/docs/administration/pipeline-execution-context/).
-[Checking out source code]({{site.baseurl}}/docs/yaml-examples/examples/git-checkout/)
359
+
ABAC for Git Context gives the ability to restrict using and handling of Git Contexts. We use tags on the git context to limit Teams and Execution Contexts for access control. There are four actions controlled by ABAC: Creating, Updating, Deleting, and Using Git Contexts.
366
360
361
+
The Using means the following use cases:
367
362
363
+
* Creating trigger
364
+
* Getting YAML from a repository
365
+
* Using the Git Context in a pipeline (git clone step etc.) via Execution Context.
368
366
367
+
You will get an error of Permission Denied or Forbidden to a Git Context that you do not have the correct permissions for that action.
368
+
369
+
###Tagging the Git Context
370
+
371
+
1. Navigate to Account Settings > Integrations > Configure for Git.
372
+
1. Hovering over the integration name (Git Context), you will see "Edit Tags" just before the edit symbol.
373
+
1. Select "Edit Tags," and you can add and remove tags.
374
+
1. Click Save when done.
375
+
376
+
###Setting the Permissions
377
+
378
+
1. Navigate to Account Settings > Permissions > Teams or Execution Context.
379
+
1. Scroll to Git Contexts.
380
+
1. Here, you can set[permissions]({{site.baseurl}}/docs/administration/access-control/#creating-a-security-policy) similar to other ABAC rules for Teams or Execution Context to Create or Use, Update, and Delete actions.