-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
121 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
trigger: | ||
branches: | ||
include: | ||
- develop | ||
paths: | ||
include: | ||
- src/ | ||
- azure-pipelines.yml | ||
parameters: | ||
- name: environment | ||
displayName: Where to deploy? | ||
type: string | ||
default: dev | ||
values: | ||
- prod | ||
- dev | ||
- name: imageTag | ||
displayName: Docker image tag | ||
type: string | ||
default: latest | ||
|
||
variables: | ||
- group: ${{parameters.environment}}-variable-group | ||
- name: env | ||
value: ${{parameters.environment}} | ||
- name: imageTag | ||
value: ${{parameters.imageTag}} | ||
|
||
pool: | ||
name: Azure Pipelines | ||
vmImage: 'ubuntu-latest' | ||
|
||
jobs: | ||
- job: runTest | ||
displayName: Run Tests # Human-readable name for the job. | ||
timeoutInMinutes: 5 | ||
|
||
steps: | ||
- task: GoTool@0 | ||
displayName: 'Use Go 1.21.3' | ||
inputs: | ||
version: 1.21.3 | ||
|
||
- task: Go@0 | ||
displayName: 'Run Test Cases - Common' | ||
inputs: | ||
command: test | ||
arguments: ./... | ||
workingDirectory: 'src/common' | ||
|
||
- task: Go@0 | ||
displayName: 'Run Test Cases - Date API' | ||
inputs: | ||
command: test | ||
arguments: ./... | ||
workingDirectory: 'src/date-api' | ||
|
||
- task: Go@0 | ||
displayName: 'Run Test Cases - Memo API' | ||
inputs: | ||
command: test | ||
arguments: ./... | ||
workingDirectory: 'src/memo-api' | ||
|
||
- task: Go@0 | ||
displayName: 'Run Test Cases - Finance API' | ||
inputs: | ||
command: test | ||
arguments: ./... | ||
workingDirectory: 'src/finance-api' | ||
|
||
- task: Go@0 | ||
displayName: 'Run Test Cases - User API' | ||
inputs: | ||
command: test | ||
arguments: ./... | ||
workingDirectory: 'src/user-api' | ||
#Multi-configuration and multi-agent job options are not exported to YAML. Configure these options using documentation guidance: https://docs.microsoft.com/vsts/pipelines/process/phases | ||
|
||
- job: buildAndPush | ||
displayName: Build and Push Images # Human-readable name for the job. | ||
dependsOn: runTest | ||
timeoutInMinutes: 10 | ||
|
||
steps: | ||
- task: Docker@2 | ||
displayName: 'Build Date Api image' | ||
inputs: | ||
containerRegistry: sharedacr | ||
repository: 'dlw-date-api' | ||
Dockerfile: 'src/date-api/Dockerfile' | ||
buildContext: 'src' | ||
tags: '$(imageTag)' | ||
|
||
- task: Docker@2 | ||
displayName: 'Build Memo Api image' | ||
inputs: | ||
containerRegistry: sharedacr | ||
repository: 'dlw-memo-api' | ||
Dockerfile: 'src/memo-api/Dockerfile' | ||
buildContext: 'src' | ||
tags: '$(imageTag)' | ||
|
||
- task: Docker@2 | ||
displayName: 'Build Finance Api image' | ||
inputs: | ||
containerRegistry: sharedacr | ||
repository: 'dlw-finance-api' | ||
Dockerfile: 'src/finance-api/Dockerfile' | ||
buildContext: 'src' | ||
tags: '$(imageTag)' | ||
|
||
- task: Docker@2 | ||
displayName: 'Build User Api image' | ||
inputs: | ||
containerRegistry: sharedacr | ||
repository: 'dlw-user-api' | ||
Dockerfile: 'src/user-api/Dockerfile' | ||
buildContext: 'src' | ||
tags: '$(imageTag)' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters