Task #38
Updated by Fernando Jose Capeletto Neto almost 2 years ago
Create a muti-topic branch CMS_IntegrationTest Jenkins Pipeline w/ steps:
- a) For TrackHandler: Test - Build - Create Docker Img (Tagged with '1.0-SNAPSHOT', using 'integration-test' spring boot profile, transient to be deleted after test)
- b) For CMSDisplay: Test - Build - Create Docker Img (Tagged with '1.0-SNAPSHOT', pointing to TrackHandler port exposed in the spring boot profile above, the image is also transient to be deleted after the test)
- c) Using a dedicated docker-compose file enclosing both CMS microservices, including a test DB instance with its admin, and start a Cloud Instance over this docker-compose to test the snapshot(s).
- d) The pipeline shall allow specifying the branch for each service.
- e) Document in the CMS wiki the environment vars and profiles used to distinguish from production (Kafka, Rabbit, exposed ports)
= Preliminar Stage =
* (1) Created multitopic TrackHandler_Snapshot_Deliver https://jenkins.fernando.engineer/job/TrackHandler_Snapshot_Deliver/ that Test, Build, Publish Jar to Nexus, Create and Publish a Snapshot Image to Docker Hub.
** The Dockerfile for this version expose port 2977 and allow the further usage of this image in a docker-container for integratedtests profile. (to be containerized with or without cmsdisplay for tests)
* (2) Created multitopic CMSDisplay_Deliver https://jenkins.fernando.engineer/job/CMSDisplay_Deliver/ that publishes Image to DockerHub
** (*) For now, branch integrationtests is adapted to tests.
* TODO: Pending "#19 (build profiles creation)":/issues/19 to allow usage of multi topic branches with different profiles to produce multi snapshots for CMSDisplay.
* Enabled https://jenkins.fernando.engineer/job/CMS_Development_Deploy/ and https://jenkins.fernando.engineer/job/CMS_Development_Interrupt/ that turn on and off a CMS DEV using docker-compose connecting last images of trackHandler:snapshot (produced in [1]) and cmsdisplay:integrationtests (produced in [2*]) availables on Docker Hub.
** The entrypoint for the application is https://cms.dev.lab.fernando.engineer , which its nginx proxy conf maps this hostname over ssl to port 2983 according lab.fernando.engineer port scheme.
The following docker-compose file is being used for how:
<pre>
version: '3'
services:
cmsdisplay-test:
container_name: cmsdisplay-integrationtests
image: fjcapeletto/cmsdisplay:integrationtests
ports:
- "2983:80"
depends_on:
- trackhandler-test
trackhandler-test:
container_name: trackhandler-integrationtests
image: fjcapeletto/trackhandler:snapshot
environment:
- SPRING_PROFILES_ACTIVE=integrationtests
ports:
- "2977:2977"
depends_on:
- th-psql-test
th-psql-test:
container_name: trackhandlerdb-integrationtests-psql
image: postgres
restart: unless-stopped
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=trackhandlerpwd
- POSTGRES_DB=trackhandlerdb
ports:
- "6432:5432"
volumes:
- trackhandlertest_db:/var/lib/postgresql
- postgresql_datatest:/var/lib/postgresql/data
pgadmin-test:
container_name: trackhandlerpgadmin-integrationtests
image: dpage/pgadmin4
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: admin@admin.com
PGADMIN_DEFAULT_PASSWORD: root
ports:
- "6051:80"
volumes:
trackhandlertest_db: {}
postgresql_datatest: {}
</pre>