.gitlab-ci.yml 855 Bytes
Newer Older
1
2
3
4
5
image: debian:bullseye-slim

stages:
  - test
  - deploy
Marius Kriegerowski's avatar
Marius Kriegerowski committed
6
7
8
9
10
11

test:
  before_script:
    - apt-get update -y -qq
    - apt-get install postgresql -y -qq
  services:
12
    - name: ${CI_REGISTRY}/dynamicexposure/server-components/containers/docker-obm-database:master
Marius Kriegerowski's avatar
Marius Kriegerowski committed
13
14
15
16
17
18
19
20
      alias: postgres
  variables:
    POSTGRES_USER: "postgres"
    POSTGRES_PASSWORD: "9doij23408usf"
    PGPASSWORD: "$POSTGRES_PASSWORD"

  interruptible: true
  script:
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
    - ./run-migrations.sh -u postgres -h postgres

deploy:
  image: docker:19.03.12
  services:
    - docker:19.03.12-dind
  variables:
    IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
  before_script:
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
  tags:
    - dind
  script:
    - docker build --pull -t $IMAGE_TAG .
    - docker push $IMAGE_TAG
#  only:
#    refs:
#      - master