-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy path.travis.yml
118 lines (108 loc) · 5.53 KB
/
.travis.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
os: linux
dist: trusty
services: docker
language: shell
branches:
only:
- master
before_install:
- env | sort
- export home=$(pwd)
- export image_dir="${home}/images/${VERSION}/${VARIANT}"
- export DOCKER_TAG="${VERSION}-${VARIANT}-travis"
- export IMAGE_NAME="docker-erpnext:${DOCKER_TAG}"
- export IMAGE_ALIAS_NAME="docker-erpnext:${VERSION}"
install:
- echo "Changing to image directory ($image_dir)"
- cd "$image_dir"
# Test container build
- travis_retry travis_wait 180 docker-compose -f "docker-compose.${DATABASE}.yml" build
before_script:
- docker images
script:
- echo "Changing to image directory ($image_dir)"
- cd "$image_dir"
# Test container run
- travis_retry docker-compose -f "docker-compose.${DATABASE}.yml" up -d
- docker-compose -f "docker-compose.${DATABASE}.yml" logs -f "sut"
- docker-compose -f "docker-compose.${DATABASE}.yml" ps
- docker-compose -f "docker-compose.${DATABASE}.yml" logs "erpnext_db"
- docker-compose -f "docker-compose.${DATABASE}.yml" ps "erpnext_db" | grep "Up"
- docker-compose -f "docker-compose.${DATABASE}.yml" logs "erpnext_app"
- docker-compose -f "docker-compose.${DATABASE}.yml" ps "erpnext_app" | grep "Up"
- docker-compose -f "docker-compose.${DATABASE}.yml" logs "erpnext_web"
- docker-compose -f "docker-compose.${DATABASE}.yml" ps "erpnext_web" | grep "Up"
- docker-compose -f "docker-compose.${DATABASE}.yml" ps "sut" | grep "Exit 0"
# Test container restart
- docker-compose -f "docker-compose.${DATABASE}.yml" down
- travis_retry docker-compose -f "docker-compose.${DATABASE}.yml" up -d
- docker-compose -f "docker-compose.${DATABASE}.yml" logs -f "sut"
- docker-compose -f "docker-compose.${DATABASE}.yml" ps
- docker-compose -f "docker-compose.${DATABASE}.yml" logs "erpnext_db"
- docker-compose -f "docker-compose.${DATABASE}.yml" ps "erpnext_db" | grep "Up" || exit 1
- docker-compose -f "docker-compose.${DATABASE}.yml" logs "erpnext_app"
- docker-compose -f "docker-compose.${DATABASE}.yml" ps "erpnext_app" | grep "Up" || exit 1
- docker-compose -f "docker-compose.${DATABASE}.yml" logs "erpnext_web"
- docker-compose -f "docker-compose.${DATABASE}.yml" ps "erpnext_web" | grep "Up" || exit 1
- docker-compose -f "docker-compose.${DATABASE}.yml" ps "sut" | grep "Exit 0"
# Test container migrate
- docker-compose -f "docker-compose.${DATABASE}.yml" run --rm "erpnext_app" bench migrate --help
- docker-compose -f "docker-compose.${DATABASE}.yml" run --rm "erpnext_app" migrate
# Test container backup
- docker-compose -f "docker-compose.${DATABASE}.yml" run --rm "erpnext_app" bench backup --help
- docker-compose -f "docker-compose.${DATABASE}.yml" run --rm "erpnext_app" backup && sleep 5
- docker-compose -f "docker-compose.${DATABASE}.yml" run --rm "erpnext_app" backup && sleep 5
- docker-compose -f "docker-compose.${DATABASE}.yml" run --rm "erpnext_app" backup && sleep 5
# Test container restore
- docker-compose -f "docker-compose.${DATABASE}.yml" run --rm "erpnext_app" bench restore --help
# Test container "old" restore (file number instead of file name)
- docker-compose -f "docker-compose.${DATABASE}.yml" run --rm "erpnext_app" restore 1
notifications:
email: false
matrix:
allow_failures:
- env: VERSION=develop VARIANT=alpine DATABASE=postgres
- env: VERSION=develop VARIANT=alpine DATABASE=mariadb
- env: VERSION=develop VARIANT=debian-slim DATABASE=postgres
- env: VERSION=develop VARIANT=debian-slim DATABASE=mariadb
- env: VERSION=develop VARIANT=debian DATABASE=postgres
- env: VERSION=develop VARIANT=debian DATABASE=mariadb
- env: VERSION=13 VARIANT=alpine DATABASE=postgres
- env: VERSION=13 VARIANT=alpine DATABASE=mariadb
- env: VERSION=13 VARIANT=debian-slim DATABASE=postgres
- env: VERSION=13 VARIANT=debian-slim DATABASE=mariadb
- env: VERSION=13 VARIANT=debian DATABASE=postgres
- env: VERSION=13 VARIANT=debian DATABASE=mariadb
# Postgresql does not seem well supported yet...
- env: VERSION=12 VARIANT=alpine DATABASE=postgres
- env: VERSION=12 VARIANT=debian-slim DATABASE=postgres
- env: VERSION=12 VARIANT=debian DATABASE=postgres
# Stop supporting Frappe 10 and Python 2
- env: VERSION=10 VARIANT=alpine DATABASE=mariadb
- env: VERSION=10 VARIANT=debian-slim DATABASE=mariadb
- env: VERSION=10 VARIANT=debian DATABASE=mariadb
env: # Environments
- VERSION=develop VARIANT=alpine DATABASE=postgres
- VERSION=develop VARIANT=alpine DATABASE=mariadb
- VERSION=develop VARIANT=debian-slim DATABASE=postgres
- VERSION=develop VARIANT=debian-slim DATABASE=mariadb
- VERSION=develop VARIANT=debian DATABASE=postgres
- VERSION=develop VARIANT=debian DATABASE=mariadb
- VERSION=11 VARIANT=alpine DATABASE=postgres
- VERSION=11 VARIANT=alpine DATABASE=mariadb
- VERSION=11 VARIANT=debian-slim DATABASE=postgres
- VERSION=11 VARIANT=debian-slim DATABASE=mariadb
- VERSION=11 VARIANT=debian DATABASE=postgres
- VERSION=11 VARIANT=debian DATABASE=mariadb
- VERSION=12 VARIANT=alpine DATABASE=postgres
- VERSION=12 VARIANT=alpine DATABASE=mariadb
- VERSION=12 VARIANT=debian-slim DATABASE=postgres
- VERSION=12 VARIANT=debian-slim DATABASE=mariadb
- VERSION=12 VARIANT=debian DATABASE=postgres
- VERSION=12 VARIANT=debian DATABASE=mariadb
- VERSION=13 VARIANT=alpine DATABASE=postgres
- VERSION=13 VARIANT=alpine DATABASE=mariadb
- VERSION=13 VARIANT=debian-slim DATABASE=postgres
- VERSION=13 VARIANT=debian-slim DATABASE=mariadb
- VERSION=13 VARIANT=debian DATABASE=postgres
- VERSION=13 VARIANT=debian DATABASE=mariadb