We are seeing duplicates in our pipeline after adding an approval step for a deployment.
Our yaml file looks something like this:
version: '1.0'
stages:
- setup
- build
- push
- deploy
- post-deploy
- deploy-to-prod
steps:
main_clone:
stage: setup
type: git-clone
description: Cloning...
repo: 'Our repo'
revision: 'Some branch'
test_and_build:
stage: build
type: parallel
steps:
lint:
title: Linting
image: 'Our image'
working_directory: 'Some directory'
commands:
- npm run linter:check
unit_testing:
title: Unit Testing
image: 'Our image'
working_directory: 'Some directory'
commands:
- npm run test:unit
build_static_asset:
title: Build
image: 'Our image'
working_directory: 'Some directory'
commands:
- npm run build
build_image:
stage: build
title: Build Image
type: build
image_name: 'Our image'
tag: 'Some tag'
dockerfile: Dockerfile
working_directory: 'Some directory'
build_arguments:
- 'GITHUB_TOKEN=${{GITHUB_TOKEN}}'
when:
branch:
only:
- master
push_parallel:
stage: push
type: parallel
steps:
annotate_build:
title: Annotating Build
image: '${{build}}'
working_directory: 'Some directory'
commands:
- echo Annotating...
on_success:
metadata:
set:
- '${{build.imageId}}':
- CF_QUALITY: true
on_error:
metadata:
set:
- '${{build.imageId}}':
- CF_QUALITY: false
push:
title: Pushing image...
type: push
image_name: 'Our image'
registry: 'Our registry'
candidate: '${{build}}'
tags:
- '${{CF_BRANCH_TAG_NORMALIZED}}-latest'
when:
branch:
only:
- master
deploy_lower_envs:
stage: deploy-lower-envs
type: parallel
steps:
development:
stage: deploy-lower-envs
title: Deploy to development
type: codefresh-run
arguments:
PIPELINE_ID: Apps/deploy-dev
when:
branch:
only:
- master
staging:
stage: deploy-lower-envs
title: Deploy to staging
type: codefresh-run
arguments:
PIPELINE_ID: Apps/deploy-stag
when:
branch:
only:
- master
post_deploy_tests:
stage: post-deploy
type: parallel
steps:
run_tests_in_dev:
stage: post-deploy
title: Post Deploy Development Tests
type: codefresh-run
arguments:
PIPELINE_ID: Tests/api-dev
when:
branch:
only:
- master
run_tests_in_stag:
stage: post-deploy
title: Post Deploy Staging Tests
type: codefresh-run
arguments:
PIPELINE_ID: Tests/api-stag
when:
branch:
only:
- master
deploy_to_prod:
stage: deploy-to-prod
image: "${{build}}"
steps:
get_approval_for_prod_deploy:
stage: deploy-to-prod
title: Approve deployment to production?
type: pending-approval
when:
branch:
only:
- master
production:
stage: deploy-to-prod
title: Deploy to production
type: codefresh-run
arguments:
PIPELINE_ID: Apps/deploy-prod
when:
steps:
- name: get_approval_for_prod_deploy
on:
- approved
My only guess right now is that the duplicates might be due to some previous stages containing parallel steps however this current stage with the approval step has no parallel step at all.