diff --git a/src/markdown/getting-started/deploy-app.md b/src/markdown/getting-started/deploy-app.md index 4e302df..4ea01c8 100644 --- a/src/markdown/getting-started/deploy-app.md +++ b/src/markdown/getting-started/deploy-app.md @@ -8,6 +8,7 @@ Create an account on [dev.lenra.io](https://dev.lenra.io). You will be asked for a token to join our developer platform as our platform is in private beta phase. We will be sending you one as soon as possible. After successfully completing this step you will be redirected to the creation of your first project, just enter a name and the URL of the app git repository. +For private repositories, follow [our dedicated guide](../guides/use-private-repository.md). Then you simply click `Publish my application` at the top right corner, your application will be sent to Lenra's servers and deployed to be accessible directly for the Lenra Store. Once your application is fully deployed on our servers, it will be accessible by clicking the `See my application` button. diff --git a/src/markdown/guides/use-private-repository.md b/src/markdown/guides/use-private-repository.md new file mode 100644 index 0000000..1e92f17 --- /dev/null +++ b/src/markdown/guides/use-private-repository.md @@ -0,0 +1,73 @@ +--- +description: Deploy a Lenra app from a private repository. +--- + +Do you want to use a private git repository to version your app? +Using an open-source solution doesn't mean that your app has to be one too. + +In this guide we will explain how to create a token and how to use it in our backoffice for the two main plateforms: [GitLab](#gitlab) and [GitHub](#github). + +## GitLab + +GitLab offers several types of access tokens that can be used to get your app's source code: + +{:.list} +- [Personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html): to give access to all repositories +- [Group access token](https://docs.gitlab.com/ee/user/group/settings/group_access_tokens.html): to give access to every repositories in a specific group +- [Project access token](https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html): to give access to only one repository + +We will focus on the first one in this guide since it is the only free solution to use, but you should use project access tokens if possible, as they are more adapted to our needs and more secure. + +You can go to your [personal access token settings by clicking this link](https://gitlab.com/-/profile/personal_access_tokens) or by following these steps: + +{:.list} +- In the upper-right corner, select your avatar. +- Select Edit profile. +- On the left sidebar, select Access Tokens. + + +To create a personal access token follow these steps: + +{:.list} +- Enter a name to understand what the token is used for (for example `Lenra app deployment`) and an optional expiry date for the token. +- Select the desired scopes: `read_repository`. +- Select Create personal access token. + +Save the personal access token somewhere safe. After you leave the page, you will no longer have access to the token. + +Next, we will integrate our access token into the git HTTP URL of our Lenra app. +Here's an example: + +``` +https://gitlab.com/group/repo.git +becomes +https://oauth2:@gitlab.com/group/repo.git +``` + +## GitHub + +GitHub only offers [personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) so we will use that. +***Actually GitHub also handles [Fine-grained tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#fine-grained-personal-access-tokens) while I'm writing this guide which are much more secure but they are still in beta version.*** + +You can go to your [personal access token settings by clicking this link](https://github.com/settings/tokens) or by following these steps: + +{:.list} +- In the upper-right corner, select your avatar. +- Select Settings. +- On the left sidebar, select Developer settings. +- On the left sidebar, select Personal access tokens ***(classic)***. + + +To create a personal access token, follow these steps: + +{:.list} +- Select Generate new token. +- Enter a name to understand what the token is used for (for example `Lenra app deployment`) and optional expiry date for the token. +- Select the desired scopes: `repo`. +- Select Generate token. + +``` +https://github.com/username/repo.git +becomes +https://oauth2:@github.com/username/repo.git +```