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:
|
2018-05-10 06:03:05 +00:00
|
|
|
- sourceline: 'ppa:ubuntu-lxc/stable'
|
2018-05-24 15:15:27 +00:00
|
|
|
- sourceline: 'ppa:wireguard/wireguard'
|
2017-01-11 20:20:47 +00:00
|
|
|
packages:
|
2018-05-10 06:03:05 +00:00
|
|
|
- python-pip
|
|
|
|
- lxd
|
|
|
|
- expect-dev
|
|
|
|
- debootstrap
|
|
|
|
- shellcheck
|
|
|
|
- tree
|
|
|
|
- bridge-utils
|
|
|
|
- dnsutils
|
|
|
|
- build-essential
|
|
|
|
- libssl-dev
|
|
|
|
- libffi-dev
|
|
|
|
- python-dev
|
2018-05-24 15:15:27 +00:00
|
|
|
- linux-headers-$(uname -r)
|
|
|
|
- wireguard-dkms
|
2017-01-11 20:20:47 +00:00
|
|
|
|
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $HOME/lxc/
|
|
|
|
pip: true
|
|
|
|
|
|
|
|
before_cache:
|
|
|
|
- mkdir $HOME/lxc
|
2018-05-24 14:08:14 +00:00
|
|
|
- sudo tar cf $HOME/lxc/cache.tar /var/lib/lxd/images/
|
2017-01-11 20:20:47 +00:00
|
|
|
- sudo chown $USER. $HOME/lxc/cache.tar
|
|
|
|
|
|
|
|
env:
|
2018-05-24 14:08:14 +00:00
|
|
|
- LXC_NAME=docker LXC_DISTRO=ubuntu LXC_RELEASE=18.04
|
2018-03-16 20:38:53 +00:00
|
|
|
|
|
|
|
before_install:
|
2018-05-24 15:15:27 +00:00
|
|
|
- test "${LXC_NAME}" != "docker" && sudo modprobe wireguard || 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."
|
|
|
|
- ssh-keygen -f ~/.ssh/id_rsa -t rsa -N ''
|
2018-03-16 20:38:53 +00:00
|
|
|
- chmod 0644 ~/.ssh/config
|
2018-05-10 06:03:05 +00:00
|
|
|
- echo -e "#cloud-config\nssh_authorized_keys:\n - $(cat ~/.ssh/id_rsa.pub)" | sudo lxc profile set default user.user-data -
|
|
|
|
- sudo cp -f tests/lxd-bridge /etc/default/lxd-bridge
|
|
|
|
- sudo service lxd restart
|
|
|
|
- sudo lxc launch ${LXC_DISTRO}:${LXC_RELEASE} ${LXC_NAME}
|
|
|
|
- until host ${LXC_NAME}.lxd 10.0.8.1 -t A; do sleep 3; done
|
|
|
|
- export LXC_IP="$(dig ${LXC_NAME}.lxd @10.0.8.1 +short)"
|
2018-03-27 16:46:10 +00:00
|
|
|
- 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
|
2018-05-24 15:15:27 +00:00
|
|
|
# - shellcheck algo
|
2018-08-27 14:05:45 +00:00
|
|
|
# - ansible-lint main.yml users.yml deploy_client.yml
|
|
|
|
- ansible-playbook main.yml --syntax-check
|
2018-03-16 20:38:53 +00:00
|
|
|
- ./tests/local-deploy.sh
|
2017-03-18 09:22:07 +00:00
|
|
|
- ./tests/update-users.sh
|
2017-04-22 18:57:39 +00:00
|
|
|
|
|
|
|
notifications:
|
|
|
|
email: false
|