forked from rohityadavcloud/monkeybox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliasrc
60 lines (46 loc) · 2.37 KB
/
aliasrc
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
#
# Source this file in your ~/.bashrc or ~/.zshrc using:
# echo "source $PWD/aliasrc" >> ~/.bashrc
# echo "source $PWD/aliasrc" >> ~/.zshrc
#
# Utf8 exports
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# Local apps
export PATH=$HOME/bin:$PATH
# Maven
export MAVEN_OPTS="-Xmx4096m -XX:MaxPermSize=500m -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
# Jenv
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
# Pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
agentscp() {
ROOT=$PWD
echo "[acs agent] Syncing changes to agent: $1"
echo "[acs agent] Copied systemvm.iso"
scp $ROOT/systemvm/dist/systemvm.iso root@$1:/usr/share/cloudstack-common/vms/
echo "[acs agent] Syncing python lib changes to agent: $1"
scp -r $ROOT/python/lib/* root@$1:/usr/lib64/python2.6/site-packages/ 2>/dev/null || true
scp -r $ROOT/python/lib/* root@$1:/usr/lib64/python2.7/site-packages/ 2>/dev/null || true
echo "[acs agent] Syncing scripts"
scp -r $ROOT/scripts/* root@$1:/usr/share/cloudstack-common/scripts/
echo "[acs agent] Syncing kvm hypervisor jars"
ssh root@$1 "rm -f /usr/share/cloudstack-agent/lib/*"
scp -r $ROOT/plugins/hypervisors/kvm/target/*jar root@$1:/usr/share/cloudstack-agent/lib/
scp -r $ROOT/plugins/hypervisors/kvm/target/dependencies/*jar root@$1:/usr/share/cloudstack-agent/lib/
echo "[acs agent] Syncing cloudstack-agent config and scripts"
scp $ROOT/agent/target/transformed/log4j-cloud.xml root@$1:/etc/cloudstack/agent/
ssh root@$1 "sed -i 's/INFO/DEBUG/g' /etc/cloudstack/agent/log4j-cloud.xml"
ssh root@$1 "sed -i 's/logs\/agent.log/\/var\/log\/cloudstack\/agent\/agent.log/g' /etc/cloudstack/agent/log4j-cloud.xml"
scp $ROOT/agent/target/transformed/libvirtqemuhook root@$1:/usr/share/cloudstack-agent/lib/
scp $ROOT/agent/target/transformed/cloud-setup-agent root@$1:/usr/bin/cloudstack-setup-agent
ssh root@$1 "sed -i 's/@AGENTSYSCONFDIR@/\/etc\/cloudstack\/agent/g' /usr/bin/cloudstack-setup-agent"
scp $ROOT/agent/target/transformed/cloud-ssh root@$1:/usr/bin/cloudstack-ssh
scp $ROOT/agent/target/transformed/cloudstack-agent-upgrade root@$1:/usr/bin/cloudstack-agent-upgrade
ssh root@$1 "chmod +x /usr/bin/cloudstack*"
ssh root@$1 "systemctl status cloudstack-agent && systemctl restart cloudstack-agent"
echo "[acs agent] Copied all files, start hacking!"
}