Skip to content

Instantly share code, notes, and snippets.

Avatar

Jamie Hewland JayH5

View GitHub Profile
@JayH5
JayH5 / .travis.yml.diff
Created Jan 29, 2019
Diff of Travis Xenial dist
View .travis.yml.diff
@@ -1,4 +1,4 @@
-sudo: false
+dist: xenial
language: python
cache: pip
@JayH5
JayH5 / .travis.yml
Created Jan 29, 2019
Example environment variable flags
View .travis.yml
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 Jan 29, 2019
Example Travis file with boolean expression
View .travis.yml
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 Jan 29, 2019
Example Travis build stage diff
View .travis.yml.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 Jan 28, 2019
Example release stage
View .travis.yml
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 Jan 28, 2019
Example release stage
View .travis.yml
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 Jan 28, 2019
Travis single-element lists as strings
View .travis.yml
---
language: python
services:
- postgresql
before_install:
- pip install --upgrade pip
install:
- pip install -r requirements/dev.txt
script:
@JayH5
JayH5 / .travis.yml
Last active Jan 28, 2019
Shorter YAML list/map syntax
View .travis.yml
---
branches:
only:
- master
# These two bits of YAML are equivalent, but one is shorter
---
branches: {only: [master]}
@JayH5
JayH5 / .travis.yml
Created Jan 28, 2019
Travis inline script example
View .travis.yml
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 Jan 28, 2019
Example Python Travis file
View .travis.yml
dist: xenial
language: python
cache: pip
before_install:
- pip install --upgrade pip
install:
- pip install -r requirements/dev.txt
- pip install codecov
script: