-
Notifications
You must be signed in to change notification settings - Fork 67
/
.gitlab-ci.yml
55 lines (49 loc) · 1.96 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
include:
- project: perun/common
file: /templates/.gitlab-ci-template.yml
variables:
# release from production branch instead of main
RELEASE_FROM_PRODUCTION: 1
postgres_docker_build:
stage: .pre
image: registry.gitlab.ics.muni.cz:443/perun/ci/pipeline-components/kaniko:latest
tags:
- k8s-root
before_script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"},\"$CI_DEPENDENCY_PROXY_SERVER\":{\"auth\":\"$(printf "%s:%s" ${CI_DEPENDENCY_PROXY_USER} "${CI_DEPENDENCY_PROXY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
variables:
FOLDER: perun-base/src/test/resources
script:
- >-
/kaniko/executor
--context "$CI_PROJECT_DIR/$FOLDER"
--dockerfile "$CI_PROJECT_DIR/$FOLDER/Dockerfile"
--build-arg CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX="$CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX"
--destination "$CI_REGISTRY_IMAGE/postgres:$CI_COMMIT_SHA"
maven-build:
tags:
- k8s-1s
script:
- mvn -DDB_DRIVER=org.postgresql.Driver -DDB_URL=jdbc:postgresql://db:5432/perun -DDB_USERNAME=perun -DDB_PASSWORD=test clean install
services:
- name: $CI_REGISTRY_IMAGE/postgres:$CI_COMMIT_SHA
alias: db
variables:
POSTGRESQL_USERNAME: perun
POSTGRESQL_PASSWORD: test
POSTGRESQL_DATABASE: perun
HEALTHCHECK_TCP_PORT: "5432"
deploy:
stage: deploy
image: registry.gitlab.ics.muni.cz:443/perun/ci/pipeline-components/maven:3-eclipse-temurin-21
script:
- 'mvn deploy -s ci_settings.xml -DskipTests'
rules:
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != 'schedule' && $CI_PIPELINE_SOURCE != 'trigger'"
openapi-lint:
stage: test
image: registry.gitlab.ics.muni.cz:443/perun/ci/pipeline-components/expo:latest
script:
- npm install -g @quobix/vacuum
- vacuum lint -d -e -a perun-openapi/openapi.yml