Hi guys, I have 1 repository with 2 branches and I need to push the changes from branch-1 to branch-2. I know this is possible to be done with the anchors but I'm not sure exactly how.
Below is my simple pipeline example
steps:
steps:
- step: &build
name: Build and run Composer
trigger: automatic
deployment: BRANCH-1
runs-on:
- 'self.hosted'
- 'linux.arm64'
- 'customlabel'
script:
- apt update
- apt install -y list-of-packages
- docker-php-ext-enable list-of-extensions
- docker-php-ext-install list-of-extentions
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- ./vendor/bin/phpstan
- ./vendor/bin/phpunit
- apt-get clean
- rm -rf /var/lib/apt/lists/* /tmp/pear
caches:
- composer
artifacts:
- '**'
- step: &deploy
name: Deploy to development
deployment: DEVOPS-1
runs-on:
- 'self.hosted'
- 'linux.arm64'
- 'customlabel'
script:
- echo $BITBUCKET_BRANCH
pipelines:
pull-request:
'BRANCH-1':
- step: *build
- step: *deploy
'BRANCH-2':
- step: *build
- step: *deploy
branches:
BRANCH-2:
- step: *build
- step:
<<: *deploy
deployment: BRANCH-1
BRANCH-1:
- step: *build
- step:
<<: *deploy
deployment: BRANCH-1
Regards,