-
Notifications
You must be signed in to change notification settings - Fork 0
/
env.sh
executable file
·41 lines (36 loc) · 1.11 KB
/
env.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
#!/bin/sh
touch env.log
## SSH AGENT
## ----------------------------------------------------------------------
ssh-agent -k >> env.log 2>&1
eval `ssh-agent`
echo $SSH_AGENT_SOCK
if ! test -f ~/.ssh/id_rsa_github; then
echo "ERROR github key don\'t exists!"
fi
## Github keys
## ----------------------------------------------------------------------
github=$(ssh-add -l | grep github | cut -d ' ' -f 3)
if test -z $github; then
ssh-add ~/.ssh/id_rsa_github >> env.log 2>&1
github=$(ssh-add -l 2>&1 | grep github | cut -d ' ' -f 3)
fi
## python virtualenv
## ----------------------------------------------------------------------
CODE=$PWD
export PYTHONPATH=$CODE
if ! test -d $CODE/.venv; then
python3 -m venv .venv
source $CODE/.venv/bin/activate
# rehash
pip3 install -U pip
pip3 install -r requirements.txt
fi
source $CODE/.venv/bin/activate
## summary
## ----------------------------------------------------------------------
echo 'CODE ' "$CODE"
echo ' ' "$(python3 --version) $(which python3)"
echo ' ' "$(pip3 -V) "
echo ' PYTHONPATH ' "$PYTHONPATH"
echo ' github key ' "$github"