5884cc
image: registry.opensuse.org/opensuse/infrastructure/containers/heroes-salt-testing:latest
5884cc
f6b82d
stages:
aa384d
  - test
f6b82d
  - deploy
f6b82d
3a50e8
.test_mr:
3a50e8
  rules:
3a50e8
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == 'production'
3a50e8
Christian Boltz 03e2ab
.test_common:
3a50e8
  extends:
3a50e8
    - .test_mr
Christian Boltz d190f0
  stage: test
Theo Chatzimichos 15a116
  tags:
Theo Chatzimichos 15a116
    - docker
Theo Chatzimichos 15a116
Christian Boltz df440c
.test_artifacts:
Christian Boltz df440c
  artifacts:
Christian Boltz df440c
    when: always
Christian Boltz df440c
    paths:
Christian Boltz df440c
      - '*.txt'
Christian Boltz df440c
9d40b0
lint:
9d40b0
  extends:
9d40b0
    - .test_common
9d40b0
  image: registry.opensuse.org/opensuse/infrastructure/containers_tumbleweed/heroes-salt-validation:latest
e6639f
  script:
e6639f
    - bin/set_gitlab_ci_safe_directory.sh
e6639f
    - bin/lint.sh
9d40b0
Christian Boltz 03e2ab
validate:
Christian Boltz 03e2ab
  extends:
Christian Boltz 03e2ab
    - .test_common
Christian Boltz 03e2ab
  image: registry.opensuse.org/opensuse/infrastructure/containers_tumbleweed/heroes-salt-validation:latest
e6639f
  script:
e6639f
    - bin/set_gitlab_ci_safe_directory.sh
e6639f
    - bin/test_validate.sh
Christian Boltz 03e2ab
86fbd9
show_highstate:
Christian Boltz 03e2ab
  extends:
Christian Boltz 03e2ab
    - .test_common
Christian Boltz df440c
    - .test_artifacts
Theo Chatzimichos 15a116
  before_script:
ef2551
    - bin/prepare_test_env.sh -g -o Leap,15,5 -s
Theo Chatzimichos 15a116
  script: bin/test_show_highstate.sh
Theo Chatzimichos 02fadf
2c9b9e
test_haproxy:
Christian Boltz 03e2ab
  extends:
Christian Boltz 03e2ab
    - .test_common
Christian Boltz df440c
    - .test_artifacts
2c9b9e
  image: registry.opensuse.org/opensuse/infrastructure/containers/heroes-salt-testing-haproxy:latest
2c9b9e
  before_script:
Christian Boltz 5a10a2
    - bin/prepare_test_env.sh -g -s -n
2c9b9e
    - bin/replace_secrets.sh
2c9b9e
  script: bin/test_haproxy.sh
Christian Boltz 1af0ca
#     changes:
Christian Boltz 1af0ca
#       - bin/test_haproxy.sh
Christian Boltz 1af0ca
#       - pillar/cluster/*/*
Christian Boltz 1af0ca
#       - pillar/common/haproxy/*
Christian Boltz 1af0ca
#       - salt/profile/proxy/*
Christian Boltz 1af0ca
#       - salt/role/proxy*
2c9b9e
d52ea3
test_nftables:
d52ea3
  extends:
d52ea3
    - .test_common
d52ea3
  image: registry.opensuse.org/opensuse/infrastructure/containers/heroes-salt-testing-nftables:latest
d52ea3
  script: bin/test_nftables.pl
d52ea3
3c0e11
test_prometheus:
3c0e11
  extends:
3c0e11
    - .test_common
3c0e11
  image: registry.opensuse.org/opensuse/infrastructure/containers/heroes-salt-testing-prometheus:latest
3c0e11
  before_script: bin/prepare_test_env.sh -g -s -n
3c0e11
  script: bin/test_prometheus.sh
3c0e11
  artifacts:
3c0e11
    when: always
3c0e11
    paths:
3c0e11
      - '*.txt'
3c0e11
      - rules/*.txt
3c0e11
4552b4
# Dynamically generated jobs
4552b4
prepare_includes:
3a50e8
  extends:
3a50e8
    - .test_mr
8ccc20
  script: bin/render_gitlab_ci_includes.py -w
4552b4
  artifacts:
4552b4
    paths:
0cb66a
      - .gitlab-ci.includes/*.yml
4552b4
4552b4
test_highstate:
3a50e8
  extends:
3a50e8
    - .test_mr
4552b4
  needs:
4552b4
    - prepare_includes
4552b4
  trigger:
4552b4
    include:
4552b4
      - artifact: .gitlab-ci.includes/test_highstate.yml
4552b4
        job: prepare_includes
4552b4
    strategy: depend
4552b4
0cb66a
test_nginx:
3a50e8
  extends:
3a50e8
    - .test_mr
0cb66a
  needs:
0cb66a
    - prepare_includes
0cb66a
  trigger:
0cb66a
    include:
0cb66a
      - artifact: .gitlab-ci.includes/test_nginx.yml
0cb66a
        job: prepare_includes
0cb66a
    strategy: depend
4552b4
93fec8
.deploy:
93fec8
  rules:
93fec8
    - if: $CI_COMMIT_BRANCH == 'production'
f6b82d
  stage: deploy
f6b82d
  tags:
d51946
    - docker
93fec8
93fec8
sync:
93fec8
  extends: .deploy
93fec8
  script:
93fec8
    - "rsync -a --delete --super --owner --group --chown=477:479 --chmod='u=rwX,g=rX,o=' $PWD/ rsync://saltpush@witch1.infra.opensuse.org:873/salt-push/"
93fec8
93fec8
deploy:
93fec8
  extends: .deploy
13ee3f
  image: registry.opensuse.org/opensuse/infrastructure/containers_tumbleweed/heroes-salt-deployment:latest
93fec8
  needs:
93fec8
    - sync
93fec8
  script:
e6639f
    - bin/set_gitlab_ci_safe_directory.sh
34d77d
    - bin/deploy.py --mode test --no-mine-update --state-verbose=False