diff --git a/azure-pipelines-poi-cd.yml b/azure-pipelines-poi-cd.yml new file mode 100644 index 0000000..4572612 --- /dev/null +++ b/azure-pipelines-poi-cd.yml @@ -0,0 +1,60 @@ +# Docker +# Build and push an image to Azure Container Registry +# https://docs.microsoft.com/azure/devops/pipelines/languages/docker + +trigger: + branches: + include: + - main + paths: + include: + - apis/poi + +resources: +- repo: self + +variables: + # Container registry service connection established during pipeline creation + azureSubscription: 'Azure subscription 1' # Name of the Service Connection + appName: openhackyvs74zq0poi + dockerRegistryServiceConnection: '9abbaa7b-554b-4d60-9fa6-f2e4f71f20f1' + imageRepository: 'devopsoh/api-poi' + containerRegistry: 'openhackyvs74zq0acr.azurecr.io' + dockerfilePath: '$(Build.SourcesDirectory)/apis/poi/web/Dockerfile' + tag: '$(Build.SourceVersion)' + + # Agent VM image name + vmImageName: 'ubuntu-latest' + +stages: +- stage: Build + displayName: Build and push stage + jobs: + - job: Build + displayName: Build + pool: + vmImage: $(vmImageName) + steps: + - task: Docker@2 + displayName: Build and push an image to container registry + inputs: + command: buildAndPush + repository: $(imageRepository) + dockerfile: $(dockerfilePath) + containerRegistry: $(dockerRegistryServiceConnection) + tags: | + $(tag) +- stage: Deploy + displayName: Deploy Container to Web App + jobs: + - job: Deploy + displayName: Deploy + pool: + vmImage: $(vmImageName) + steps: + - task: AzureWebAppContainer@1 + displayName: 'Azure Web App on Container Deploy' + inputs: + azureSubscription: $(azureSubscription) + appName: $(appName) + containers: $(containerRegistry)/$(imageRepository):$(tag) diff --git a/azure-pipelines-trips-cd.yml b/azure-pipelines-trips-cd.yml new file mode 100644 index 0000000..4c40adb --- /dev/null +++ b/azure-pipelines-trips-cd.yml @@ -0,0 +1,60 @@ +# Docker +# Build and push an image to Azure Container Registry +# https://docs.microsoft.com/azure/devops/pipelines/languages/docker + +trigger: + branches: + include: + - main + paths: + include: + - apis/trips + +resources: +- repo: self + +variables: + # Container registry service connection established during pipeline creation + azureSubscription: 'Azure subscription 1' # Name of the Service Connection + appName: openhackyvs74zq0trips + dockerRegistryServiceConnection: '9abbaa7b-554b-4d60-9fa6-f2e4f71f20f1' + imageRepository: 'devopsoh/api-trips' + containerRegistry: 'openhackyvs74zq0acr.azurecr.io' + dockerfilePath: '$(Build.SourcesDirectory)/apis/trips/Dockerfile' + tag: '$(Build.SourceVersion)' + + # Agent VM image name + vmImageName: 'ubuntu-latest' + +stages: +- stage: Build + displayName: Build and push stage + jobs: + - job: Build + displayName: Build + pool: + vmImage: $(vmImageName) + steps: + - task: Docker@2 + displayName: Build and push an image to container registry + inputs: + command: buildAndPush + repository: $(imageRepository) + dockerfile: $(dockerfilePath) + containerRegistry: $(dockerRegistryServiceConnection) + tags: | + $(tag) +- stage: Deploy + displayName: Deploy Container to Web App + jobs: + - job: Deploy + displayName: Deploy + pool: + vmImage: $(vmImageName) + steps: + - task: AzureWebAppContainer@1 + displayName: 'Azure Web App on Container Deploy' + inputs: + azureSubscription: $(azureSubscription) + appName: $(appName) + containers: $(containerRegistry)/$(imageRepository):$(tag) diff --git a/azure-pipelines-user-java-cd.yml b/azure-pipelines-user-java-cd.yml new file mode 100644 index 0000000..1e66630 --- /dev/null +++ b/azure-pipelines-user-java-cd.yml @@ -0,0 +1,60 @@ +# Docker +# Build and push an image to Azure Container Registry +# https://docs.microsoft.com/azure/devops/pipelines/languages/docker + +trigger: + branches: + include: + - main + paths: + include: + - apis/user-java + +resources: +- repo: self + +variables: + # Container registry service connection established during pipeline creation + azureSubscription: 'Azure subscription 1' # Name of the Service Connection + appName: openhackyvs74zq0userjava + dockerRegistryServiceConnection: '9abbaa7b-554b-4d60-9fa6-f2e4f71f20f1' + imageRepository: 'devopsoh/api-user-java' + containerRegistry: 'openhackyvs74zq0acr.azurecr.io' + dockerfilePath: '$(Build.SourcesDirectory)/apis/user-java/Dockerfile' + tag: '$(Build.SourceVersion)' + + # Agent VM image name + vmImageName: 'ubuntu-latest' + +stages: +- stage: Build + displayName: Build and push stage + jobs: + - job: Build + displayName: Build + pool: + vmImage: $(vmImageName) + steps: + - task: Docker@2 + displayName: Build and push an image to container registry + inputs: + command: buildAndPush + repository: $(imageRepository) + dockerfile: $(dockerfilePath) + containerRegistry: $(dockerRegistryServiceConnection) + tags: | + $(tag) +- stage: Deploy + displayName: Deploy Container to Web App + jobs: + - job: Deploy + displayName: Deploy + pool: + vmImage: $(vmImageName) + steps: + - task: AzureWebAppContainer@1 + displayName: 'Azure Web App on Container Deploy' + inputs: + azureSubscription: $(azureSubscription) + appName: $(appName) + containers: $(containerRegistry)/$(imageRepository):$(tag) diff --git a/azure-pipelines-userprofile-cd.yml b/azure-pipelines-userprofile-cd.yml new file mode 100644 index 0000000..1124a9b --- /dev/null +++ b/azure-pipelines-userprofile-cd.yml @@ -0,0 +1,60 @@ +# Docker +# Build and push an image to Azure Container Registry +# https://docs.microsoft.com/azure/devops/pipelines/languages/docker + +trigger: + branches: + include: + - main + paths: + include: + - apis/userprofile + +resources: +- repo: self + +variables: + # Container registry service connection established during pipeline creation + azureSubscription: 'Azure subscription 1' # Name of the Service Connection + appName: openhackyvs74zq0userprofile + dockerRegistryServiceConnection: '9abbaa7b-554b-4d60-9fa6-f2e4f71f20f1' + imageRepository: 'devopsoh/api-userprofile' + containerRegistry: 'openhackyvs74zq0acr.azurecr.io' + dockerfilePath: '$(Build.SourcesDirectory)/apis/userprofile/Dockerfile' + tag: '$(Build.SourceVersion)' + + # Agent VM image name + vmImageName: 'ubuntu-latest' + +stages: +- stage: Build + displayName: Build and push stage + jobs: + - job: Build + displayName: Build + pool: + vmImage: $(vmImageName) + steps: + - task: Docker@2 + displayName: Build and push an image to container registry + inputs: + command: buildAndPush + repository: $(imageRepository) + dockerfile: $(dockerfilePath) + containerRegistry: $(dockerRegistryServiceConnection) + tags: | + $(tag) +- stage: Deploy + displayName: Deploy Container to Web App + jobs: + - job: Deploy + displayName: Deploy + pool: + vmImage: $(vmImageName) + steps: + - task: AzureWebAppContainer@1 + displayName: 'Azure Web App on Container Deploy' + inputs: + azureSubscription: $(azureSubscription) + appName: $(appName) + containers: $(containerRegistry)/$(imageRepository):$(tag)