forked from illuscio-dev/azure-pipelines-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_start_containers.yml
51 lines (38 loc) · 1.54 KB
/
test_start_containers.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
parameters:
- name: testMongo
type: boolean
- name: testRabbit
type: boolean
- name: testRedis
type: boolean
- name: testPostgres
type: boolean
# If we need to run our tests against mongodb, rabbitmq, etc, what better way than to
# spin up an Actual service? This isn't technically kosher for unit tests, but for
# something designed specifically to interact with these services, it gives a greater
# level of confidence that the functions are working with the actual target service.
steps:
# MONGO DB
- ${{ if parameters.testMongo }}:
- script: docker pull 'mongo:4.2'
displayName: Downloading MongoDB Docker image
- script: docker run -d --name mongotest -p 127.0.0.1:57017:27017/tcp mongo
displayName: Start Mongo
# RABBIT MQ
- ${{ if parameters.testRabbit }}:
- script: docker pull 'rabbitmq:3.8-management'
displayName: Downloading RabbitMQ docker image
- script: docker run -d --name rabbittest -p 127.0.0.1:57018:5672/tcp rabbitmq:3.8-management
displayName: Start RabbitMQ
# REDIS
- ${{ if parameters.testRedis }}:
- script: docker pull redis
displayName: Downloading Redis Docker image
- script: docker run -d --name redis-test -p 127.0.0.1:6359:6379/tcp redis
displayName: Start Redis
# POSTGRES
- ${{ if parameters.testPostgres }}:
- script: docker pull postgres
displayName: Downloading Postgres Docker image
- script: docker run -d -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=postgres --name postgres-test -p 127.0.0.1:5432:5432/tcp postgres
displayName: Start Postgres