v1.0.0: ci: add test

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2024-03-14 18:36:45 +01:00
commit 024a9feda2
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
3 changed files with 64 additions and 1 deletions

42
scripts/prepar_test.sh Normal file
View file

@ -0,0 +1,42 @@
#!/bin/bash
cat <<ENDFILE >> /etc/apk/repositories
http://ftp.halifax.rwth-aachen.de/alpine/v3.16/main
http://ftp.halifax.rwth-aachen.de/alpine/v3.16/community
ENDFILE
apk update
apk add docker docker-cli-compose
docker version
docker compose version
docker load --input "$IMAGE_TYPE-$IMAGE_VERSION-release.tar.gz"
docker tag $CI_REGISTRY_IMAGE:$IMAGE_VERSION-release $IMAGE_TYPE:latest
cat <<ENDFILE > docker-compose.yml
version: '3.1'
services:
postgres:
image: postgres:15.2-alpine3.17
restart: unless-stopped
environment:
POSTGRES_USER: 'acc'
POSTGRES_PASSWORD: 'totor'
POSTGRES_DB: 'accounts'
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
users:
image: $IMAGE_TYPE
volumes:
- ./docker/keys:/keys
depends_on:
postgres:
condition: service_healthy
ENDFILE
docker compose pull --quiet --ignore-pull-failures
docker images
docker compose up -d