summaryrefslogtreecommitdiffstats
path: root/ansible/roles/helm/molecule/default/Dockerfile.j2
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-02-01 10:13:03 +0100
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-02-04 08:16:13 +0000
commit007a4bdfef2e398d9141cc903927bae03ea4bc7a (patch)
tree9926a33421e1947dff68cc65696f56440bc90758 /ansible/roles/helm/molecule/default/Dockerfile.j2
parenta646228c463cd6635dc65ddf40cb5ed53afed5e0 (diff)
Refactor Helm role test setup
Test setup variable inclusion reworked for better sanity. General Molecule docker image is used instead of pre-built one. Change-Id: I013b9d7b92ded86220e6f2092ce75ee47b094d89 Issue-ID: OOM-2665 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'ansible/roles/helm/molecule/default/Dockerfile.j2')
-rw-r--r--ansible/roles/helm/molecule/default/Dockerfile.j214
1 files changed, 14 insertions, 0 deletions
diff --git a/ansible/roles/helm/molecule/default/Dockerfile.j2 b/ansible/roles/helm/molecule/default/Dockerfile.j2
new file mode 100644
index 00000000..e6aa95d3
--- /dev/null
+++ b/ansible/roles/helm/molecule/default/Dockerfile.j2
@@ -0,0 +1,14 @@
+# Molecule managed
+
+{% if item.registry is defined %}
+FROM {{ item.registry.url }}/{{ item.image }}
+{% else %}
+FROM {{ item.image }}
+{% endif %}
+
+RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
+ elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
+ elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
+ elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
+ elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
+ elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi