forked from dgrantkeane/cdis-manifest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
43 lines (35 loc) · 1.91 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
language: python
before_script:
- pip install gen3utils --upgrade
script:
# validate manifest.json and etlMapping.yaml:
- |
# for push builds, TRAVIS_BRANCH is the current branch name; for PR
# builds, it's the name of the branch targeted by the PR.
# We need the latter, which we can't get for push builds, so the tests
# only run properly on PRs.
changed_files=$(git diff --name-only HEAD..$TRAVIS_BRANCH)
envs=()
for file in $changed_files; do
envs+=($(echo "$file" | cut -d "/" -f1))
done
# remove duplicates
envs=($(printf "%s\n" "${envs[@]}" | sort -u)); echo "${uniq[@]}"
echo "Updated: ${envs[@]}"
for dir in "${envs[@]}"; do
man=$dir/manifest.json; etl=$dir/etlMapping.yaml
# validate manifest.json
if [ -f $man ]; then
echo " Validating $dir"
gen3utils validate-manifest $man || exit 1
fi
# validate ETL mapping
if [ -f $man ] && [ -f $etl ]; then
gen3utils validate-etl-mapping $etl $man || exit 1
fi
done
# comment on PRs with relevant deployment changes:
- if [[ $TRAVIS_PULL_REQUEST != false ]]; then gen3utils post-deployment-changes uc-cdis/cdis-manifest $TRAVIS_PULL_REQUEST; fi
env:
global:
secure: HhImWeXynQB8hPU7CwIV3+737ritkiAfyZunkdbOjubQ69t0kmeoPNfoc56qRmaogFsoEiKeJFbsvHCFTQa8MkV0ZHjVxqzCrf+e+bRaNnlXVUuPScX7I2BBUUDBsBqjd3PA73RWv5Ge6OeNk1IKfFZpH3uPYP2w/xqrQSzVbx5LH7H7yfivyPNdOxis41SakckDDAduHruyvWsjmB2zbEZ8PPM6xGZ2Jrv5zOq5FUoYg1XZt6VnRPwyDzLRWZcjtJi9b2RomtbcQkcIDHrgRB4Q9a0qh1RcAB5ANAPvYpsLHwh76otoKhT2p3OatQ98H7BlFwE4dMJwTxoJnsxsa5mMiT8WVwFuoDl8PYcX6G+BrnId+XnrZ9wczySeOPAB1B0ZD5EHmTDLK5IJ5uf0FLd635zvpGom4h2w1DSrjVUGSSOmx1I6ecnQPYdia1/3kTew6tTMGBzPEHlU4T9wMKnWIZdiYZLMYlm14YVDQcmuf4/c76Je4KZwD+ogF1ZVYlcOLvT9SyYjt48jlQBd6u/4O4v5+3F1HcIuAOD36qXZIE+Ax3sj05LdnqfF024x+FHpCJPgz+D+vLk93Cqnmr9TCSL/uu+n5vLchMGrTrvdRHTqu+mMM8MFxnrbuP8jp4AOVzslDq0VbAx0I+E0wiZlhVwhbxrznRDQJ3EaP3A=