|
| 1 | +--- |
| 2 | +title:"Integration with self-hosted (on-prem) git providers" |
| 3 | +description:"" |
| 4 | +group:integrations |
| 5 | +sub_group:git-providers |
| 6 | +redirect_from: |
| 7 | + -/docs/integrating-codefresh-with-on-premises-git-providers/ |
| 8 | +toc:true |
| 9 | +--- |
| 10 | + |
| 11 | +Basically there are two scenarios of configuring Codefresh to work with On-prem git providers: |
| 12 | + |
| 13 | +1.**Codefresh SaaS** with self-hosted git providers. |
| 14 | +2.**Codefresh On-Prem** with self-hosted git providers. |
| 15 | + |
| 16 | +{{site.data.callout.callout_info}} |
| 17 | +#####May I use my existing account for a SaaS git provider? |
| 18 | + |
| 19 | +If you already have accounts and users created for SaaS git provider types, you will need to create a**separate account and users specifically for self-hosted** type of git provider. This is related to a generic restriction –**one account per git provider**. For instance, SaaS GitHub and On-prem GitHub are considered as two different git providers in terms of integration with Codefresh |
| 20 | +{{site.data.callout.end}} |
| 21 | + |
| 22 | +##Codefresh SaaS with self-hosted git providers |
| 23 | +If you use Codefresh SaaS, you need to request Codefresh team to create an account for you. Please follow[this guide.](https://docs.codefresh.io/docs/activate-integration-with-your-self-hosted-git-server) |
| 24 | + |
| 25 | +If you intend to**add more users** to this account: |
| 26 | + |
| 27 | +{:start="1"} |
| 28 | +1. Ask Codefresh team to create the users for you, giving the emails on which you will receive activation letters. |
| 29 | + |
| 30 | +{:start="2"} |
| 31 | +2. When the needed users are created, you can add them into your account on the**`Account Settings`→`Collaborators`** page. |
| 32 | +There you can assign roles to the users and delete them from the collaborators list later if needed. |
| 33 | + |
| 34 | +##Codefresh On-Prem with self-hosted git providers |
| 35 | + |
| 36 | +{:start="1"} |
| 37 | +1. Login to Codefresh with the user that has**`Admin` role** (not the`Account Admin` role) |
| 38 | + |
| 39 | +{:start="2"} |
| 40 | +2. Create an account with the corresponding on-prem git provider. For that go to the**`Admin Management`→`Accounts`** page, click on the*`plus`* button and select the needed on-prem git provider (Stash, GitHub OnPrem, GitLab OnPrem): |
| 41 | + |
| 42 | +`Custom HTML / CSS` |
| 43 | +{% highlight html %} |
| 44 | +{% raw %} |
| 45 | +<figurealign="center"> |
| 46 | + <ahref="https://files.readme.io/5f1f234-Screenshot_from_2018-02-09_14-57-21.png"class="block-display-image-parent block-display-image-size-original"> |
| 47 | +<img src="https://files.readme.io/5f1f234-Screenshot_from_2018-02-09_14-57-21.png"> |
| 48 | + </a> |
| 49 | +</figure> |
| 50 | +{% endraw %} |
| 51 | +{% endhighlight %} |
| 52 | + |
| 53 | +{:start="3"} |
| 54 | +3. Create a user and link it with the account. For that go to the**`Admin Management`→`Users`** page, click on the*`Create new user`* button, fill in the username and email, select the on-prem git provider (the same as for the account), select the name of the account you created above, click the*`Add`* button. |
| 55 | + |
| 56 | +`Custom HTML / CSS` |
| 57 | +{% highlight html %} |
| 58 | +{% raw %} |
| 59 | +<figurealign="center"> |
| 60 | + <ahref="https://files.readme.io/ffc028a-Screenshot_from_2018-02-09_15-33-09.png"class="block-display-image-parent block-display-image-size-smart"> |
| 61 | +<img src="https://files.readme.io/ffc028a-Screenshot_from_2018-02-09_15-33-09.png"> |
| 62 | + </a> |
| 63 | +</figure> |
| 64 | +{% endraw %} |
| 65 | +{% endhighlight %} |
| 66 | + |
| 67 | +Click on the*`Set the user as admin of this account`*. |
| 68 | + |
| 69 | +{:start="4"} |
| 70 | +4. On the same*`Users`* page find the created user, click on the button under*`Provider`* column, click*`plus`* in front of*`local`*, enter the password, click on the`Save` icon. |
| 71 | + |
| 72 | +{% include image.html lightbox="true" file="/images/63a4059-Screenshot_from_2018-02-09_15-35-38.png" url="/images/63a4059-Screenshot_from_2018-02-09_15-35-38.png" alt="Screenshot from 2018-02-09 15-35-38.png" max-width="100%" %} |
| 73 | + |
| 74 | +{:start="5"} |
| 75 | +5. On the same*`Users`* page change the status of the user from*`Pending`* to*`Active`*. |
| 76 | + |
| 77 | +{:start="6"} |
| 78 | +6. Login to Codefresh with the created user. For that you should go to the login page (`https://<yourcodefreshhostname>/login`), click on the*`On Premise Codefresh`* button and enter the credentials. |
| 79 | + |
| 80 | +{:start="7"} |
| 81 | +7. After you have logged in you will need to integrate your git provider server with Codefresh. For that go to**`Account Settings`→`Integration`**, where you will find option to add your git provider server. |
| 82 | + |
| 83 | +If you intend to add more users to this account repeat the steps above from 3 to 5. |
| 84 | + |
| 85 | +{{site.data.callout.callout_info}} |
| 86 | +#####Understanding the Users and Accounts relationships |
| 87 | + |
| 88 | +The relationship between users and accounts is**"many-to-many"**: a user can be linked with multiple accounts and vice-versa - an account can be linked with many users. |
| 89 | +{{site.data.callout.end}} |