2017-01-11 20:20:47 +00:00
|
|
|
---
|
|
|
|
language: python
|
|
|
|
python: "2.7"
|
|
|
|
sudo: required
|
|
|
|
dist: trusty
|
|
|
|
|
2018-03-16 20:38:53 +00:00
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
|
2017-01-11 20:20:47 +00:00
|
|
|
matrix:
|
|
|
|
fast_finish: true
|
|
|
|
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
sources:
|
|
|
|
- sourceline: 'ppa:ubuntu-lxc/stable'
|
|
|
|
packages:
|
|
|
|
- python-pip
|
|
|
|
- lxc
|
|
|
|
- lxc-templates
|
|
|
|
- expect-dev
|
|
|
|
- debootstrap
|
2017-04-22 18:57:39 +00:00
|
|
|
- shellcheck
|
2018-03-27 16:28:48 +00:00
|
|
|
- tree
|
2017-01-11 20:20:47 +00:00
|
|
|
|
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $HOME/lxc/
|
|
|
|
pip: true
|
|
|
|
|
|
|
|
before_cache:
|
|
|
|
- mkdir $HOME/lxc
|
|
|
|
- sudo tar cf $HOME/lxc/cache.tar /var/cache/lxc/
|
|
|
|
- sudo chown $USER. $HOME/lxc/cache.tar
|
|
|
|
|
|
|
|
env:
|
|
|
|
- LXC_NAME=ubuntu1604 LXC_DISTRO=ubuntu LXC_RELEASE=xenial
|
2018-02-24 13:17:34 +00:00
|
|
|
- LXC_NAME=ubuntu1710 LXC_DISTRO=ubuntu LXC_RELEASE=artful
|
2018-03-16 20:38:53 +00:00
|
|
|
- LXC_NAME=docker LXC_DISTRO=ubuntu LXC_RELEASE=artful
|
|
|
|
|
|
|
|
before_install:
|
|
|
|
- test "${LXC_NAME}" != "docker" || docker build -t travis/algo .
|
2017-01-11 20:20:47 +00:00
|
|
|
|
|
|
|
install:
|
|
|
|
- sudo tar xf $HOME/lxc/cache.tar -C / || echo "Didn't extract cache."
|
|
|
|
- export LXC_ROOTFS=/var/lib/lxc/$LXC_NAME/rootfs
|
|
|
|
- 'sudo lxc-create -n $LXC_NAME -t ubuntu -- -r $LXC_RELEASE --mirror http://mirrors.us.kernel.org/ubuntu --packages python || true'
|
|
|
|
- 'sudo lxc-start -n $LXC_NAME && until (sudo lxc-info -n $LXC_NAME | grep -q ^IP:); do printf . && sleep 1; done && sleep 2'
|
|
|
|
- export LXC_IP="$(sudo lxc-info -Hin $LXC_NAME)"
|
|
|
|
- sudo /bin/bash -c "printf '\n$LXC_IP test.lxc\n' >> /etc/hosts"
|
|
|
|
- ssh-keygen -f ~/.ssh/id_rsa -t rsa -N ''
|
2018-03-16 20:38:53 +00:00
|
|
|
- chmod 0644 ~/.ssh/config
|
2017-01-11 20:20:47 +00:00
|
|
|
- sudo mkdir -vm 0700 $LXC_ROOTFS/root/.ssh/
|
|
|
|
- sudo cp -v ~/.ssh/id_rsa.pub $LXC_ROOTFS/root/.ssh/authorized_keys
|
2018-03-27 16:46:10 +00:00
|
|
|
- sudo apt-get install build-essential libssl-dev libffi-dev python-dev
|
|
|
|
- pip install -r requirements.txt
|
2017-04-22 18:57:39 +00:00
|
|
|
- pip install ansible-lint
|
|
|
|
- gem install awesome_bot
|
2018-03-27 16:28:48 +00:00
|
|
|
- ansible-playbook --version
|
|
|
|
- tree . -L 2
|
2017-01-11 20:20:47 +00:00
|
|
|
|
|
|
|
script:
|
2017-07-23 07:32:14 +00:00
|
|
|
# - awesome_bot --allow-dupe --skip-save-results *.md docs/*.md --white-list paypal.com,do.co,microsoft.com,https://github.com/trailofbits/algo/archive/master.zip,https://github.com/trailofbits/algo/issues/new
|
2017-04-22 18:57:39 +00:00
|
|
|
# - shellcheck algo
|
|
|
|
# - ansible-lint deploy.yml users.yml deploy_client.yml
|
2017-01-11 20:20:47 +00:00
|
|
|
- ansible-playbook deploy.yml --syntax-check
|
2018-03-16 20:38:53 +00:00
|
|
|
- ./tests/local-deploy.sh
|
2017-02-03 19:24:02 +00:00
|
|
|
|
|
|
|
after_script:
|
2017-03-18 09:22:07 +00:00
|
|
|
- ./tests/update-users.sh
|
2017-04-22 18:57:39 +00:00
|
|
|
|
|
|
|
notifications:
|
|
|
|
email: false
|