Snippets
Set up pkgbox
Install Ubuntu 14.04 on a fresh VM
...Copy Dru's post, but:
- Remove betabox part;
- Make port-forwarding specifically reference -p 4022;
- Maybe even make the hostname specific.
Set up keyless access to new VM.
...TODO.
Start VM
vboxmanage startvm aal-lpc-1-4 --type headless
Set up bbansible on host;
- Clone
autonomy/bbansible
-->cuddihyd/bbansible
- Check it out. (Alternative: apt-get install, have postinstall symlink
/opt/bbansible/current/inventory/local
to/opt/etc/me.acr/bbansible/inventory/local
) cd /opt/bbansible/current
Confirm pkgbox reachable
ansible pkgbox -i inventory/local -a hostname -u ubuntu --ask-pass
Confirm that the hostname shown here matches what you expect for your VM.
Setup pkgbox
ansible-playbook -i inventory/local --ask-pass --become --ask-become-pass ./playbook.pkgbox.yml
...then enter s****t for password. Hit enter to use that for the sudo password as well.
Set up environment for packaging
use bbsage && bb-dot.sh bbsage --sync
checkoutmanage co betabox-trusty
sudo mkdir /opt/apt
sudo ln -s ${HOME}/hgdev/org.bitbucket/betabox-trusty/betabox-trusty.bitbucket.org /opt/apt/current
Add a line to /etc/apt/sources.list
prior to the entry for betabox-trusty:
deb file:///opt/apt/current/ubuntu fimero main
Build Packages
First:
export FLAVOR=betabox
...Then:
cd ~/hgdev/org.bitbucket/autonomy/bbsage && bb-package.sh
cd ~/hgdev/org.bitbucket/autonomy/bbmint && bb-package.sh
cd ~/hgdev/org.bitbucket/autonomy/bbdill && bb-package.sh
cd ~/hgdev/org.bitbucket/autonomy/bbthyme && bb-package.sh
cd ~/hgdev/org.bitbucket/autonomy/bbginger && bb-package.sh
Testing Packages install
sudo apt-get update
sudo apt-get install bbginger
Ensure no errors on install.
Smoke-Test Pystack
Try a few pystack commands to make sure it passes basic smoke-test:
use bbginger
use bbruntime
publish-list
export BBDILL_TX_HOST=rest.knyc.acr.lab
tx-get-quotable-id dl.fx.dxy
Unit-Test Pystack
Now that we have a clean VM with the dependencies as per the latest pystack-deb-packages only, we can unit-test:
cd ~/hgdev/org.bitbucket/autonomy/bbmint/content/ && make opt-bbmint && make test
cd ~/hgdev/org.bitbucket/autonomy/bbdill/content/ && make opt-bbdill && make test
cd ~/hgdev/org.bitbucket/autonomy/bbthyme/content/ && make opt-bbthyme && make test
cd ~/hgdev/org.bitbucket/autonomy/bbginger/content/ && make opt-bbginger && make test
Assuming you've already created a standard VM in which to do this work, here are the steps:
Prepare your work environment
These steps will turn your raw Ubuntu VM into a machine tuned for testing and packaging the pystack components.
- Make your VM comfortable -- Make yourself an account, add your SSH-keys for Bitbucket, install your favorite dev tools, etc.
- Install bbsage --
sudo apt-get install bbsage bbansible
-- this will include all of the tools you need to build and package the pystack debs. - Sync bbsage dotfiles -- You'll customize this VM for packaging so sync the bbsage dotfiles into your working directory:
use bbsage && bb-dot bbsage --sync
- Retrieve betabox-trusty tree --
cd ~/hgdev/org.bitbucket
mkdir betabox-trusty
hg clone ssh://hg@bitbucket.org/betabox-trusty/betabox-trusty.bitbucket.org
- Add local betabox-trusty tree to your
/etc/apt/sources.list
sudo mkdir /opt/apt
- `sudo ln -s ${HOME}/hgdev/org/bitbucket/betabox-trusty/ /opt/apt/current;
- Add a line prior to the other betabox-trusty entries like:
deb file:///opt/apt/current/ubuntu fimero main
sudo apt-get update
sudo apt-get install bbginger
Test Packaging
We'll testing the packaging step first to ensure we have all of the prerequisite libraries install properly.
- Retrieve pystack source packages
checkoutmanager co pystack-default
(this works courtesy of bbsage dotfiles) - Make debs -- This will create the debs and install them in your local reprepro tree:
cd ~/hgdev/org.bitbucket/autonomy/bbsage && bb-package.sh
cd ~/hgdev/org.bitbucket/autonomy/bbmint && bb-package.sh
cd ~/hgdev/org.bitbucket/autonomy/bbdill && bb-package.sh
cd ~/hgdev/org.bitbucket/autonomy/bbthyme && bb-package.sh
cd ~/hgdev/org.bitbucket/autonomy/bbginger && bb-package.sh
- **Install
You can clone a snippet to your computer for local editing. Learn more.