Skip to content
Snippets Groups Projects
Commit 3bd067f0 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Added CI

parent 433bedc3
No related branches found
No related tags found
No related merge requests found
Pipeline #755 failed
stages:
- generate-test-env
- test
- dockerize
variables:
# to avoid "fatal: git fetch-pack: expected shallow list"
GIT_STRATEGY: clone
pre_test:
stage: generate-test-env
tags:
- shell
script:
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
- docker build -t "${CI_REGISTRY_IMAGE}/vospace-test-env" -f src/test/resources/testing-Dockerfile .
- docker push "${CI_REGISTRY_IMAGE}/vospace-test-env"
only:
refs:
- ci-test
changes:
- src/test/resources/testing-Dockerfile
test:
stage: test
tags:
- docker
image: "${CI_REGISTRY_IMAGE}/vospace-test-env"
variables:
FILE_CATALOG_REPO_URL: "https://gitlab-ci-token:${CI_JOB_TOKEN}@www.ict.inaf.it/gitlab/ia2/vospace-file-catalog.git"
script:
- pwd
- ls
- git clone ${FILE_CATALOG_REPO_URL}
- mvn clean test -Dinit_database_scripts_path=../../vospace-file-catalog
- awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print "coverage=" 100*covered/instructions }' target/site/jacoco/jacoco.csv
coverage: '/coverage=\d+\.\d+/'
only:
- ci-test
# Dockerfile for setting up an environment to run tests
FROM git.ia2.inaf.it:5050/ia2/ia2-devops/maven-otj-pg-embedded
USER root
RUN apt-get update && apt-get install -y git
USER postgres
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment