Skip to content

Instantly share code, notes, and snippets.

@prabhu
Created July 26, 2020 13:56
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save prabhu/06245e0f5ce949aa8a93e448fbd6516c to your computer and use it in GitHub Desktop.
Save prabhu/06245e0f5ce949aa8a93e448fbd6516c to your computer and use it in GitHub Desktop.
Reusable Bitbucket pipelines configuration with YAML anchors
definitions:
steps:
- step: &build
name: Build microservices jar
script:
- mvn package
artifacts:
- target/**
- step: &build-react
name: Build React app
script:
- yarn install
- yarn run build
- step: &shiftleft-java
name: Analyze Java project with NG SAST
script:
- sl analyze --app ${BITBUCKET_REPO_SLUG} --tag branch=${BITBUCKET_BRANCH} --java --cpg target/my-app.jar
- step: &shiftleft-js
name: Analyze JS/TS project with NG SAST
script:
- sl analyze --app ${BITBUCKET_REPO_SLUG} --tag branch=${BITBUCKET_BRANCH} --js --cpg . --ts --babel
pipelines:
pull-requests:
master:
- step: *build
- step: *build-react
- parallel:
- step: *shiftleft-java
- step: *shiftleft-js
branches:
feature/*:
- step: *build
- step:
<<: *shiftleft-java
trigger: manual
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment