From 4bbb1f2e90e80c1cb683e0321cd868d4a175d5f1 Mon Sep 17 00:00:00 2001
From: Ilia Eriomenco <ilia.eriomenco@endava.com>
Date: Wed, 31 Mar 2021 13:09:42 +0300
Subject: [PATCH] ci: refactor script template in eLife test-chrome

---
 .gitlab-ci.elife.yml | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/.gitlab-ci.elife.yml b/.gitlab-ci.elife.yml
index 7513e9b7a9..8d86f5c730 100644
--- a/.gitlab-ci.elife.yml
+++ b/.gitlab-ci.elife.yml
@@ -78,23 +78,23 @@ deploy:
     # used by psql
     PGUSER: kotahidev
     PGPASSWORD: kotahidev
-    INSTANCE_NAME: elife
   services:
     - postgres
-  script:
-    - cd ${HOME}
-    - apt-get -y install postgresql-client
-    # this is needed for pgboss initial setup
-    #- psql -h postgres -U kotahidev -d kotahidev -c "create extension pgcrypto;"
-    # use the example env for tests
-    - cp .env.example .env
-    # specify host here else it confuses the linked postgres image
-    - POSTGRES_HOST=postgres yarn test:all:$TEST_ITEM
+
+.script_templ: &run_script_templ
+   - cd ${HOME}
+   - apt-get -y install postgresql-client
+   # use the example env for tests
+   - cp .env.example .env
     
 test-chrome:
   <<: *run_test_template
-  variables:
-    TEST_ITEM: "chrome:elife"
+  script:
+    - *run_script_templ
+    # this is needed for pgboss initial setup
+    - psql -h postgres -U kotahidev -d kotahidev -c "create extension pgcrypto;"
+    # specify host here else it confuses the linked postgres image
+    - POSTGRES_HOST=postgres yarn test:all:chrome:elife
 
 # test-chrome:
 #   image: $IMAGE_ORG/$IMAGE_NAME-dev:$CI_COMMIT_SHA
-- 
GitLab