Hi i need your help for setting the yaml file for my project for STM32 microcontroller

  • ALM used (Bitbucket Cloud,)
  • CI system used (Bitbucket Cloud Bitbucket Pipeline yaml file)
  • C language
  • Bitbucket

Hello @Simone_Gasparella,

Can you be a bit more specific on what you have done so far and what you are experiencing difficulty with?

1 Like

Hi Tom…
Thanks for replying…
I will be more specific…
I am trying to run a bitbucket pipeline inside bitbucket cloud…
I would like to use sonarcloud…
My project it is not a simple project but a embedded c project,
It is a STM32 project with a specific toolchain…
I tried to make a bitbucket.yaml file…
I can copy it here if you want…

image: gcc:6.5

clone:
  depth: full              # SonarCloud scanner needs the full history to assign issues properly

definitions:
  caches:
    sonar: ~/.sonar/cache  # Caching SonarCloud artifacts will speed up your build
  steps:
    - step: &build-test-sonarcloud
        name: Build, test and analyze on SonarCloud
        caches:
          - sonar
        script:
          - export SONAR_SCANNER_VERSION=4.4.0.2170
          - export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
          - export BW_OUTPUT=$HOME/.sonar/bw-output
          - mkdir -p $BW_OUTPUT
          - curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
          - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
          - export PATH=$SONAR_SCANNER_HOME/bin:$PATH
          - curl --create-dirs -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
          - unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
          - export PATH=$HOME/.sonar/build-wrapper-linux-x86:$PATH
          - build-wrapper-linux-x86-64 --out-dir $BW_OUTPUT make clean all
          - sonar-scanner -Dsonar.cfamily.build-wrapper-output=$BW_OUTPUT

pipelines:                 # More info here: https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html
  branches:
    master:
      - step: *build-test-sonarcloud
  pull-requests:
    '**':
      - step: *build-test-sonarcloud

Moreover I have downloaded and unzipped 2 folders called build-wrapper-win-x86 and sonar-scanner-4.6.2.2472-windows.
From here I am stucked I don’t know how to proceed …

Please help me

Simone

Hi Tom…
I saw you did in a similar way for a c project …

I have already a travis.yml file for building the stm32 c project ,
Does it change too much for integrating sonarcloud on the yaml file ?

Thanks a lot