kyma-project / lifecycle-manager

Controller that manages the lifecycle of Kyma Modules in your cluster.
http://kyma-project.io
Apache License 2.0
10 stars 30 forks source link

Create permanent `pr-deploy` branch #1655

Open c-pius opened 5 months ago

c-pius commented 5 months ago

Description

:exclamation: FIRST verify with SRE that the concept below can be achieved.

Create a permanent pr-deploy branch and PR in management-plane-charts repository. Every time we merge a commit on lifecycle-manager:main, we want the branch/PR to be updated automatically with the new commit hash so that the changes are deployed continuously for testing.

Acceptance Criteria

Reason

We want to have our changes to lifecacle-manager:main continuously deployed to DEV for testing

jeremyharisch commented 5 months ago

I have clarified with the SREs with the following output:

c-pius commented 4 months ago

Deprioritized this as it is not a current pain point. We can look at it later again if we find that automatic deployments to DEV ease our dev process.

jeremyharisch commented 1 month ago

To trigger a GitHub Actions workflow in Repository B when a commit is pushed to Repository A, you'll need to use a combination of GitHub Webhooks and a personal access token (PAT) to trigger the workflow in the second repository. Here's how you can do it:

Steps:

1. Set up a Webhook in Repository A:

2. Create a Personal Access Token (PAT):

3. Configure GitHub Actions Workflow in Repository A:

In Repository A, create or update your GitHub Actions workflow file (.github/workflows/trigger-repo-b.yml).

Example workflow file:

   name: Trigger Repository B Workflow

   on:
     push:
       branches:
         - main  # Adjust the branch as needed

   jobs:
     trigger-workflow:
       runs-on: ubuntu-latest

       steps:
         - name: Trigger Repository B workflow
           run: |
             curl -X POST \
             -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
             -H "Accept: application/vnd.github.everest-preview+json" \
             https://api.github.com/repos/<owner>/<repository>/dispatches \
             -d '{"event_type": "trigger_workflow"}'
           env:
             PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

4. Create a Workflow in Repository B:

In Repository B, create a GitHub Actions workflow file that gets triggered by the external event from Repository A.

Example workflow file (.github/workflows/on-dispatch.yml):

   name: On Dispatch Event

   on:
     repository_dispatch:
       types: [trigger_workflow]

   jobs:
     build:
       runs-on: ubuntu-latest
       steps:
         - name: Checkout Repository B
           uses: actions/checkout@v2

         - name: Run some action in Repository B
           run: echo "This is triggered by a push in Repository A"

Summary:

  1. Repository A has a webhook that triggers when a push event occurs.
  2. Repository A's GitHub Actions workflow sends a request to Repository B using the GitHub API.
  3. Repository B listens for the repository_dispatch event and runs its workflow.

This setup ensures that a push in Repository A triggers a workflow in Repository B.

jeremyharisch commented 1 month ago

We have adapted our current release process timeline. We need to check if this already solves our release process problems. Until then, this ticket can be parked.