# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
  - master

stages:
- stage: build
  jobs:
  - job: Build
    pool:
      vmImage: "ubuntu-latest"
    steps:
    - task: Docker@2
      displayName: Login
      inputs:
        command: login
        containerRegistry: writhem
    - task: Docker@2
      displayName: Build and Push
      inputs:
        command: buildAndPush
        containerRegistry: writhem
        repository: vlt/marconi
        tags: |
          az-$(Build.BuildNumber)
          $(Build.SourceBranchName)
- stage: Deploy
  jobs:
  - job: Deploy
    pool:
      vmImage: "ubuntu-latest"
    steps:
    - task: Docker@2
      displayName: "Rancher Upgrade"
      inputs:
        command: run
        arguments: "--rm -e PLUGIN_URL=$RANCHER_URL -e PLUGIN_ACCESS_KEY=$RANCHER_ACCESS_KEY -e PLUGIN_SECRET_KEY=$PLUGIN_SECRET_KEY -e PLUGIN_SERVICE=marconi/${Build.SourceBranchName} -e PLUGIN_DOCKER_IMAGE=rome.writhem.com/vlt/marconi:${Build.SourceBranchName} -v $(pwd):$(pwd) -w $(pwd) peloton/drone-rancher"

# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
  - master

stages:
- stage: build
  jobs:
  - job: Build
    pool:
      vmImage: "ubuntu-latest"
    steps:
    - task: Docker@2
      displayName: Login
      inputs:
        command: login
        containerRegistry: writhem
    - task: Docker@2
      displayName: Build and Push
      inputs:
        command: buildAndPush
        containerRegistry: writhem
        repository: vlt/marconi
        tags: |
          az-$(Build.BuildNumber)
          $(Build.SourceBranchName)
- stage: Deploy
  jobs:
  - job: Deploy
    pool:
      vmImage: "ubuntu-latest"
    steps:
    - script: "docker run --rm -e PLUGIN_URL=$RANCHER_URL -e PLUGIN_ACCESS_KEY=$RANCHER_ACCESS_KEY -e PLUGIN_SECRET_KEY=$PLUGIN_SECRET_KEY -e PLUGIN_SERVICE=marconi/${Build.SourceBranchName} -e PLUGIN_DOCKER_IMAGE=rome.writhem.com/vlt/marconi:${Build.SourceBranchName} -v $(pwd):$(pwd) -w $(pwd) peloton/drone-rancher"
      displayName: "Upgrade"

Use script instead of the Docker task
Use script instead of the Docker task