Home > Blockchain >  Multiple deployment pipes on bitbucket
Multiple deployment pipes on bitbucket

Time:07-20

I have a solution where reside a web application and an azure function. So different pipes should be used for deployment:

microsoft/azure-web-apps-deploy:1.0.3 - for web app
microsoft/azure-functions-deploy:1.0.2 - for azure function

How they should be combined in a yml file? Or do I need to have separate yml files? It looks like I can't have multiple deployment steps for a single environment?

CodePudding user response:

Bitbucket Pipelines does not support multiple files for defining the pipeline nor different deployment steps for the same deployment stage so: yes, same file, same step.

pipelines:
  default:
    - step:
        deployment: production
        script:
          - pipe: [docker://]microsoft/azure-web-apps-deploy:1.0.3
            variables:
              FOO: bar
          - pipe: [docker://]microsoft/azure-functions-deploy:1.0.2
            variables:
              BAR: foo

So, deploying to "production" will deploy both the webapp and the function.


The docker:// prefix for the pipe is necessary if the pipes aren't registered as such but are arbitrary docker images with smart entrypoints.


Yet, you could use custom deployment environments like "Production Webapp" and "Production Function" so you could deploy them separatedly like

pipelines:
  default:
    - parallel:
      - step:
          deployment: production-webapp
          script:
            - pipe: [docker://]microsoft/azure-web-apps-deploy:1.0.3
              variables:
                FOO: bar
      - step:
          deployment: production-function
          script:
            - pipe: [docker://]microsoft/azure-functions-deploy:1.0.2
              variables:
                BAR: foo

and Bitbucket will keep track of the deployments made to each "environment" and also let you redeploy to them individually.

  • Related