-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnightly-conda-sync.sh
69 lines (54 loc) · 1.3 KB
/
nightly-conda-sync.sh
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
#!/bin/bash
set -e
# Vars
noext=$(basename $0 | rev | cut -d. -f2- | rev)
logfile=/var/log/${noext}/${noext}-$(date "+%F_%H-%M-%S").log
gitcmd=/usr/bin/git
# Clean up just in case
rm -f $logfile
echo "Log file: $logfile"
# Check host info
uname -a >> $logfile
hostname >> $logfile
lsb_release -a >> $logfile
# Check the status of the repos and pull
check_status(){
printf '=%.0s' {1..80}
echo
pwd
echo
$gitcmd status
echo
$gitcmd branch -avv
echo
$gitcmd remote -v
echo
$gitcmd pull --all
echo
$gitcmd log -n 3
printf '=%.0s' {1..80}
echo
}
for pkg in rixs sixtools; do
pushd /opt/conda_envs/src/$pkg >/dev/null 2>&1
cat << EOF >> $logfile
$(check_status)
EOF
popd >/dev/null 2>&1
done
. /etc/profile.d/conda.sh
# mrakitin's test env:
# conda activate /root/conda_envs/analysis-2019-3.0.1-nightly-mrakitin-test
conda activate /opt/conda_envs/analysis-2019-3.0.1-nightly
conda env list >> $logfile
conda list >> $logfile
pip list >> $logfile
# Install the latest version of edrixs from the nsls2forge conda channel:
conda install edrixs \
-c https://conda.anaconda.org/nsls2forge \
-c https://repo.anaconda.com/pkgs/main \
--override-channels --no-channel-priority -y \
>> $logfile
conda list >> $logfile
pip list >> $logfile
exit 0