forked from NOAA-ORR-ERD/noaa-oil-data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
102 lines (91 loc) · 2.64 KB
/
.gitlab-ci.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
variables:
# CS_MAJOR_VERSION: 3
PYTHON_VER: "3.10"
stages:
- validate
- update_wiki
validate:
stage: validate
image: registry.orr.noaa.gov/erd/centos-conda/centos7-python$PYTHON_VER
tags:
- docker
- linux
except:
- schedules
artifacts:
paths:
- validation_by_record.md
- validation_by_error.md
- data
- conda_listing.txt
before_script:
- echo "ip_resolve=4" >> /etc/yum.conf
# - |-
# if [[ $CI_COMMIT_BRANCH = "production" ]]; then
# BRANCH="production"
# else
# BRANCH="develop"
# fi
# It was too confusing to have different adios_db code used for different
# branches
# but this should be switeched to production when things settle down
# - BRANCH="develop"
- BRANCH="production"
script:
- echo "Starting conda listing"
- conda list
- echo "running the scripts"
- pwd
- echo "cloning ${BRANCH}"
- git clone --depth 1 -b ${BRANCH} https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.orr.noaa.gov/gnome/oil_database/oil_database.git
- pwd
- ls
- cd oil_database
- conda install -y --file adios_db/conda_requirements.txt
- conda list > conda_listing.txt
# Install the adios_db package
- cd adios_db
- pip install -e ./
- cd ../../
# we are saving the status list inside the records.
- adios_db_process_json ./data/oil/ save
- adios_db_validate ./data/oil save
only:
changes:
- .gitlab-ci.yml
- data/**/*
update_validation_report:
stage: update_wiki
tags:
- build
- shell
- linux
script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY_CI_WIKI" | tr -d '\r' | ssh-add - > /dev/null
- git config --global user.email "[email protected]"
- git config --global user.name "Adios Validation Script"
- git remote set-url origin ssh://[email protected]:9933/${CI_PROJECT_PATH}.git
- git stash
- git checkout ${CI_COMMIT_BRANCH}
- git pull
- |-
if [[ `git stash list` ]];then
git stash pop
fi
- git clone ssh://[email protected]:9933/${CI_PROJECT_PATH}.wiki.git
- mkdir -p ${CI_PROJECT_NAME}.wiki/validation_reports/${CI_COMMIT_BRANCH} && cp validation_by_* $_
- ls -la ${CI_PROJECT_NAME}.wiki/validation_reports/${CI_COMMIT_BRANCH}
- cd ${CI_PROJECT_NAME}.wiki
- git add -A
- git diff-index --quiet HEAD || git commit -m 'updating validation reports on wiki'
- git push
- cd -
- eval $(ssh-agent -k)
except:
- server_working_copy
- /^\d{4}/\d{2}/\d{2}_\d{2};\d{2}$/
only:
changes:
- .gitlab-ci.yml
- data/**/*