Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Retrieve Previous successful build SHA in pipelines

Edited

Hello,

I am using NX in my angular projected, and I would like to deploy/test only affected items during my PRs.

I created the following pipeline :


ds

# This is an example Starter pipeline configuration
# Use a skeleton to build, test and deploy using manual and parallel steps
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:12

definitions:
caches:
bundler: vendor/bundle

pipelines:
pull-requests:
- step:
name: 'Installation'
caches:
- node
script:
  - npm install
artifacts:
  - node_modules/**

- parallel:
- step:
name: 'Test'
script:
- npm run affected:test -- --base=origin/develop
- step:
name: 'Lint'
script:
- npm run affected:lint -- --base=origin/develop
- step:
name: 'Stylelint'
script:
- npm run affected:stylelint -- --base=origin/develop

branches:
develop:
-step:
name: 'Deploy Staging'
deployment: staging
script:
- npm run affected:build -- --base=origin/develop

Now, the last line don't work because, when the pipeline execute, the branch is already merged in develop so

 npm run affected:build -- --base=origin/develop

 Will do nothing as it is comparing to itself.

I would like to replace the --base=origin/develop with --base=$previousBuildSHA. But I am quite confused on how to retrieve it.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence Cloud

🎨 Add some visual life to your templates

Hi Atlassian Community, My name is Avni Barman, and I am a Product Manager on the Confluence Cloud team. Based on feedback from you, we are giving admins more power to create templates that a...

119 views 1 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you