This repository has been archived by the owner on Nov 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
46 lines (41 loc) · 2.02 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
sudo: required
language: python
python: 3.8
services:
- docker
# Don't build on branches that match a semver string (ie the release tags that we create)
branches:
except:
- /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$/
install:
- chmod u+x $TRAVIS_BUILD_DIR/build/bin/*.sh
- $TRAVIS_BUILD_DIR/build/bin/initbuild.sh
# Python requirements to build the pages documentation website
- python -m pip install -q ansible==2.10.3 mkdocs yamllint
script:
# 1. Validate that the ansible collection lints successfully
- yamllint -c yamllint.yaml ibm/mas_airgap || travis_terminate 1
# 2. Validate that the mkdocs site builds successfully
- mkdocs build --verbose --clean --strict || travis_terminate 1
# 3. Build the Ansible collection
- $TRAVIS_BUILD_DIR/build/bin/build-collection.sh || travis_terminate 1
# 4. Install the Ansible collection in the container image
- cp $TRAVIS_BUILD_DIR/ibm/mas_airgap/ibm-mas_airgap-$(cat $TRAVIS_BUILD_DIR/.version).tar.gz $TRAVIS_BUILD_DIR/image/ansible-airgap/ibm-mas_airgap.tar.gz || travis_terminate 1
# 5. Build and push the docker image
- $TRAVIS_BUILD_DIR/build/bin/docker-build.sh -n ibmmas -i ansible-airgap || travis_terminate 1
- $TRAVIS_BUILD_DIR/build/bin/docker-push.sh || travis_terminate 1
# 6. Build the tekton clustertasks
- $TRAVIS_BUILD_DIR/pipelines/bin/build-pipelines.sh || travis_terminate 1
after_success:
# Publish a GitHub release with the ansible collection tgz as an assset
- $TRAVIS_BUILD_DIR/build/bin/git-release.sh $TRAVIS_BUILD_DIR/ibm/mas_airgap/ibm-mas_airgap-$(cat $TRAVIS_BUILD_DIR/.version).tar.gz $TRAVIS_BUILD_DIR/pipelines/ibm-mas_airgap-clustertasks-$(cat $TRAVIS_BUILD_DIR/.version).tar.gz
deploy:
provider: pages
skip_cleanup: true
github_url: github.com
github_token: $GITHUB_TOKEN
verbose: true
local_dir: site
target_branch: gh-pages
on:
branch: master