-
Notifications
You must be signed in to change notification settings - Fork 150
/
.cirrus.yml
105 lines (98 loc) · 3.28 KB
/
.cirrus.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
#
# Configuration for Cirrus CI tests
#
checkout_and_setup_task_template: &SETUP_TASK_TEMPLATE
env_info_script: |
# display data about Python interpreter
set -e
echo "Python executable: $(command -v python)"
echo "Python version: $(python -V 2>&1)"
dependencies_script: |
case $(python V 2>&1) in
'Python 2.7'*)
# as of 2021-01-05, setuptools 51 and pip 21 have dropped support
# for Py 2.7 completely, so we need to use earlier versions to
# continue testing
pip install --upgrade 'setuptools<=44.1.1' 'pip==20.3.3' ;;
'Python 3.'*)
pip install --upgrade 'setuptools>=21' 'pip>=9.0.0' ;;
esac
setup_script: |
pip install -e .
task:
<<: *SETUP_TASK_TEMPLATE
name: Unit Tests
test_script: |
set -e
pip install 'pytest>=2.10' 'pytest-cov' 'mock' 'tox' 'codecov'
pytest -v --cov=elasticluster --cov-branch
echo "OK: ElastiCluster's unit tests successfully performed."
exit 0
matrix:
- container:
image: python:2.7
allow_failures: true
- container:
image: python:3.5
- container:
image: python:3.6
- container:
image: python:3.7
- container:
image: python:3.8
- container:
image: python:3.9
task:
<<: *SETUP_TASK_TEMPLATE
name: Install Tests
# Try running `elasticluster` commands
test_script: |
set -e
# different incantations of the `elasticluster` command
export PATH="$PATH:${{ matrix.env.path }}"
elasticluster --version
elasticluster list-templates
echo "OK: ElastiCluster successfully installed."
exit 0
matrix:
# until CirrusCI #826 is implemented, we must specify images by name and version
- compute_engine_instance:
image_project: centos-cloud
image: centos-7-v20210316
- compute_engine_instance:
image_project: centos-cloud
image: centos-8-v20210316
- compute_engine_instance:
image_project: debian-cloud
image: debian-9-stretch-v20210316
- compute_engine_instance:
image_project: debian-cloud
image: debian-10-buster-v20210316
- compute_engine_instance:
image_project: ubuntu-os-cloud
image: ubuntu-1604-xenial-v20210316
- compute_engine_instance:
image_project: ubuntu-os-cloud
image: ubuntu-1804-bionic-v20210325
- compute_engine_instance:
image_project: ubuntu-os-cloud
image: ubuntu-2004-focal-v20210325
- compute_engine_instance:
image_project: ubuntu-os-cloud
image: ubuntu-2010-groovy-v20210325
- macos_instance:
image: big-sur-base
- macos_instance:
image: catalina-base
docker_builder:
name: Publish Docker image
depends_on:
- Unit Tests
- Install Tests
only_if: '$BRANCH == "master" && $CIRRUS_TAG != ""'
env:
DOCKER_USERNAME: ENCRYPTED[!2fe1412a1f9a67f9e6a45ac82ef15c6dbf6703b40271e9d26d1697bdaa0ef547cdc99064e1f4076755d9b776084fc4fc!]
DOCKER_PASSWORD: ENCRYPTED[!a40395ebe17f71ab0ec336090f8035c81929167cd4e1dbb53d0130520d7fbc2c9a9f404511045cc6486e522a9ecc3f60!]
build_script: docker build --tag riccardomurri/elasticluster:$CIRRUS_TAG .
login_script: docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
push_script: docker push riccardomurri/elasticluster:$CIRRUS_TAG