Skip to content
.gitlab-ci.yml 2.85 KiB
Newer Older
nimrod's avatar
nimrod committed
---
nimrod's avatar
nimrod committed
include:
nimrod's avatar
nimrod committed
  - project: shore/ci-stuff
    file: templates/docker.yml
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
    file: templates/terraform.yml

default:
  before_script:
    - apt-get update
    - apt-get install -y terraform

AWS Terraform plan:
  extends: .tf_plan
  stage: test
  variables: &aws_tf_vars
    TF_ROOT: Terraform/AWS
nimrod's avatar
nimrod committed
  rules: &tf_rules
    - changes:
        - $TF_ROOT/*
        - $TF_ROOT/**/*
nimrod's avatar
nimrod committed

AWS Terraform apply:
  extends: .tf_apply
  stage: deploy
nimrod's avatar
nimrod committed
  rules: *tf_rules
nimrod's avatar
nimrod committed
  needs:
    - job: AWS Terraform plan
      artifacts: true
  variables: *aws_tf_vars
nimrod's avatar
nimrod committed

web-proxy kodi build:
  extends: .compose-build
  tags: ["kodi.shore.co.il"]
  variables:
    WORKDIR: Compose/web-proxy/kodi
nimrod's avatar
nimrod committed
  rules: &compose-rules
    - if: $CI_PIPELINE_SOURCE == "schedule"
    - if: $CI_PIPELINE_SOURCE == "push"
      changes:
        - $WORKDIR/*
        - $WORKDIR/**/*
nimrod's avatar
nimrod committed

web-proxy kodi pull:
  extends: .compose-pull
  tags: ["kodi.shore.co.il"]
  variables:
    WORKDIR: Compose/web-proxy/kodi
nimrod's avatar
nimrod committed
  rules: *compose-rules
nimrod's avatar
nimrod committed

web-proxy kodi run:
  extends: .compose-run
  tags: ["kodi.shore.co.il"]
  variables:
    WORKDIR: Compose/web-proxy/kodi
  when: manual
nimrod's avatar
nimrod committed
  rules: *compose-rules

web-proxy ns4 build:
  extends: .compose-build
  tags: ["ns4.shore.co.il"]
  variables:
    WORKDIR: Compose/web-proxy/ns4
nimrod's avatar
nimrod committed
  rules: *compose-rules
nimrod's avatar
nimrod committed

web-proxy ns4 pull:
  extends: .compose-pull
  tags: ["ns4.shore.co.il"]
  variables:
    WORKDIR: Compose/web-proxy/ns4
nimrod's avatar
nimrod committed
  rules: *compose-rules
nimrod's avatar
nimrod committed

web-proxy ns4 run:
  extends: .compose-run
  tags: ["ns4.shore.co.il"]
  variables:
    WORKDIR: Compose/web-proxy/ns4
  when: manual
nimrod's avatar
nimrod committed
  rules: *compose-rules

web-proxy host01 build:
  extends: .compose-build
  tags: ["host01.shore.co.il"]
  variables:
    WORKDIR: Compose/web-proxy/host01
nimrod's avatar
nimrod committed
  rules: *compose-rules
nimrod's avatar
nimrod committed

web-proxy host01 pull:
  extends: .compose-pull
  tags: ["host01.shore.co.il"]
  variables:
    WORKDIR: Compose/web-proxy/host01
nimrod's avatar
nimrod committed
  rules: *compose-rules
nimrod's avatar
nimrod committed

web-proxy host01 run:
  extends: .compose-run
  tags: ["host01.shore.co.il"]
  variables:
    WORKDIR: Compose/web-proxy/host01
  when: manual
nimrod's avatar
nimrod committed
  rules: *compose-rules
nimrod's avatar
nimrod committed

# Matrix Compose deployment.

matrix-build:
  extends: .compose-build
  tags: &matrix-tags [host01.shore.co.il]
  variables: &matrix-vars
    WORKDIR: Compose/matrix

matrix-pull:
  extends: .compose-pull
  tags: *matrix-tags
  variables: *matrix-vars

matrix-run:
  extends: .compose-run
  tags: *matrix-tags
  variables: *matrix-vars
  needs:
    - job: matrix-build
    - job: matrix-pull
  after_script:
    # yamllint disable rule:line-length
    - docker-compose exec synapse sh -c "while [ ! -f /conf/homeserver.yaml ]; do echo Waiting for the config file.; sleep 1; done"
    - docker-compose exec synapse update_synapse_database --run-background-updates --database-config /conf/homeserver.yaml
    # yamllint enable rule:line-length