Created
May 19, 2016 20:00
-
-
Save ericdill/9748a2477a3335985b5b84a353111196 to your computer and use it in GitHub Desktop.
replace conda with condalog to get pass through behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
LOGBOOK=bs-testing | |
pkg_list_base="/tmp/automated-list-of-conda-packages" | |
echo "pkg_list_base=$pkg_list_base" | |
#exit 1 | |
echo " | |
Capturing current list of conda packages in | |
[$CONDA_DEFAULT_ENV] | |
(if empty, you are in the root environment | |
" | |
conda list -e > $pkg_list_base-before.txt | |
conda $* | |
#source activate /tmp/foo | |
echo " | |
Capturing current list of conda packages in | |
[$CONDA_DEFAULT_ENV] | |
(if empty, you are in the root environment | |
" | |
conda list -e > $pkg_list_base-after.txt | |
diff $pkg_list_base-before.txt $pkg_list_base-after.txt > $pkg_list_base-diff.txt | |
echo " | |
Package diff: | |
" | |
cat $pkg_list_base-diff.txt | |
echo " | |
Uploading to $LOGBOOK | |
" | |
python -c "from pyOlog.cli.ipy import olog; \ | |
from pyOlog.OlogDataTypes import Attachment; \ | |
import os; \ | |
olog(msg='conda $*', \ | |
logbooks='$LOGBOOK', \ | |
attachments=[Attachment(open('$pkg_list_base-before.txt', 'r')), \ | |
Attachment(open('$pkg_list_base-after.txt', 'r')), \ | |
Attachment(open('$pkg_list_base-diff.txt', 'r'))])" |
awesome.
The (if empty ..
lines are missing a closing )
.
Logbook should be "DAMA Software". Will talk to mizuki tomorrow about getting this distributed in our /opt/conda
puppet module.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So, for example:
will log the packages before and after to the logbook along with the diff. The log will be titled
conda install scikit-beam