From 0987753c51762f8af9eae05eb5fbdecec1d2af02 Mon Sep 17 00:00:00 2001
From: Varac <varac@varac.net>
Date: Thu, 19 Sep 2019 12:54:07 +0200
Subject: [PATCH] Use right inventory location for prometheus alter test

Closes: #302
---
 .gitlab-ci.yml | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 160006bff..f9b21e3ee 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -93,7 +93,7 @@ testinfra:
     - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
     - echo -e 'Host *\n  stricthostkeychecking no' > ~/.ssh/config
     - cd ansible/
-    - pytest -v -m 'testinfra' --connection=ansible --ansible-inventory=../clusters/$HOSTNAME/inventory.yml --hosts='ansible://*'
+    - pytest -v -m 'testinfra' --connection=ansible --ansible-inventory=../clusters/${HOSTNAME}/inventory.yml --hosts='ansible://*'
   only:
     changes:
       - .gitlab-ci.yml
@@ -111,7 +111,7 @@ certs:
     - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
     - echo -e 'Host *\n  stricthostkeychecking no' > ~/.ssh/config
     - cd ansible/
-    - pytest -s -m 'certs' --connection=ansible --ansible-inventory=../clusters/$HOSTNAME/inventory.yml --hosts='ansible://*'
+    - pytest -s -m 'certs' --connection=ansible --ansible-inventory=../clusters/${HOSTNAME}/inventory.yml --hosts='ansible://*'
   only:
     changes:
       - .gitlab-ci.yml
@@ -129,9 +129,10 @@ prometheus-alerts:
     - eval $(ssh-agent -s)
     - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
     - cd test/
-    - py.test -s -m 'prometheus' --connection=ansible --ansible-inventory=./inventory.yml --hosts='ansible://*'
+    - pytest -s -m 'prometheus' --connection=ansible --ansible-inventory=../clusters/${HOSTNAME}/inventory.yml --hosts='ansible://*'
   only:
     changes:
+      - .gitlab-ci.yml
       - ansible/**/*
       - helmfiles/**/*
       - test/**/*
-- 
GitLab