From 635fbfd7ffbac2df150814813cbee7d4cf78689c Mon Sep 17 00:00:00 2001 From: Pavel Vaks <129676672+PavelLinearB@users.noreply.github.com> Date: Wed, 29 May 2024 16:21:42 +0300 Subject: [PATCH 1/3] Removed docker from GitHub installation --- docs/github-installation.md | 39 ++++--------------------------------- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/docs/github-installation.md b/docs/github-installation.md index 73b2ed19..88b74c82 100644 --- a/docs/github-installation.md +++ b/docs/github-installation.md @@ -124,13 +124,13 @@ Here are the steps to configure gitStream in your repo's branch protection rules ### Configuring gitStream with Self-Hosted Runners -To ensure gitStream runs on self-hosted GitHub Actions runners, follow these steps to configure it: +Follow these steps to ensure gitStream runs on self-hosted GitHub Actions runners: -1. **Configure Self-Hosted Runners with ** +1. **Configure Self-Hosted Runners** Ensure you have self-hosted runners set up for your GitHub organization or repository. Refer to the GitHub documentation on [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners) and [Using self-hosted runners in a workflow](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/using-self-hosted-runners-in-a-workflow) for detailed instructions. -1. **Install Docker and Git on Self-Hosted Runners** - Make sure your self-hosted runners have Docker and Git installed. These are essential dependencies for gitStream to function properly. You can follow the official installation guides for [Docker](https://docs.docker.com/get-docker/) and [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). +1. **Install Git on Self-Hosted Runners** + Make sure your self-hosted runners have Git installed. Git is an essential dependency for gitStream to function properly. The installation guide is available [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). 2. **Update GitHub Actions Configuration** Open the gitStream GitHub Actions workflow file (`.github/workflows/gitstream.yml`) and update the `runs-on` field to specify that the gitStream job must run on self-hosted runners. For example: @@ -148,37 +148,6 @@ To ensure gitStream runs on self-hosted GitHub Actions runners, follow these ste 4. **Test with a Sample PR** Create a sample pull request and observe gitStream's behavior. It will use the configured self-hosted runners. -### Caching the Docker Image Using GitHub Cache - -gitStream provides an optional method to control the frequency of Docker image downloads per day using GitHub's cache services, helping to manage build resources efficiently. By using the `update_times_a_day` argument, you can specify the number of times the Docker image should be downloaded and cached daily. If this argument is not specified, no caching will occur. -#### Configure Docker Image Caching - -Add the `update_times_a_day` parameter to the `Evaluate Rules` step of your gitStream GitHub Actions workflow. - -- **Open Your GitHub Actions Workflow File and Modify the `Evaluate Rules` Step:** - Navigate to your `.github/workflows` directory, open gitStream's workflow `yml`, and update the `Evaluate Rules` step. Add the `update_times_a_day` parameter to set the exact times the Docker image is downloaded and cached daily. - -- **Example Configuration:** - Here is how you might configure the caching within your workflow: - - ```yaml - steps: - - name: Evaluate Rules - uses: linear-b/gitstream-github-action@v2 - id: rules-engine - with: - full_repository: ${{ github.event.inputs.full_repository }} - head_ref: ${{ github.event.inputs.head_ref }} - base_ref: ${{ github.event.inputs.base_ref }} - client_payload: ${{ github.event.inputs.client_payload }} - installation_id: ${{ github.event.inputs.installation_id }} - resolver_url: ${{ github.event.inputs.resolver_url }} - resolver_token: ${{ github.event.inputs.resolver_token }} - update_times_a_day: 6 - ``` - - In this example, the Docker image is set to be downloaded and cached six times a day, distributed evenly across 24 hours (i.e., the image will be downloaded every 4 hours). This parameter can be adjusted to fit your workflow needs and resource management strategies. Without specifying this argument, no caching will be performed. - ## Uninstalling gitStream Configure in your [GitHub organization](https://github.com/apps/gitstream-cm/installations/new){ .md-button }, and choose `Uninstall "gitStream.cm"` From 9dd54870f0d86d58dc51d5814e680346551ae988 Mon Sep 17 00:00:00 2001 From: Pavel Vaks <129676672+PavelLinearB@users.noreply.github.com> Date: Wed, 29 May 2024 16:28:34 +0300 Subject: [PATCH 2/3] fix texts --- docs/github-installation.md | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/docs/github-installation.md b/docs/github-installation.md index 88b74c82..7963452c 100644 --- a/docs/github-installation.md +++ b/docs/github-installation.md @@ -126,14 +126,18 @@ Here are the steps to configure gitStream in your repo's branch protection rules Follow these steps to ensure gitStream runs on self-hosted GitHub Actions runners: +### Configuring gitStream with Self-Hosted Runners + +Follow these steps to ensure gitStream runs on self-hosted GitHub Actions runners: + 1. **Configure Self-Hosted Runners** - Ensure you have self-hosted runners set up for your GitHub organization or repository. Refer to the GitHub documentation on [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners) and [Using self-hosted runners in a workflow](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/using-self-hosted-runners-in-a-workflow) for detailed instructions. - -1. **Install Git on Self-Hosted Runners** - Make sure your self-hosted runners have Git installed. Git is an essential dependency for gitStream to function properly. The installation guide is available [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). + - Set up self-hosted runners for your GitHub organization or repository. Refer to GitHub documentation on [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners) and [using them in a workflow](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/using-self-hosted-runners-in-a-workflow) for detailed instructions. + +2. **Install Git on Self-Hosted Runners** + - Ensure Git is installed on your self-hosted runners. Git is a necessary dependency for gitStream. Installation instructions can be found [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). -2. **Update GitHub Actions Configuration** - Open the gitStream GitHub Actions workflow file (`.github/workflows/gitstream.yml`) and update the `runs-on` field to specify that the gitStream job must run on self-hosted runners. For example: +3. **Update GitHub Actions Configuration** + - Modify the gitStream GitHub Actions workflow file (`.github/workflows/gitstream.yml`) to specify self-hosted runners: ```yaml jobs: @@ -142,11 +146,12 @@ Follow these steps to ensure gitStream runs on self-hosted GitHub Actions runner # ... other configuration ... ``` -3. **Save and Commit** - Save your changes to the workflow file and commit them to your repository. +4. **Save and Commit** + - Save changes to the workflow file and commit them to your repository. + +5. **Test with a Sample PR** + - Create a sample pull request to verify gitStream's behavior with self-hosted runners. -4. **Test with a Sample PR** - Create a sample pull request and observe gitStream's behavior. It will use the configured self-hosted runners. ## Uninstalling gitStream From 93b2ce25ff2424c9290fde066b3b0277422e5338 Mon Sep 17 00:00:00 2001 From: PavelLinearB Date: Wed, 29 May 2024 16:39:45 +0300 Subject: [PATCH 3/3] remove redundant lines --- docs/github-installation.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/github-installation.md b/docs/github-installation.md index 7963452c..448ae63e 100644 --- a/docs/github-installation.md +++ b/docs/github-installation.md @@ -126,10 +126,6 @@ Here are the steps to configure gitStream in your repo's branch protection rules Follow these steps to ensure gitStream runs on self-hosted GitHub Actions runners: -### Configuring gitStream with Self-Hosted Runners - -Follow these steps to ensure gitStream runs on self-hosted GitHub Actions runners: - 1. **Configure Self-Hosted Runners** - Set up self-hosted runners for your GitHub organization or repository. Refer to GitHub documentation on [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners) and [using them in a workflow](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/using-self-hosted-runners-in-a-workflow) for detailed instructions.