forked from oscript-library/opm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
77 lines (68 loc) · 2.4 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
sudo: required
language: generic
notifications:
email: false
env:
global:
- CHANNEL=dev
- PACKAGE_NAME=opm
matrix:
- OSCRIPT_VERSION=1_0_21
- OSCRIPT_VERSION=night-build
matrix:
allow_failures:
- env: OSCRIPT_VERSION=night-build
services:
- docker
addons:
sonarqube: true
jdk:
- oraclejdk8
before_install:
# Load cached docker images
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
before_cache:
# Save tagged docker images
- >
mkdir -p $HOME/docker && docker images -a --filter='dangling=false' --format '{{.Repository}}:{{.Tag}} {{.ID}}'
| xargs -n 2 -t sh -c 'test -e $HOME/docker/$1.tar.gz || docker save $0 | gzip -2 > $HOME/docker/$1.tar.gz'
install:
- docker pull evilbeaver/onescript:1.0.21
script:
- docker version
- docker run -it -e OSCRIPT_VERSION=$OSCRIPT_VERSION -v $(pwd):/work_dir evilbeaver/onescript:1.0.20 sh -c 'cd /work_dir; sh /work_dir/travis-ci.sh; exit' | tee /tmp/test.log
- grep 'Результат прогона тестов <Да>' /tmp/test.log
after_success:
# - bash <(curl -s https://codecov.io/bash)
- ./sonar-qube.sh
cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'
- '$HOME/docker'
jobs:
include:
- stage: Сборка и публикация github & hub.oscript.io
script: skip
before_deploy:
- docker run -it -v $(pwd):/work_dir evilbeaver/onescript:1.0.21 sh -c 'cd /work_dir; opm build ./ ; exit'
deploy:
- provider: releases
api_key: "$GITHUB_OAUTH_TOKEN"
file_glob: true
file: $PACKAGE_NAME*.ospx
skip_cleanup: true
on:
branch: master
tags: true
- provider: script
skip_cleanup: true
script: docker run -it -e GITHUB_OAUTH_TOKEN=$GITHUB_OAUTH_TOKEN -v $(pwd):/work_dir evilbeaver/onescript:1.0.21 sh -c 'cd /work_dir; opm push --token $GITHUB_OAUTH_TOKEN --channel dev --file ./$PACKAGE_NAME-*.ospx; exit'
on:
branch: develop
- provider: script
skip_cleanup: true
script: docker run -it -e GITHUB_OAUTH_TOKEN=$GITHUB_OAUTH_TOKEN -v $(pwd):/work_dir evilbeaver/onescript:1.0.21 sh -c 'cd /work_dir; opm push --token $GITHUB_OAUTH_TOKEN --channel stable --file ./$PACKAGE_NAME-*.ospx; exit'
on:
branch: master
tags: true