Skip to content

Instantly share code, notes, and snippets.

View JayH5's full-sized avatar

Jamie Hewland JayH5

  • Yelp
  • London, UK
View GitHub Profile
@JayH5
JayH5 / .travis.yml.diff
Created January 29, 2019 10:03
Diff of Travis Xenial dist
@@ -1,4 +1,4 @@
-sudo: false
+dist: xenial
language: python
cache: pip
@JayH5
JayH5 / .travis.yml
Created January 29, 2019 09:05
Example environment variable flags
matrix:
include:
- python: '3.7'
env: COVERAGE=1
- python: '3.6'
- python: '3.5'
- python: '2.7'
env: COVERAGE=1
script:
@JayH5
JayH5 / .travis.yml
Last active January 29, 2019 09:01
Example Travis file with boolean expression
matrix:
include:
- elixir: '1.6'
- elixir: '1.7'
- elixir: '1.8'
script:
- mix test
# Inch 2.0 only works on Elixir >= 1.7
- '[[ "$TRAVIS_ELIXIR_VERSION" = 1.6 ]] || mix inch.report'
@JayH5
JayH5 / .travis.yml.diff
Last active January 29, 2019 10:27
Example Travis build stage diff
@@ -17,3 +17,18 @@
- python: '3.7'
- python: '3.6'
- python: '3.5'
+
+ - stage: release
+ if: tag IS present
+ deploy:
+ provider: pypi
+ user: praekelt.org
@JayH5
JayH5 / .travis.yml
Created January 28, 2019 14:35
Example release stage
jobs:
include:
- python: '3.7'
- python: '3.6'
- python: '3.5'
- stage: release
if: tag IS present
deploy:
provider: pypi
@JayH5
JayH5 / .travis.yml
Created January 28, 2019 14:23
Example release stage
dist: xenial
services:
- docker
language: bash
env:
global:
- IMAGE_TAG=praekeltorg/mysite
- REGISTRY_USER=praekeltorg-automation
- secret: <REGISTRY_PASS encrypted>
@JayH5
JayH5 / .travis.yml
Created January 28, 2019 14:13
Travis single-element lists as strings
---
language: python
services:
- postgresql
before_install:
- pip install --upgrade pip
install:
- pip install -r requirements/dev.txt
script:
@JayH5
JayH5 / .travis.yml
Last active January 28, 2019 14:00
Shorter YAML list/map syntax
---
branches:
only:
- master
# These two bits of YAML are equivalent, but one is shorter
---
branches: {only: [master]}
@JayH5
JayH5 / .travis.yml
Created January 28, 2019 13:52
Travis inline script example
after_script:
- |
lockfile="puppet/$ENVIRONEMT/Puppetfile.lock"
if [[ $(git status -s "$lockfile") ]]; then
echo "The librarian-puppet lockfile ($lockfile) has changes."
echo 'Please run `bundle exec rake module_install` and commit the changes.'
exit 1
fi
@JayH5
JayH5 / .travis.yml
Last active January 28, 2019 14:36
Example Python Travis file
dist: xenial
language: python
cache: pip
before_install:
- pip install --upgrade pip
install:
- pip install -r requirements/dev.txt
- pip install codecov
script: