Skip to content
Snippets Groups Projects
Verified Commit 97489632 authored by David Hoese's avatar David Hoese
Browse files

Add additional tests and linting

parent 0ac35107
No related branches found
No related tags found
No related merge requests found
Pipeline #18861 failed
......@@ -26,6 +26,7 @@ build_image_mapserver:
variables:
IMAGE_NAME: "geosphere-mapserver"
IMAGE_DIR: "mapserver"
TEST_SCRIPTS: "ci/test_mapserver_image.sh"
build_chart:
stage: build chart
......@@ -47,7 +48,7 @@ build_chart:
- cd chart
- |-
sed -i "s/^appVersion: .*\$/appVersion: ${docker_tag}/g" geosphere-mapserver/Chart.yaml
- helm lint geosphere-mapserver
- ../ci/lint_helm.sh
- helm chart save geosphere-mapserver ${image_url}:${chart_tag}
- helm chart push ${image_url}:${chart_tag}
artifacts:
......
#!/usr/bin/env bash
# Usage: lint_helm.sh
echo "Linting helm chart with no additional values"
helm lint geosphere-mapserver
# need to copy yaml files here so helm docker alias can find them (in PWD)
cp ../ci/*.yaml .
for fn in test-*.yaml; do
echo "Linting helm chart with ${fn}"
helm lint -f ${fn} geosphere-mapserver
done
#!/usr/bin/env bash
debug() {
>&2 echo "DEBUG: $@"
}
error() {
>&2 echo "ERROR: $@"
exit 1
}
if [[ $# -ne 2 ]]; then
error "Usage: ./test_mapserver_image.sh <image_url> <image_tag>"
fi
image_url=$1
image_tag=$2
exit_status=0
# Test Basic Mapfile Render
debug "Starting test docker container (${image_url}:${image_tag})..."
docker run --rm -d --name test -p 8888:80 ${image_url}:${image_tag} || exit_status=1
# just wait a bit to let the server start
sleep 2
debug "Container started. Starting curl basic request..."
curl --max-time 5 "http://localhost:8888/" >/dev/null || exit_status=1
debug "Curl complete. Killing docker container..."
docker kill test
debug "Done killing docker container."
exit $exit_status
\ No newline at end of file
......@@ -31,13 +31,23 @@ MAP
LAYER
NAME "{{ product }}"
TYPE RASTER
{% if postgis_connection_params %}
CONNECTIONTYPE postgis
CONNECTION "{{ postgis_connection_params }}"
TILEITEM "location"
TILEINDEX "{{ product }}_index"
#DATA "{{ postgis_geom_column }} from {{ postgis_table }} using SRID={{ epsg_code }} using unique id"
{% else %}
TILEITEM "location"
TILEINDEX "{{ product }}_index"
{% endif %}
# Comment below to default to transparency
#OFFSITE 0 0 0
PROJECTION
"{{ projection }}"
END
# Uncomment if projection is different than entire mapfile
#PROJECTION
# "{{ projection }}"
#END
PROCESSING "RESAMPLE=AVERAGE"
# Used to keep FastCGI connections open longer
PROCESSING "CLOSE_CONNECTION=DEFER"
......
......@@ -9,7 +9,7 @@ MAP
FONTSET "/work/mapfiles/fonts.list"
PROJECTION
"init=epsg:930916"
"init=epsg:4326"
END
WEB
......
......@@ -9,7 +9,7 @@ MAP
FONTSET "/work/mapfiles/fonts.list"
PROJECTION
"init=epsg:930916"
"init=epsg:4326"
END
WEB
......
......@@ -68,8 +68,10 @@ def main():
'platform_long_name': PLATFORM_LONG_NAMES[platform],
'sector_long_name': SECTOR_LONG_NAMES[sector],
'projection': "init=" + PLATFORM_EPSGS[platform].lower(),
'epsg_code': PLATFORM_EPSGS[platform].replace('EPSG:', ''),
'PLATFORM_EPSGS': PLATFORM_EPSGS,
'PLATFORM_POS_NAMES': PLATFORM_POS_NAMES,
'postgis_connection_params': None, # TODO
}
output_fn = args.output_pattern.format(**tmpl_vars)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment