Created
July 26, 2020 13:56
-
-
Save prabhu/06245e0f5ce949aa8a93e448fbd6516c to your computer and use it in GitHub Desktop.
Reusable Bitbucket pipelines configuration with YAML anchors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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