Skip to content

Instantly share code, notes, and snippets.

@arindamchoudhury
Last active March 9, 2016 09:09
Show Gist options
  • Save arindamchoudhury/5385bdd0d03561eab631 to your computer and use it in GitHub Desktop.
Save arindamchoudhury/5385bdd0d03561eab631 to your computer and use it in GitHub Desktop.
Debian packaging
apt-get install -y devscripts python-all-dev python-stdeb rng-tools git vim
rngd -r /dev/urandom
adduser newuser
getent group ecmanaged >/dev/null || groupadd -r ecmanaged
getent passwd ecmanaged >/dev/null || useradd -r -g ecmanaged -d /opt/ecmanaged -s /usr/sbin/nologin -c "account for running ecagent" ecmanaged
su - newuser
gpg --gen-key
git clone https://github.com/ecmanaged/ecm-agent.git
cd ecm-agent && python setup.py --command-packages=stdeb.command sdist_dsc
# change file in source-dir/deb_dist/packagename-version/debian
cp build/debian/* deb_dist/ecmanaged-ecagent-3.0/debian/
#build with debuild -i
cd deb_dist/ecmanaged-ecagent-3.0/debian/ && debuild -i
sudo -i
cp /home/newuser/ecm-agent/deb_dist/ecmanaged-ecagent_3.0-1_all.deb .
gcloud compute copy-files root@instance-1:/root/ecmanaged-ecagent_3.0-1_all.deb .
gcloud compute copy-files ecmanaged-ecagent_3.0-1_all.deb root@instance-1:/root/
#check content with dpkg -c package_file.deb
# install dependencies
apt-get install -y sudo git vim python python-crypto debconf python-twisted-core python-protocols python-twisted-web python-configobj python-twisted-words python-psutil python-libxml2 python-simplejson python-httplib2 python-pip python-dbus PackageKit gir1.2-packagekitglib-1.0
install with dpkg -i package_file.deb
@arindamchoudhury
Copy link
Author

scp newuser@104.131.148.85:~/ecmanaged-ecagent_3.0-1_all.deb .

@arindamchoudhury
Copy link
Author

apt-get install -y python python-crypto debconf python-twisted-core python-protocols python-twisted-web python-configobj python-twisted-words python-psutil python-libxml2 python-simplejson python-httplib2 python-pip sudo pkg-config dh-python

@arindamchoudhury
Copy link
Author

ACCOUNT=4855041cfb6c006a7b39c481fa7f7f38eb6c9e2ecfff917ebd3e0e9d3f098670

@arindamchoudhury
Copy link
Author

/opt/ecmanaged/ecagent/configure.py --account 4855041cfb6c006a9c1b0fa200ccd10d81db2e7935af870de47ef67c3ed66d86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment