-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.travis.yml
149 lines (129 loc) · 4.73 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
_docker_compose_setup_commands: &docker_compose_setup_commands
- cp .env.template .env
- if [ ! -z "$REQUIRED_MICROSERVICES" ]; then docker-compose up -d $REQUIRED_MICROSERVICES; fi
_docker_compose_build_command: &docker_compose_build_command cd $TRAVIS_BUILD_DIR && for service in $BUILD_SERVICES; do docker-compose build "$service"; done
_python_test_command: &python_test_command cd $COMPONENT_DIR && poetry install -v && poetry run pytest
_python_job_config: &python_job_config
language: python
python: "3.8"
cache:
pip: true
install:
- pip install poetry==1.0.10
before_script: *docker_compose_setup_commands
script:
- *python_test_command
- *docker_compose_build_command
jobs:
include:
- name: schemas
language: node_js
node_js: lts/*
before_install: cd src/schemas
- name: gui
language: node_js
node_js: 14
before_install:
- *docker_compose_setup_commands
- cd src/gui
script:
- npm test
- *docker_compose_build_command
env:
- BUILD_SERVICES=gui
- name: manobase
<<: *python_job_config
env:
- SERVICE_NAME=mano-base
- COMPONENT_DIR=src/mano-framework/base
- REQUIRED_MICROSERVICES=broker
- BUILD_SERVICES=mano-base
- name: repository
<<: *python_job_config
env:
- SERVICE_NAME=repository
- COMPONENT_DIR=src/repository
- BUILD_SERVICES="mano-base repository"
- name: pluginmanager
<<: *python_job_config
env:
- SERVICE_NAME=pluginmanager
- COMPONENT_DIR=src/mano-framework/pluginmanager
- REQUIRED_MICROSERVICES="broker mongo"
- BUILD_SERVICES="mano-base pluginmanager"
- name: flm-base
<<: *python_job_config
env:
- SERVICE_NAME=flm-base
- COMPONENT_DIR=src/mano-framework/plugins/function-lifecycle-manager-base
- BUILD_SERVICES="mano-base flm-base"
- name: klm
<<: *python_job_config
script: *docker_compose_build_command # No tests here, they are in flm-base
env:
- SERVICE_NAME=kubernetes-lifecycle-manager
- COMPONENT_DIR=src/mano-framework/plugins/kubernetes-lifecycle-manager
- BUILD_SERVICES="mano-base flm-base kubernetes-lifecycle-manager"
- name: olm
<<: *python_job_config
script: *docker_compose_build_command # There are no tests :(
env:
- SERVICE_NAME=openstack-lifecycle-manager
- COMPONENT_DIR=src/mano-framework/plugins/openstack-lifecycle-manager
- BUILD_SERVICES="mano-base openstack-lifecycle-manager"
- name: placement
<<: *python_job_config
script: *docker_compose_build_command # There are no tests :(
env:
- SERVICE_NAME=placementplugin
- COMPONENT_DIR=src/mano-framework/plugins/placement
- BUILD_SERVICES="mano-base placementplugin"
- name: slm
<<: *python_job_config
env:
- SERVICE_NAME=service-lifecycle-manager
- COMPONENT_DIR=src/mano-framework/plugins/service-lifecycle-manager
- BUILD_SERVICES="mano-base service-lifecycle-manager"
- name: smr
<<: *python_job_config
env:
- SERVICE_NAME=specific-manager-registry
- COMPONENT_DIR=src/mano-framework/plugins/specific-manager-registry
- REQUIRED_MICROSERVICES="broker mongo pluginmanager"
- BUILD_SERVICES="mano-base specific-manager-registry"
- name: gatekeeper
<<: *python_job_config
env:
- SERVICE_NAME=gatekeeper
- COMPONENT_DIR=src/gatekeeper
- BUILD_SERVICES="mano-base gatekeeper"
- name: vim-adaptor
<<: *python_job_config
env:
- SERVICE_NAME=vim-adaptor
- COMPONENT_DIR=src/mano-framework/plugins/vim-adaptor
- BUILD_SERVICES="mano-base vim-adaptor"
# Build and push Docker images on each new tag
- stage: release
if: tag IS present
language: generic
script:
- *docker_compose_setup_commands
# Tag built images as "latest"
- export PISHAHANG_VERSION=latest
# Build base images first
- docker-compose build mano-base
- docker-compose build flm-base
# Build all images
- docker-compose build
# Push all "latest" images to the Docker registry
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker-compose push
# Tag all "latest" images with the current version tag (by re-building them using the cache)
- export PISHAHANG_VERSION="$TRAVIS_TAG"
- docker-compose build
# Push all version-tagged images to the Docker registry
- docker-compose push
fast_finish: true
allow_failures:
- name: smr # The tests have to be fixed yet