forked from the-bot-meek/foodOrder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
131 lines (111 loc) · 3.06 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
trigger:
batch: true
branches:
include:
- main
pr: none
variables:
GRADLE_USER_HOME: $(Pipeline.Workspace)/.gradle
name: 'CI Tests'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
displayName: 'Checkout the source code'
- task: Cache@2
displayName: 'Gradle Cache'
inputs:
key: '"gradle" | "$(Agent.OS)" | gradle.properties | server/build.gradle'
path: $(GRADLE_USER_HOME)
restoreKeys: '"gradle" | "$(Agent.OS)"'
- task: Gradle@3
displayName: 'Gradle Build'
inputs:
gradleWrapperFile: 'gradlew'
tasks: 'build'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.17'
jdkArchitectureOption: 'x64'
- task: Gradle@3
displayName: 'Build food-order server docker image'
inputs:
gradleWrapperFile: 'gradlew'
tasks: 'dockerBuild'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.17'
- task: DockerCompose@1
displayName: 'Start Localstack'
inputs:
containerregistrytype: 'Azure Container Registry'
dockerComposeFile: 'docker-compose.yml'
projectName: 'localstack-food-order'
action: 'Run a Docker Compose command'
dockerComposeCommand: 'up'
arguments: '-d food-order-server'
- task: UseNode@1
inputs:
version: '22.x'
checkLatest: true
displayName: 'Setup Node.js'
- task: Npm@1
displayName: 'npm run ci'
inputs:
command: 'ci'
workingDir: './client'
- task: Npm@1
displayName: 'npm run test:ci'
inputs:
command: 'custom'
workingDir: './client'
customCommand: 'run test:ci'
- task: Npm@1
displayName: 'npm run build'
inputs:
command: 'custom'
workingDir: './client'
customCommand: 'run build'
- task: Bash@3
displayName: 'Install Playwright'
inputs:
targetType: inline
script: 'npx playwright install --with-deps'
- task: Bash@3
displayName: 'Wait For Localstack Init Script To Finish'
inputs:
filePath: './scripts/wait_for_localstack_init_script_to_finish.sh'
- task: Npm@1
displayName: 'npm run e2e test'
inputs:
command: 'custom'
workingDir: './client'
customCommand: 'run e2e'
- task: Gradle@3
displayName: 'Gradle Test'
inputs:
gradleWrapperFile: 'gradlew'
tasks: 'test'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.17'
- task: Gradle@3
displayName: 'Integration Test'
inputs:
gradleWrapperFile: 'gradlew'
tasks: 'integrationTest'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.17'
- task: DockerCompose@1
displayName: 'Dump Localstack Logs'
condition: failed()
inputs:
dockerComposeFile: 'docker-compose.yml'
projectName: 'localstack-food-order'
dockerComposeCommand: 'logs'
arguments: 'food-order-server'
- task: DockerCompose@1
displayName: 'Dump FoodOrder logs'
condition: failed()
inputs:
dockerComposeFile: 'docker-compose.yml'
projectName: 'localstack-food-order'
dockerComposeCommand: 'logs'
arguments: 'localstack'