File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # Update the Docker images used in the molecule testing for this role.
4
+ # Please note that this script requires the yq tool
5
+ # (https://github.com/mikefarah/yq) which can be installed from brew as
6
+ # yq and is available on Arch as go-yq.
7
+
8
+ set -o nounset
9
+ set -o errexit
10
+ set -o pipefail
11
+
12
+ # Print usage information and exit.
13
+ function usage {
14
+ echo " Usage:"
15
+ echo " ${0##*/ } [source_file]"
16
+ echo
17
+ echo " Arguments:"
18
+ echo " source_file If specified use this file instead of the default"
19
+ echo " molecule/default/molecule.yml"
20
+ exit 1
21
+ }
22
+
23
+ # Check for required external programs. If any are missing output a list of all
24
+ # requirements and then exit.
25
+ function check_dependencies {
26
+ if [ -z " $( command -v yq) " ]; then
27
+ echo " This script requires the following tools to run:"
28
+ echo " - yq"
29
+ exit 1
30
+ fi
31
+ }
32
+
33
+ if [ $# -gt 1 ]; then
34
+ usage
35
+ fi
36
+
37
+ if [ $# -eq 1 ]; then
38
+ source_file=" $1 "
39
+ else
40
+ source_file=" molecule/default/molecule.yml"
41
+ fi
42
+
43
+ check_dependencies
44
+
45
+ yq ' .platforms[].image' < " $source_file " | xargs -n 1 docker pull
You can’t perform that action at this time.
0 commit comments