Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Concourse merge another branch

I'm trying to automate deployments using Concourse-CI.

I have a go application that is checked into a local Gitlab with two branches (master and develop).

I have a pipeline setup for the develop branch that runs go unit tests and if they pass i want to automatically merge the changes from the develop branch to the master branch and tag it with the latest version.

Here is what I have so far:

jobs:
- name: run-unit-tests
  public: true
  plan:
  - get: source-master
  - get: source
    trigger: true
  - put: discord
    params:
      channel: "((channel_id))"
      color: 6076508
      title: Concourse CI
      message: |
        Starting Unit tests for manageGameData
  - task: task-unit-tests
    file: source/ci/tasks/task-unit-tests.yml
    on_success:
      do:
        - put: discord
          params:
            channel: "((channel_id))"
            color: 6076508
            title: Concourse CI
            message: |
              All Unit tests passed for manageGameData
        - put: version
          params: 
            bump: minor
        - get: version
        - put: source-master
          params:
            merge: source
            repository: source-master
            tag: version/number

The problem is that this only tags the master branch with the new version.

Is there a way to merge the develop branch to master?

like image 222
AdminTome Avatar asked Mar 13 '26 04:03

AdminTome


1 Answers

I guess i didn't understand the documentation at first but the answer was pretty easy.

- get: source-master
- get: source
- put: source-master
  params:
    repository: source

First you have to get both branches in this case master and develop. Then you push the source local repo (a folder on the concourse worker) to master by using put.

There is no need for the merge parameter and i had the wrong repository parameter.

Hope this helps someone else.

like image 181
AdminTome Avatar answered Mar 16 '26 21:03

AdminTome



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!