-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy path.travis.yml
47 lines (47 loc) · 1.96 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
dist: jammy
os: linux
env:
global:
- DEFAULT_BRANCH: master
- GOPROXY: https://proxy.golang.org,https://goproxy.io,direct
language: python
python: 3.9
jobs:
include:
- stage: run-unit-tests
if: tag IS NOT present
install:
- pip install flake8 coverage coveralls
- pip install ./provision
script:
- cd provision
- coverage run --source=. -m pytest acc_provision
- coveralls
- stage: push-package
if: tag IS present
go: 1.22.x
go_import_path: github.com/noironetworks/aci-containers
before_script:
- export UPSTREAM_ID=81c2369
- eval "$(GIMME_GO_VERSION=1.22.5 gimme)"
- export TRAVIS_GO_VERSION=1.22.5
- export TRAVIS_GO_IMPORT_PATH=github.com/noironetworks/aci-containers
- export TRAVIS_BUILD_USER="$(curl -s "https://api.travis-ci.com/v3/build/$TRAVIS_BUILD_ID" | jq -r .created_by.login)"
- go version
script:
- echo "Skip running UTs"
- git clone http://www.github.com/noironetworks/cicd -b main /tmp/cicd
- pip install jq pyyaml pytz || travis_terminate 1
- /tmp/cicd/travis/show-image-tags.sh || travis_terminate 1
- /tmp/cicd/travis/check-git-tag.sh; RETURN_CODE=$? ; if [ $RETURN_CODE -eq 140 ]; then travis_terminate 0; elif [ $RETURN_CODE -ne 0 ]; then travis_terminate $RETURN_CODE; fi
- pip install ./provision || travis_terminate 1
- /tmp/cicd/travis/clone-aci-containers-repo.sh || travis_terminate 1
- pushd /tmp/noironetworks/aci-containers
- git checkout -qf ${TRAVIS_TAG}
- /tmp/cicd/travis/show-git-repo-status.sh
- make -C . dist-static/acikubectl || travis_terminate 1
- popd
- cp /tmp/noironetworks/aci-containers/dist-static/acikubectl provision/bin/acikubectl || travis_terminate 1
- /tmp/cicd/travis/build-acc-provision.sh || travis_terminate 1
- pip install -U twine
- /tmp/cicd/travis/push-to-pypi.sh