Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

CLI pipeline should support AzDO yaml templating to allow easier extension #1423

Open
andrebriggs opened this issue May 17, 2020 · 0 comments
Labels
enhancement New feature or request epic An "epic" story that holds several related issues needs-investigation

Comments

@andrebriggs
Copy link
Member

andrebriggs commented May 17, 2020

As a:
Developer

I want:
The Bedrock CLI to support templating when generating pipelines such as:

So that:
I can customize and extend GitOps pipeline logic.

Describe the solution you'd like:
The end solution should allow conditional configuration. This can be in the form of conditional yaml statements in the AzDO yaml pipeline that can enable/disable reusable templates. I've created a proof of concept here.

An example of what build-update-hld.yaml could be:

# File: azure-pipelines.yml
trigger:
- master

variables:
  - group: quick-start-vg
  - name: APP_NAME
    value: quick-start-app

stages:
  - stage: build
    jobs:
      - job: run_build_push_acr
        pool:
          vmImage: ubuntu-latest
        steps:
        - template: templates/azure-login.yml  # Template reference
          parameters:
            appId: $(SP_APP_ID)
            password: $(SP_PASS)
            tenantId: $(SP_TENANT)
        - template: templates/container-build-strategy.yml  # Template reference
          parameters:
            downloadTools: false
            imageRepoType: ACR
            imageName: "$(APP_NAME)-$(Build.SourceBranchName)"
            imageTag: $(Build.BuildNumber)
            buildArgs:
            - AZP_POOL
            - ACR_NAME
  - stage: hld_update
    dependsOn: build
    condition: succeeded('build')
    jobs:
      - job: update_image_tag
        pool:
          vmImage: ubuntu-latest
        steps:
        - template: templates/git-update-strategy.yml  # Template reference
          parameters:
            downloadFab: true
            downloadTools: true
            azureContainerRegistry: $(ACR_NAME)
            gitUpdateType: HLD
            gitRepoURL: $(HLD_REPO)
            gitAccessToken: $(PAT)
            imageName: "$(APP_NAME)-$(Build.SourceBranchName)"
            imageTag: $(Build.BuildNumber)

I would also consider maintaining a library of GitOps focused AzDO templates (and possibly bash scripts) that can be hosted from Bedrock, can be optionally downloaded to local repositories, or be hosted on a user's private repository.

If applicable it might make sense to encapsulate heavily re-used components of the Bedrock CLI GitOps pipelines in Azure DevOps Extension Tasks.

Acceptance Criteria:

  • As a user I can easily extend Bedrock CLI generated pipelines with my own AzDO templates and scripts in a clear encapsulated manner.
  • There is flexibility of where the templates and script are hosted (Bedrock repo, in the local service repo, in a private 3rd party repo)

Does this require updates to documentation?:
Yes

@andrebriggs andrebriggs added the epic An "epic" story that holds several related issues label Jun 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request epic An "epic" story that holds several related issues needs-investigation
Projects
None yet
Development

No branches or pull requests

1 participant