-
Notifications
You must be signed in to change notification settings - Fork 17
/
.travis.yml
86 lines (78 loc) · 3.34 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
85
86
# https://travis-ci.org/tgbugs/pyontutils
language: python
cache:
directories:
- $HOME/.cache/pip
- $HOME/.m2
- ${TRAVIS_BUILD_DIR}/../SciGraph
branches:
only:
- dev
- master
git:
depth: 10
python:
- 3.9
env:
global:
- ONTOLOGY=$(git show --first-parent --name-only --pretty='' HEAD | grep '\.ttl$')
- DOCS=$(git show --first-parent --name-only --pretty='' HEAD | grep '^docs\/')
- TRAVIS=$(git show --first-parent --name-only --pretty='' HEAD | grep '^\.travis.yml$')
matrix:
- ONT_CONFIG=nifstd
- ONT_CONFIG=sparc
before_install:
- if [[ -n $DOCS && $TRAVIS_BRANCH = master ]];then echo trigger docs build; fi
- git checkout ${TRAVIS_BRANCH} # ontload doesn't currently work if git is in detached head mode
- mkdir build
- pushd build
- wget https://raw.githubusercontent.com/tgbugs/pyontutils/master/nifstd/scigraph/graphload-base-template.yaml
- >
case ${ONT_CONFIG} in
nifstd) curl -o ontologies.yaml https://raw.githubusercontent.com/tgbugs/pyontutils/master/nifstd/scigraph/ontologies-nifstd.yaml ;;
sparc) curl -o ontologies.yaml https://raw.githubusercontent.com/SciCrunch/sparc-curation/master/resources/scigraph/ontologies-sparc.yaml ;;
esac
- popd
install:
- pip install git+https://github.com/tgbugs/pyontutils.git
- >
ontload scigraph
--scigraph-quiet
--scigraph-org SciGraph
--scigraph-branch master
--zip-location "${TRAVIS_BUILD_DIR}/build"
--git-local $(realpath "${TRAVIS_BUILD_DIR}/../")
script:
- >
ontload graph NIF-Ontology NIF
--scigraph-quiet
--path-build-scigraph $(realpath "${TRAVIS_BUILD_DIR}/../")
--scigraph-org SciGraph
--scigraph-branch master
--zip-location "${TRAVIS_BUILD_DIR}/build"
--git-local $(realpath "${TRAVIS_BUILD_DIR}/../")
--branch ${TRAVIS_BRANCH}
--graphload-config "${TRAVIS_BUILD_DIR}/build/graphload-base-template.yaml"
--graphload-ontologies "${TRAVIS_BUILD_DIR}/build/ontologies.yaml"
- >
mv
"${TRAVIS_BUILD_DIR}/build/NIF-Ontology-${TRAVIS_BRANCH}-graph-*.zip"
"$(filename=$(basename $(realpath NIF-Ontology-dev-graph-*.zip)); echo "${filename%.*}-${ONT_CONFIG}.zip")"
after_success:
- echo ""
before_deploy:
- git config --local user.name "Travis Build Bot"
- git config --local user.email "[email protected]"
- export TRAVIS_TAG=${TRAVIS_TAG:-${TRAVIS_BRANCH}-${TRAVIS_BUILD_NUMBER}}
- if [[ -n $ONTOLOGY || -n $TRAVIS ]];then git tag $TRAVIS_TAG; fi
deploy:
provider: releases
api_key:
secure: "CK0fvltjiIAiJ0fDlqzyHG0XpvoROODdRZc7LLwajxNAfRMl9TjH5jD9zVsaH3dt11grweoknRS8WcAzZ2kwDePEbTKON20Ay2tvf73fIzxpA+szg+zJF+sH23bx3xEQrjW/9SQTYx7dOGrvJwhI9GPqctFjPpSwy40/+nMBJ7gocF8TG1ZSswa1anFsM6LNtcSb+qRduIto8z8XkIyi7/BV6yfXrPj/HAeDUoDTVaIQj85DONWmV9h4vrkHBgcqFtWwVvt5uIRCscwFUPYhGcPCBE9sGGeCOaYLiwGzmBwoR4DPuc8Qns4WY/JqBa/IbhmuenybWxlTpgwW+NCs8VcmOrcP9plBxf52nVYNIT4u+k+2h4LwLu3fuJMA0YhQuwnok18b6wS4Yf0E04s03YiouM7kzDAQ6Y8ZESmcJ0CeileGDoxBeI4HIs+xohMsNbpj+KcxcBVQF9tvpBw9ysZodpiYPgO8fnVcIa7li4gtRcDgQGw0NeIEC/VU4wiZJQsQp1W6wqFI6fkZ6dsN9q/zO1nhkyhUChFWQAoQWaMZNhsS6xQiuZkjSrPtyFFEYR0rbzFIMIEk2fzbqwnE4pHyok2vTBDTVGdZGez+O0fLJPs1ojgS0BprciYZqeT8JRu+jv/MZ89lhdilwt1xsJH5+3dYtghAyUv8UfkgIss="
file_glob: true
file: "${TRAVIS_BUILD_DIR}/build/NIF-Ontology-${TRAVIS_BRANCH}-graph-*.zip"
prerelease: true
draft: true
on:
all_branches: true
condition: -n $ONTOLOGY