From de19eb1ddce10be12316518d55b277273abeb005 Mon Sep 17 00:00:00 2001
From: Ilia Eriomenco <ilia.eriomenco@endava.com>
Date: Tue, 30 Mar 2021 13:32:32 +0300
Subject: [PATCH] ci: added anchor to test script template in
 .gitlab-ci.elife.yml

---
 .gitlab-ci.elife.yml | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/.gitlab-ci.elife.yml b/.gitlab-ci.elife.yml
index 29ad21a966..8df426f6de 100644
--- a/.gitlab-ci.elife.yml
+++ b/.gitlab-ci.elife.yml
@@ -81,21 +81,24 @@ deploy:
     PGPASSWORD: kotahidev
   services:
     - postgres
-  script:
-    - cd ${HOME}
-    - apt-get -y install postgresql-client
-    # this is needed for pgboss initial setup
-    - hostname
-    - 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
+
+.test_script: &run_test_script   
+  - cd ${HOME}
+  - apt-get -y install postgresql-client
+  # this is needed for pgboss initial setup
+  - hostname
+  - 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
     
 test-chrome:
   <<: *run_test_template
   variables:
     TEST_ITEM: "chrome:elife"
+  script:
+    - *run_test_script
 
 # test-chrome:
 #   image: $IMAGE_ORG/$IMAGE_NAME-dev:$CI_COMMIT_SHA
-- 
GitLab