-
Notifications
You must be signed in to change notification settings - Fork 10
/
codefresh.yml
49 lines (48 loc) · 1.22 KB
/
codefresh.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
version: "1.0"
stages:
- prepare
- build
- test
steps:
main_clone:
type: "git-clone"
description: "Cloning main repository..."
repo: "codefreshdemo/cf-example-unit-tests-with-composition"
revision: "master"
git: github
stage: prepare
build_test_image:
title: "Building Test Docker Image"
type: "build"
image_name: "mysql-tests"
tag: "master"
dockerfile: "Dockerfile"
stage: build
run_integration_tests:
title: "Running integration tests"
stage: test
image: '${{build_test_image}}'
environment: &test_mysql_vars
- MYSQL_ROOT_PASSWORD=admin
- MYSQL_USER=my_user
- MYSQL_PASSWORD=admin
- MYSQL_DATABASE=nodejs
- MYSQL_HOST=test_mysql_db
commands:
# MySQL is certainly up at this point
- cd /usr/src/app
- npm test
services:
composition:
test_mysql_db:
image: mysql:5.7
ports:
- 3306
environment: *test_mysql_vars # Same MYSQL_HOST, MYSQL_USER etc.
readiness:
timeoutSeconds: 30
periodSeconds: 15
image: '${{build_test_image}}'
commands:
- "nslookup test_mysql_db"
- "nc -z test_mysql_db 3306"