Skip to content
.gitlab-ci.yml 1.03 KiB
Newer Older
nimrod's avatar
nimrod committed
---
include:
nimrod's avatar
nimrod committed
  - project: shore/ci-stuff
nimrod's avatar
nimrod committed
    file: templates/pre-commit.yml
nimrod's avatar
nimrod committed
  - project: shore/ci-stuff
nimrod's avatar
nimrod committed
    file: templates/docker.yml
nimrod's avatar
nimrod committed
  - project: shore/ci-stuff
    file: templates/notify.yml
nimrod's avatar
nimrod committed

build:
  extends: .compose-build
nimrod's avatar
nimrod committed
  tags: &tags [ns4.shore.co.il]
  rules:
    - if: $CI_PIPELINE_SOURCE != "schedule"
nimrod's avatar
nimrod committed

pull:
  extends: .compose-pull
  tags: *tags
  rules:
    - if: $CI_PIPELINE_SOURCE != "schedule"
nimrod's avatar
nimrod committed

run:
  rules:
    - if: $CI_PIPELINE_SOURCE != "schedule"
      when: manual
nimrod's avatar
nimrod committed
  extends: .compose-run
nimrod's avatar
nimrod committed
  tags: *tags


backup:
  rules:
    - if: $CI_PIPELINE_SOURCE == "schedule"
  stage: deploy
  tags: [host01.shore.co.il]
  image: docker.io/library/docker:20.10
  before_script:
    - >-
      docker build
      --tag registry.shore.co.il/registry-backup
      --pull
      backup
  script:
    - >-
      docker run
      --volume /var/backups/registry:/var/backups/registry
      registry.shore.co.il/registry-backup
      backup registry.shore.co.il /var/backups/registry
  retry:
    max: 2
  timeout: 3h