# This file is included as part of the main repository .gitlab-ci.yml file
# NOTE: Since this is running from the root of the repository all referenced
#       files must be relative to the root directory.
# Most jobs in this file are only meant to be run when a git tag is created

# Prerequisites:
#   Create TLS certificate secret:
#     kubectl create -n geosphere secret tls geosphere-tls-certs --cert=geosphere_ssec_wisc_edu.crt --key=geosphere_ssec_wisc_edu.key

test_basic_grb:
  extends: .helm_based_job
  stage: test
  script:
    - ./ci_tests/run_basic_grb_test.sh
    # run, but don't care about failure
    - ./ci_tests/run_basic_postgres_test.sh || true
  after_script:
    - ./ci_tests/cleanup_basic_grb_test.sh
    - ./ci_tests/cleanup_basic_postgres_test.sh
  dependencies:
    - get_chart_grb
    - get_chart_geo2grid
    - get_chart_tilegen
    - get_chart_mapserver
    - get_chart_mapcache
    - get_chart_client
  rules:
    - when: on_success

test_basic_pg:
  extends: .helm_based_job
  stage: test
  script:
    # run, but don't care about failure
    - ./ci_tests/run_basic_postgres_test.sh || true
  after_script:
    - ./ci_tests/cleanup_basic_postgres_test.sh
  dependencies:
    - get_chart_grb
    - get_chart_geo2grid
    - get_chart_tilegen
    - get_chart_mapserver
    - get_chart_mapcache
    - get_chart_client
  allow_failure: true
  rules:
    - when: on_success
