include: "https://git.autistici.org/ai3/build-container/raw/master/common.yml"

# test the newly built container before releasing it.
stages:
  - build
  - test
  - release

test:
  stage: test
  image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/debian:stable
  services:
    - name: ${IMAGE_TAG}
      alias: noblogs
    - name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/mysql:latest
      alias: mysql
  variables:
    APACHE_PORT: 8080
    SITE_URL: "http://noblogs:8080"
    MYSQL_DATABASE: noblogstest
    MYSQL_ROOT_PASSWORD: changeme
    PHP_FPM_USER: www-data
  script:
    - apt -q update
    - env DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install curl
    - "curl -H 'Host: noblogs.org' -v ${SITE_URL}"

