Skip to content

Instantly share code, notes, and snippets.

@boxrick
Created October 26, 2018 10:37
Show Gist options
  • Save boxrick/1ecd0f57221d9403517996376b2a6105 to your computer and use it in GitHub Desktop.
Save boxrick/1ecd0f57221d9403517996376b2a6105 to your computer and use it in GitHub Desktop.
Travis Build
language: python
sudo: true
# Install required packages for build
addons:
apt:
packages:
- unzip
- curl
# Only trigger on Master branch
branches:
only:
- master
# Only trigger on tagged releases
on:
tags: true
# Make use of caching to improve build times
cache:
apt: true
pip: true
directories:
- "$HOME/.cache/pip"
# Decrypt
before_install:
- xxxxxxx
# Install Packer / Ansible, pull down roles, start SSH agent.
install:
- wget https://releases.hashicorp.com/packer/1.3.1/packer_1.3.1_linux_amd64.zip
- unzip packer_1.3.1_linux_amd64.zip -d ./
- pip install -U pip wheel
- pip install ansible
- eval "$(ssh-agent -s)"
- ssh-add
- tar xvzf credentials/credentials.tar.gz -C ./credentials/
- "./pull-roles.sh"
# When we trigger from cron, build our base image
jobs:
include:
- name: "deploy-megatron-base"
if: type = cron
script:
- "./packer_build.sh --base"
# When we trigger from push, build our deploy image
- name: "deploy-megatron-code"
if: type != cron
script:
- "./packer_build.sh --code"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment