-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
.travis.yml
51 lines (43 loc) · 1.72 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
language: python
os: linux
python:
- "3.9"
install:
- docker run --privileged --rm tonistiigi/binfmt --install all
- docker buildx create --name xbuilder --use
- docker buildx install
services:
- docker
before_install:
- BRANCH=$(git branch| grep \* |cut -d ' ' -f2)
- GIT_TAG=$(git describe --long --tags --dirty --always)
- DOCKER_REPO="sourcecodeai/aura"
- IMAGE_NAME="${DOCKER_REPO}:${GIT_TAG}"
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then IMAGE_TAG="latest"; IMAGE_TAG_LITE="latest-lite"; fi
- if [[ "$TRAVIS_BRANCH" == "dev" ]]; then IMAGE_TAG="dev"; IMAGE_TAG_LITE="dev-lite"; fi
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
stages:
- build
- test
- make_docs
jobs:
include:
- stage: build
if: (branch = master) OR (branch = dev)
script:
- docker buildx build --platform=linux/amd64,linux/arm64 --target aura-full-tests .
- docker buildx build --platform=linux/amd64,linux/arm64 --target aura-full --push -t ${IMAGE_NAME}-full -t ${DOCKER_REPO}:${IMAGE_TAG} .
- docker buildx build --platform=linux/amd64,linux/arm64 --target aura-lite-tests .
- docker buildx build --platform=linux/amd64,linux/arm64 --target aura-lite --push -t ${IMAGE_NAME}-lite -t ${DOCKER_REPO}:${IMAGE_TAG_LITE} .
- stage: make_docs
if: branch = dev
script:
- pip install -U pip
- pip install awscli
- docker pull ${IMAGE_NAME}-full
- mkdir docs_build && chmod 777 docs_build
- docker run --rm -v $(pwd)/docs_build:/analyzer/docs/build ${IMAGE_NAME}-full make_docs
- cd docs_build/html && aws s3 sync ./ s3://docs.aura.sourcecode.ai --acl public-read
notifications:
email:
on_success: change