-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy path.gitlab-ci.yml
55 lines (49 loc) · 1.99 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/pipeline/#customization
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
include:
- template: Jobs/Code-Quality.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
variables:
DOCKER_IMAGE: geoserver
CURRENT_VERSION: 2.25.0
NEW_VERSION: 2.25.2
code_quality_html:
extends: code_quality
variables:
REPORT_FORMAT: html
artifacts:
paths: [gl-code-quality-report.html]
stages:
- test
- upgrade
sast:
stage: test
upgrade_geoserver:
stage: upgrade
script:
- echo "Pulling new Docker image"
- docker pull $DOCKER_IMAGE:$NEW_VERSION
- echo "Stopping current GeoServer container"
- docker stop geoserver_container || true
- echo "Removing current GeoServer container"
- docker rm geoserver_container || true
- echo "Starting new GeoServer container"
- docker run -d --name geoserver_container -p 8080:8080 $DOCKER_IMAGE:$NEW_VERSION
- echo "Waiting for the new container to start"
- >
for i in {1..30}; do
if docker ps | grep -q geoserver_container; then
echo "GeoServer container is running"
exit 0
fi
echo "Waiting for GeoServer container to start ($i/30)"
sleep 1
done
- echo "GeoServer container failed to start within 30 seconds"
- exit 1
when: manual