.travis.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ---
  2. language: python
  3. python: "2.7"
  4. sudo: required
  5. dist: trusty
  6. matrix:
  7. fast_finish: true
  8. addons:
  9. apt:
  10. sources:
  11. - sourceline: 'ppa:ubuntu-lxc/stable'
  12. packages:
  13. - python-pip
  14. - lxc
  15. - lxc-templates
  16. - expect-dev
  17. - debootstrap
  18. - shellcheck
  19. cache:
  20. directories:
  21. - $HOME/lxc/
  22. pip: true
  23. before_cache:
  24. - mkdir $HOME/lxc
  25. - sudo tar cf $HOME/lxc/cache.tar /var/cache/lxc/
  26. - sudo chown $USER. $HOME/lxc/cache.tar
  27. env:
  28. - LXC_NAME=ubuntu1604 LXC_DISTRO=ubuntu LXC_RELEASE=xenial
  29. - LXC_NAME=ubuntu1704 LXC_DISTRO=ubuntu LXC_RELEASE=zesty
  30. install:
  31. - sudo tar xf $HOME/lxc/cache.tar -C / || echo "Didn't extract cache."
  32. - export LXC_ROOTFS=/var/lib/lxc/$LXC_NAME/rootfs
  33. - 'sudo lxc-create -n $LXC_NAME -t ubuntu -- -r $LXC_RELEASE --mirror http://mirrors.us.kernel.org/ubuntu --packages python || true'
  34. - 'sudo lxc-start -n $LXC_NAME && until (sudo lxc-info -n $LXC_NAME | grep -q ^IP:); do printf . && sleep 1; done && sleep 2'
  35. - export LXC_IP="$(sudo lxc-info -Hin $LXC_NAME)"
  36. - sudo /bin/bash -c "printf '\n$LXC_IP test.lxc\n' >> /etc/hosts"
  37. - ssh-keygen -f ~/.ssh/id_rsa -t rsa -N ''
  38. - sudo mkdir -vm 0700 $LXC_ROOTFS/root/.ssh/
  39. - sudo cp -v ~/.ssh/id_rsa.pub $LXC_ROOTFS/root/.ssh/authorized_keys
  40. - sudo apt-get install build-essential libssl-dev libffi-dev python-dev && sudo pip install -r requirements.txt
  41. - pip install ansible-lint
  42. - gem install awesome_bot
  43. script:
  44. # - 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
  45. # - shellcheck algo
  46. # - ansible-lint deploy.yml users.yml deploy_client.yml
  47. - ansible-playbook deploy.yml --syntax-check
  48. - ansible-playbook deploy.yml -t local,vpn,dns,ssh_tunneling,security,tests -e "server_ip=$LXC_IP server_user=root IP_subject_alt_name=$LXC_IP local_dns=Y"
  49. after_script:
  50. - ./tests/update-users.sh
  51. notifications:
  52. email: false