diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1072abdc022d7956d571d4a887df9b78a655bbbf..6328b58224b8d830255fc0e0e4c1b99b0d18f774 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,12 +4,19 @@ include: "https://git.autistici.org/pipelines/containers/raw/master/common.yml" test: stage: container-test image: registry.git.autistici.org/pipelines/images/test/float-podman-runner:master + services: + - docker.io/library/mysql:latest tags: [podman] variables: APACHE_PORT: 8080 SITE_URL: "http://localhost:8080" + MYSQL_DATABASE: noblogs + MYSQL_ROOT_PASSWORD: rootpass before_script: - echo -n "$CI_JOB_TOKEN" | podman login -u gitlab-ci-token --password-stdin $CI_REGISTRY script: - - with-container --expose=8080 $IMAGE_TAG ./docker/test.sh + - DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends mysql-client xz-utils git + - git clone --depth=1 https://gitlab-ci-token:${CI_JOB_TOKEN}/ai3/testdata.git /tmp/testdata.$CI_JOB_ID + - xz -d /tmp/testdata.$CI_JOB_ID/noblogs/noblogs.sql.xz | mysql --user=root --password=rootpass --host=mysql noblogs + - with-container --expose=8080 --mount=type=bind,source=docker/test-config.json,destination=/etc/noblogs/config.json $IMAGE_TAG ./docker/test.sh diff --git a/docker/test-config.json b/docker/test-config.json new file mode 100644 index 0000000000000000000000000000000000000000..85e4eb81bc0ef86f8d1470a35042332a1c2cabde --- /dev/null +++ b/docker/test-config.json @@ -0,0 +1,34 @@ +{ + "secrets": { + "auth_key": "be51a7fb3f4c3924c3a351a834ae605f", + "secure_auth_key": "be51a7fb3f4c3924c3a351a834ae605f", + "logged_in_key": "be51a7fb3f4c3924c3a351a834ae605f", + "nonce_key": "be51a7fb3f4c3924c3a351a834ae605f", + "auth_salt": "be51a7fb3f4c3924c3a351a834ae605f", + "secure_auth_salt": "be51a7fb3f4c3924c3a351a834ae605f", + "logged_in_salt": "be51a7fb3f4c3924c3a351a834ae605f", + "nonce_salt": "be51a7fb3f4c3924c3a351a834ae605f" + }, + "db_config": { + "backends": { + "backend_1": { + "host": "mysql", + "port": 3306, + "user": "root", + "password": "rootpass", + "name": "noblogs" + } + }, + "is_master": true, + "master": { + "host": "mysql", + "port": 3306, + "user": "root", + "password": "rootpass", + "name": "noblogs" + } + }, + "debug": false, + "debug_cookie_name": "__unused__", + "local_backend_name": "backend_1" +}