Skip to content

Instantly share code, notes, and snippets.

@NeQuissimus
Last active April 20, 2018 02:20
Show Gist options
  • Save NeQuissimus/edb222d3a2ad5db673691c2d45f4f291 to your computer and use it in GitHub Desktop.
Save NeQuissimus/edb222d3a2ad5db673691c2d45f4f291 to your computer and use it in GitHub Desktop.
Run Ansible tests on NixOS
# There is no /bin/bash, use shebangs.patch to fix shebangs
λ nix-shell -p python2Packages.setuptools_scm -p ansible -p python2Packages.pytest -p python2Packages.pip
$ python setup.py egg_info
$ COMMIT_MESSAGE="bla" test/utils/shippable/timing.sh test/utils/shippable/shippable.sh "cloud/default/2.7/4"
diff --git a/test/utils/shippable/cloud.sh b/test/utils/shippable/cloud.sh
index cfc6153e31..e50c16d901 100755
--- a/test/utils/shippable/cloud.sh
+++ b/test/utils/shippable/cloud.sh
@@ -1,6 +1,6 @@
-#!/bin/bash -eux
+#!/usr/bin/env bash
-set -o pipefail
+set -euxo pipefail
declare -a args
IFS='/:' read -ra args <<< "$1"
diff --git a/test/utils/shippable/shippable.sh b/test/utils/shippable/shippable.sh
index 54dc2fbbd1..e22fe45faf 100755
--- a/test/utils/shippable/shippable.sh
+++ b/test/utils/shippable/shippable.sh
@@ -1,6 +1,6 @@
-#!/bin/bash -eux
+#!/usr/bin/env bash
-set -o pipefail
+set -euxo pipefail
declare -a args
IFS='/:' read -ra args <<< "$1"
diff --git a/test/utils/shippable/timing.sh b/test/utils/shippable/timing.sh
index 9cfdeb395e..e94b99bb8d 100755
--- a/test/utils/shippable/timing.sh
+++ b/test/utils/shippable/timing.sh
@@ -1,5 +1,5 @@
-#!/bin/bash -eux
+#!/usr/bin/env bash
-set -o pipefail
+set -euxo pipefail
"$@" 2>&1 | gawk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment