spboyer / advocate-linkers

6 stars 8 forks source link

Add pipelines in for /web #2

Closed spboyer closed 4 years ago

spboyer commented 4 years ago
# Docker image
# Build a Docker image to deploy, run, or push to a container registry.
# Add steps that use Docker Compose, tag images, push to a registry, run an image, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker

trigger:
- master
- greenkeeper/* 

pool:
  vmImage: 'Ubuntu-16.04'

variables:
  imageName: 'social-linker:$(build.buildId)'
  dockerId: 'shayne'
  latest: 'social-linker:latest'

steps:

- task: Bash@3
  inputs:
    targetType: 'inline'
    script: 'docker build -f Dockerfile -t $(imageName) .'

- task: Bash@3 
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
  inputs:
    targetType: 'inline'
    script: |
      docker build -t $(dockerId).azurecr.io/$(imageName) .
      docker login -u $(dockerId) -p $(dockerPassword) $(dockerId).azurecr.io
      docker push $(dockerId).azurecr.io/$(imageName)
  displayName: 'pushing image to azurecr'

- task: AzureWebAppContainer@1
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
  inputs:
    azureSubscription: 'Azure-shboyer'
    appName: 'social-linker'
    imageName: '$(dockerId).azurecr.io/$(imageName)'
spboyer commented 4 years ago

Closed with https://github.com/spboyer/advocate-linkers/commit/3e944986f274b9a22255ff1e242e66a3d18faf20