forked from whamcloud/integrated-manager-for-lustre
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
113 lines (113 loc) · 4.62 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
language: python
python: "2.7"
sudo: required
services:
- docker
- postgresql
addons:
postgresql: "9.2"
apt:
update: true
packages:
- postgresql-server-dev-9.2
jobs:
include:
- stage: test
name: "Docker build Test"
script:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-Linux-x86_64 > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- cd docker
- docker build --rm -t imlteam/manager-service-base -f base.dockerfile ../
- docker build --rm -t imlteam/manager-nginx -f nginx.dockerfile ../
- docker-compose build
- stage: test
name: "Unit Tests"
install:
- pip install -r requirements.txt
- pip install -r requirements.test
before_script:
- psql -c "CREATE USER chroma;" -U postgres
- psql -c "ALTER USER chroma CREATEDB;" -U postgres
- psql -c "CREATE DATABASE chroma OWNER chroma;" -U postgres
script:
- export IML_DISABLE_THREADS=1
- echo "CRYPTO_FOLDER='./'" > local_settings.py
- echo -e "/^DEBUG =/s/= .*$/= True/\nwq" | ed settings.py 2>/dev/null
- python -W always manage.py test tests/unit/
- stage: test
name: "Behave tests"
install:
- pip install -r requirements.txt
- pip install -r requirements.test
before_script:
- psql -c "CREATE USER chroma;" -U postgres
- psql -c "ALTER USER chroma CREATEDB;" -U postgres
- psql -c "CREATE DATABASE chroma OWNER chroma;" -U postgres
script:
- export IML_DISABLE_THREADS=1
- behave --format plain tests/feature/cli/features
- stage: test
name: "Service tests"
script:
- docker run -dit --privileged --name systemd --mount type=bind,source="$(pwd)",target=/integrated-manager-for-lustre -v /sys/fs/cgroup:/sys/fs/cgroup:ro centos/systemd
- docker exec -i systemd bash -c "./integrated-manager-for-lustre/tests/framework/services/runner.sh"
- stage: test
name: "Format Check"
python: "3.6"
install:
- pip install black
script:
- black --check ./
- stage: test
name: "copr build test"
script:
- export SPEC=python-iml-manager.spec
- export SRPM_TASK=iml-srpm
- docker run -it -e SPEC="$SPEC" -e SRPM_TASK="$SRPM_TASK" -e LOCAL_ONLY="True" -v $(pwd):/build:rw imlteam/copr
- ((`find _topdir/RPMS -name *.rpm | wc -l` > 0))
- stage: cd
name: "Continuous Deployment"
script:
- export OWNER=managerforlustre
- export PROJECT=manager-for-lustre-devel
- export PACKAGE=python-iml-manager
- export SPEC=python-iml-manager.spec
- export SRPM_TASK=iml-srpm
- docker run -it -e OWNER="$OWNER" -e PROJECT="$PROJECT" -e PACKAGE="$PACKAGE" -e SPEC="$SPEC" -e SRPM_TASK="$SRPM_TASK" -e KEY="$encrypted_253525cedcf6_key" -e IV="$encrypted_253525cedcf6_iv" -v $(pwd):/build:rw imlteam/copr
- stage: cd
git:
depth: 999999
name: "Continuous Deployment (Docker)"
script:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-Linux-x86_64 > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- cd docker
- docker build --rm -t imlteam/manager-service-base -f base.dockerfile ../
- docker push imlteam/manager-service-base
- docker build --rm -t imlteam/iml-wasm-components -f iml-wasm-components.dockerfile ../
- docker push imlteam/iml-wasm-components
- docker build --rm -t imlteam/manager-nginx -f nginx.dockerfile ../
- docker push imlteam/manager-nginx
- docker-compose build
- docker-compose push
- stage: deploy-copr-r5.0
name: "Copr 5.0 deploy"
script:
- export OWNER=managerforlustre
- export PROJECT=manager-for-lustre-5.0
- export PACKAGE=python-iml-manager
- export SPEC=python-iml-manager.spec
- export SRPM_TASK=iml-srpm
- docker run -it -e PROD="true" -e OWNER="$OWNER" -e PROJECT="$PROJECT" -e PACKAGE="$PACKAGE" -e SPEC="$SPEC" -e SRPM_TASK="$SRPM_TASK" -e KEY="$encrypted_253525cedcf6_key" -e IV="$encrypted_253525cedcf6_iv" -v $(pwd):/build:rw imlteam/copr
stages:
- test
- name: cd
if: branch = master AND type = push AND fork = false
- name: deploy-copr-r5.0
if: branch =~ ^v\d+\.\d+\.\d+-.+-r5\.0$