algo/.travis.yml

74 lines
2.1 KiB
YAML
Raw Normal View History

---
language: python
python: "2.7"
sudo: required
dist: trusty
services:
- docker
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
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
- LXC_NAME=docker LXC_DISTRO=ubuntu LXC_RELEASE=artful
before_install:
- test "${LXC_NAME}" != "docker" || docker build -t travis/algo .
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 ''
- chmod 0644 ~/.ssh/config
- 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
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
- ansible-playbook deploy.yml --syntax-check
- ./tests/local-deploy.sh
after_script:
- ./tests/update-users.sh
2017-04-22 18:57:39 +00:00
notifications:
email: false