forked from merative/spm-middleware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
84 lines (73 loc) · 2.6 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
---
sudo: required
services:
- docker
dist: bionic
language: python
python:
- 3.8
cache:
directories:
- $HOME/.cache/pip
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
install:
- pip install -r ci-requirements.txt
- curl -sLO https://github.com/mikefarah/yq/releases/download/3.4.0/yq_linux_amd64
- chmod +x yq_linux_amd64
- sudo mv yq_linux_amd64 /usr/local/bin/yq
env:
global:
- OCTOKIT_API_ENDPOINT=https://api.github.com/
- ANSIBLE_GALAXY_SERVER_LIST=IBM
- ANSIBLE_GALAXY_SERVER_IBM_URL=https://galaxy.ansible.com/
# ANSIBLE_GALAXY_SERVER_IBM_TOKEN is set using secure environment variables
matrix:
- SCENARIO=websphere-v90-centos-8
- SCENARIO=websphere-v85-centos-7
- SCENARIO=db2111
- SCENARIO=db2115
- SCENARIO=iim-191-centos-8
- SCENARIO=iim-191-centos-8
- SCENARIO=ihs-v90-centos-8
- SCENARIO=ihs-v80-centos-7
stage: Molecule Tests
before_script:
- export COLLECTION_NAMESPACE=$(yq r galaxy.yml namespace)
- export COLLECTION_NAME=$(yq r galaxy.yml name)
- export COLLECTION_VERSION=$(yq r galaxy.yml version)
- export REPO_CLONE_FOLDERNAME=${PWD##*/}
# Create folder structure required by ansible-test and other tooling
- cd ..
- mkdir -p ansible_collections/$COLLECTION_NAMESPACE
- mv $REPO_CLONE_FOLDERNAME ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
- cd ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
# Fake install cloned collection (required for molecule)
- mkdir -p $HOME/.ansible/collections/$COLLECTION_NAMESPACE
- ln -s ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME $HOME/.ansible/collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
script:
# Ansible Molecule tests
- chmod +x ./scripts/*
- ./scripts/downloadInstaller.sh $SCENARIO
- molecule test -s $SCENARIO
jobs:
include:
- stage: Ansible Tests
script:
# Ansible sanity checks
- ansible-test sanity --docker -v --color --python $TRAVIS_PYTHON_VERSION
# Ansible integration tests
- ansible-test integration --docker -v --color --retry-on-error --python $TRAVIS_PYTHON_VERSION --continue-on-error --diff --coverage
- ansible-test coverage xml -v --requirements --group-by command --group-by version
deploy:
- provider: script
script: ./scripts/tagAndPublish.sh
skip_cleanup: true
on:
branch: main
- provider: releases
api_key: "$GITHUB_OAUTH_TOKEN"
file: "./$COLLECTION_NAMESPACE-$COLLECTION_NAME-$COLLECTION_VERSION.tar.gz"
skip_cleanup: true
on:
branch: main