Skip to content
Snippets Groups Projects
gitlab-ci.yaml 4.83 KiB
# This file is included as part of the main repository .gitlab-ci.yml file

test gcp connection:
  extends: .helm_based_job
  stage: test
  # don't need any artifacts for this to run
  dependencies: []
  script:
    - gcloud compute instances list
    - if [ "${GEOSPHERE_DEPLOY_GCP_CLUSTER_NAME}" != "" ]; then
        gcloud container clusters get-credentials "${GEOSPHERE_DEPLOY_GCP_CLUSTER_NAME}" --zone "${GEOSPHERE_DEPLOY_GCP_ZONE_NAME}";
        kubectl get all;
      fi

gcp create geotiff storage:
  extends: .helm_based_job
  stage: create storage
  script:
    - ns=$(./helpers/get_namespace.sh)
    - ./helpers/create_pvc.sh "$ns" "ci_gcp/geotiff-pvc.yaml" "cspp-geo-geo2grid"
  # this job doesn't actually need any artifacts from previous jobs
  dependencies: []
  rules:
    - if: $CI_COMMIT_TAG !~ /^gcp-r[0-9]+_[0-9]+/
      when: never
    # this will always be true for tags
    - changes:
        - ci_gcp/geotiff-pvc.yaml
    - if: $CREATE_STORAGE

gcp create postgres storage:
  extends: .helm_based_job
  stage: create storage
  script:
    - ns=$(./helpers/get_namespace.sh)
    - ./helpers/create_pvc.sh "$ns" "ci_gcp/postgres-pvc.yaml" "geosphere-postgis"
  # this job doesn't actually need any artifacts from previous jobs
  dependencies: []
  rules:
    - if: $CI_COMMIT_TAG !~ /^gcp-r[0-9]+_[0-9]+/
      when: never
    - changes:
        - ci_gcp/postgres-pvc.yaml
    - if: $CREATE_STORAGE

gcp create shapefile storage:
  extends: .helm_based_job
  stage: create storage
  script:
    - ns=$(./helpers/get_namespace.sh)
    - ./helpers/create_pvc.sh "$ns" "ci_gcp/shapefiles-pvc.yaml" "geosphere-tile-gen-shapefiles"
  # this job doesn't actually need any artifacts from previous jobs
  dependencies: []
  rules:
    - if: $CI_COMMIT_TAG !~ /^gcp-r[0-9]+_[0-9]+/
      when: never
    # this will always be true for tags
    - changes:
        - ci_gcp/shapefiles-pvc.yaml
    - if: $CREATE_STORAGE

gcp deploy rabbit:
  extends: .helm_based_job
  stage: deploy infrastructure
  script:
    - ./helpers/deploy_rabbitmq.sh ci_gcp
  # this job doesn't actually need any artifacts from previous jobs
  dependencies: []
  rules:
    - if: $CI_COMMIT_TAG !~ /^gcp-r[0-9]+_[0-9]+/