Skip to main content

Bitbucket

UseYou thiscan articletrigger whenan AIQ needspipeline in Bitbucket from an existing project. By default, Bitbucket pipelines are trigger by a commit to connectthe related git repository.

If is very easy to setup a scenario or AISG to be started by a Bitbucket pipeline, all you need is to create a repository forand source-controlledupload the build.xml file, your scenario or blueprint files, and a couple more configuration files.

Once you have that you can create a Starter pipeline


 and edit the automatically created bitbucket-pipelines.yml file to look like this one:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# This is an example Starter pipeline configuration
# Use a skeleton to build, test assets.and deploy using manual and parallel steps
# -----
# You can specify a custom docker image from Docker Hub as your build environment.

image: atlassian/default-image:3

pipelines:
  default:
    - parallel:
      - step:
          name: 'Smoke Tests'
          script:
            - echo "Run smoke tests scenario and create HTML dashboards"
            - ant createScenariosDashboard -Dscenario=scenarios/checkout.scenario

In above line 15, the createScenariosDashboard target is defined in the build.xml of the repository. Notice how you can pass parameters to the target and override any property values provided in the build.xml, meaning you can use the same build.xml file to run different scenarios and AISG.

Bitbucket requires you to create an app password that is different from your user password to start your pipelines. For more information on this requirement see >Bitbucket's announcement of this change.

ValidationHow workflowto have your smoke test pipeline started from your code build pipeline

  1. Identify

    If whetheryour application code is compiled and built in a Bitbucket pipeline you can add a new step at the repositoryend of your bitbucket-pipelines.yml file to start the testing scenario pipeline as the last step of your build. For that you can add the - pipe to your app pipeline .yml file

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    # This is hostedan inexample BitbucketStarter Cloudpipeline orconfiguration
    # BitbucketUse Server/Dataa Center.
  2. Validateskeleton repositoryto URL,build, branch, authentication method,test and networkdeploy accessusing manual and parallel steps
    # -----
    # You can specify a custom docker image from AIQ.
  3. RunDocker aHub smallas repositoryyour syncbuild orenvironment.

    image: checkoutatlassian/default-image:3

    pipelines:
      anddefault:
          verify- step:
              name: 'Build my App'
              script:
                - echo "Your build goes here..."
                - echo "after build ends, then the expected AIQ assetssmoketest areis available.
started."
            - pipe: atlassian/trigger-pipeline:5.0.0
              variables:
                BITBUCKET_USERNAME: 'userappvance'
                BITBUCKET_APP_PASSWORD: '3casdfXX7qfKasdfGgBC'
                REPOSITORY: 'smoketestcicd'
                # ACCOUNT: '<string>' # Optional
                # REF_TYPE: '<string>' # Optional
                # REF_NAME: '<string>' # Optional
                # CUSTOM_PIPELINE_NAME: '<string>' # Optional
                # PIPELINE_VARIABLES: '<json>' # Optional
                # WAIT: '<boolean>' # Optional
                # WAIT_MAX_TIMEOUT: '<string>' # Optional
                # DEBUG: '<boolean>' # Optional

Find more info here. This will trigger the smoketestcicd build to run after the app build steps:


Last updated: SeptemberAugust 29,03, 20262023

If you have any feedback on this topic, please contact us at documentation@appvance.ai